Skip to content

Commit

Permalink
Merge pull request #2595 from Starbuck5/sdl-image-bump
Browse files Browse the repository at this point in the history
SDL_image 2.8.0
  • Loading branch information
Starbuck5 authored Dec 10, 2023
2 parents 5482b63 + 6668911 commit fd129e9
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 237 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-ubuntu-sdist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
sudo apt-mark hold grub-efi-amd64-signed
sudo apt-get update --fix-missing
sudo apt-get upgrade
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev libjpeg-dev python3-setuptools python3-dev
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev python3-setuptools python3-dev
pip3 install sphinx"<7.2.0" numpy>=1.21.0
- name: Make sdist and install it
Expand Down
4 changes: 1 addition & 3 deletions buildconfig/Setup.Android.SDL2.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ SDL = {sdl_includes} -D_REENTRANT -DSDL2 -lSDL2
FONT = {sdl_ttf_includes} -lSDL2_ttf
IMAGE = {sdl_image_includes} -lSDL2_image
MIXER = {sdl_mixer_includes} -lSDL2_mixer
JPEG = {jpeg_includes} -ljpeg
SCRAP =
PNG = {png_includes} -lpng16
FREETYPE = {freetype_includes} -lfreetype -lharfbuzz

DEBUG =
Expand All @@ -15,7 +13,7 @@ DEBUG =
#everything you can, but you can ignore ones you don't have
#dependencies for, just comment them out

imageext src_c/imageext.c $(SDL) $(IMAGE) $(PNG) $(JPEG) $(DEBUG)
imageext src_c/imageext.c $(SDL) $(IMAGE) $(DEBUG)
font src_c/font.c $(SDL) $(FONT) $(DEBUG)
mixer src_c/mixer.c $(SDL) $(MIXER) $(DEBUG)
mixer_music src_c/music.c $(SDL) $(MIXER) $(DEBUG)
Expand Down
2 changes: 0 additions & 2 deletions buildconfig/Setup.Emscripten.SDL2.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
#FONT = -lSDL2_ttf
#IMAGE = -lSDL2_image
#MIXER = -lSDL2_mixer
#JPEG = -ljpeg
#SCRAP =
#PNG = -lpng
#FREETYPE = -lfreetype -lharfbuzz

DEBUG =
Expand Down
4 changes: 1 addition & 3 deletions buildconfig/Setup.SDL2.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ SDL = -I/usr/include -D_REENTRANT -DSDL2 -lSDL2
FONT = -lSDL2_ttf
IMAGE = -lSDL2_image
MIXER = -lSDL2_mixer
PNG = -lpng
JPEG = -ljpeg
SCRAP = -lX11
PORTMIDI = -lportmidi
PORTTIME = -lporttime
Expand All @@ -25,7 +23,7 @@ DEBUG =
#everything you can, but you can ignore ones you don't have
#dependencies for, just comment them out

imageext src_c/imageext.c $(SDL) $(IMAGE) $(PNG) $(JPEG) $(DEBUG)
imageext src_c/imageext.c $(SDL) $(IMAGE) $(DEBUG)
font src_c/font.c $(SDL) $(FONT) $(DEBUG)
mixer src_c/mixer.c $(SDL) $(MIXER) $(DEBUG)
mixer_music src_c/music.c $(SDL) $(MIXER) $(DEBUG)
Expand Down
2 changes: 0 additions & 2 deletions buildconfig/config_darwin.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ def main(auto_config=False):
]

DEPS.extend([
Dependency('PNG', 'png.h', 'libpng', ['png']),
Dependency('JPEG', 'jpeglib.h', 'libjpeg', ['jpeg']),
Dependency('PORTMIDI', 'portmidi.h', 'libportmidi', ['portmidi']),
Dependency('PORTTIME', 'porttime.h', '', []),
find_freetype()
Expand Down
6 changes: 2 additions & 4 deletions buildconfig/config_emsdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

# user build, make sure ports are pulled in.
if os.environ.get("SDK_VERSION", None) is None:
EMCC_CFLAGS += " -sUSE_SDL=2 -sUSE_LIBPNG -sUSE_LIBJPEG"
EMCC_CFLAGS += " -sUSE_SDL=2"
else:
# make sure CI only pick SDK components.
SDKROOT = os.environ.get("SDKROOT", "/opt/python-wasm-sdk")
Expand Down Expand Up @@ -151,7 +151,7 @@ def configure(self, incdirs, libdirs):
self.found = 1
else:

if self.name in ["FONT", "IMAGE", "MIXER", "PNG", "JPEG", "FREETYPE"]:
if self.name in ["FONT", "IMAGE", "MIXER", "FREETYPE"]:
self.found = 1
print(
self.name
Expand Down Expand Up @@ -216,8 +216,6 @@ def main(auto_config=False):
]
DEPS.extend(
[
Dependency("PNG", "png.h", "libpng", ["png"]),
Dependency("JPEG", "jpeglib.h", "libjpeg", ["jpeg"]),
# Dependency('SCRAP', '', 'libX11', ['X11']),
# Dependency('GFX', 'SDL_gfxPrimitives.h', 'libSDL_gfx.a', ['SDL_gfx']),
]
Expand Down
2 changes: 0 additions & 2 deletions buildconfig/config_unix.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,6 @@ def find_freetype():
#Dependency('GFX', 'SDL_gfxPrimitives.h', 'libSDL2_gfx.so', ['SDL2_gfx']),
]
DEPS.extend([
Dependency('PNG', 'png.h', 'libpng', ['png']),
Dependency('JPEG', 'jpeglib.h', 'libjpeg', ['jpeg']),
Dependency('SCRAP', '', 'libX11', ['X11']),
#Dependency('GFX', 'SDL_gfxPrimitives.h', 'libSDL_gfx.so', ['SDL_gfx']),
])
Expand Down
20 changes: 5 additions & 15 deletions buildconfig/config_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,13 @@ def _add_sdl2_dll_deps(DEPS):
DEPS.add_dll(r'(lib)?opus[-0-9]*\.dll$', 'opus', ['*opus-[0-9]*'])
DEPS.add_dll(r'(lib)?opusfile[-0-9]*\.dll$', 'opusfile', ['*opusfile-[0-9]*'])
# IMAGE
DEPS.add_dll(r'(lib)?jpeg[-0-9]*\.dll$', 'jpeg', ['*jpeg-[0-9]*'])
DEPS.add_dll(r'(png|libpng)[-0-9]*\.dll$', 'png', ['libpng-[1-9].*'], ['z'])
DEPS.add_dll(r'(lib){0,1}tiff[-0-9]*\.dll$', 'tiff', ['tiff-[0-9]*'], ['jpeg', 'z'])
DEPS.add_dll(r'(z|zlib1)\.dll$', 'z', ['zlib-[1-9].*'])
DEPS.add_dll(r'(lib)?webp[-0-9]*\.dll$', 'webp', ['*webp-[0-9]*'])
DEPS.add_dll(r'(lib)?webpdemux[-0-9]*\.dll$', 'webpdemux', ['*webpdemux-[0-9]*'])


def setup():
DEPS = DependencyGroup()
Expand All @@ -376,10 +380,6 @@ def setup():
DEPS.add_placeholder('PORTTIME')
DEPS.add('MIXER', 'SDL2_mixer', ['SDL2_mixer-[1-9].*'], r'(lib){0,1}SDL2_mixer\.dll$',
['SDL'])
DEPS.add('PNG', 'png', ['SDL2_image-[2-9].*', 'libpng-[1-9].*'], r'(png|libpng)[-0-9]*\.dll$', ['z'],
find_header=r'png\.h', find_lib=r'(lib)?png1[-0-9]*\.lib')
DEPS.add('JPEG', 'jpeg', ['SDL2_image-[2-9].*', 'jpeg-9*'], r'(lib){0,1}jpeg-9\.dll$',
find_header=r'jpeglib\.h', find_lib=r'(lib)?jpeg-9\.lib')
DEPS.add('IMAGE', 'SDL2_image', ['SDL2_image-[1-9].*'], r'(lib){0,1}SDL2_image\.dll$',
['SDL', 'jpeg', 'png', 'tiff'], 0)
DEPS.add('FONT', 'SDL2_ttf', ['SDL2_ttf-[2-9].*'], r'(lib){0,1}SDL2_ttf\.dll$', ['SDL', 'z', 'freetype'])
Expand Down Expand Up @@ -421,23 +421,13 @@ def setup_prebuilt_sdl2(prebuilt_dir):
DEPS.add('FREETYPE', 'freetype', ['freetype'], r'freetype[-0-9]*\.dll$',
find_header=r'ft2build\.h', find_lib=r'freetype[-0-9]*\.lib')

png = DEPS.add('PNG', 'png', ['SDL2_image-[2-9].*', 'libpng-[1-9].*'], r'(png|libpng)[-0-9]*\.dll$', ['z'],
find_header=r'png\.h', find_lib=r'(lib)?png1[-0-9]*\.lib')
png.path = imageDep.path
png.inc_dir = [os.path.join(prebuilt_dir, 'include').replace('\\', '/')]
png.found = True
jpeg = DEPS.add('JPEG', 'jpeg', ['SDL2_image-[2-9].*', 'jpeg-9*'], r'(lib){0,1}jpeg-9\.dll$',
find_header=r'jpeglib\.h', find_lib=r'(lib)?jpeg-9\.lib')
jpeg.path = imageDep.path
jpeg.inc_dir = [os.path.join(prebuilt_dir, 'include').replace('\\', '/')]
jpeg.found = True

dllPaths = {
'png': imageDep.path,
'jpeg': imageDep.path,
'tiff': imageDep.path,
'z': imageDep.path,
'webp': imageDep.path,
'webpdemux': imageDep.path,

'ogg': mixerDep.path,
'modplug': mixerDep.path,
Expand Down
8 changes: 4 additions & 4 deletions buildconfig/download_win_prebuilt.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ def get_urls(x86=True, x64=True):
'7469e9ea44d30a48b0510328cd94b25596e0aa0f',
],
[
'https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.5-VC.zip',
'137f86474691f4e12e76e07d58d5920c8d844d5b',
'https://github.com/pygame-community/SDL_image/releases/download/2.8.0-pgce/SDL2_image-devel-2.8.0-VCpgce.zip',
'da6b6a18f1c53baa775394e769059404925e98d7'
],
[
'https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.20.2/SDL2_ttf-devel-2.20.2-VC.zip',
Expand Down Expand Up @@ -201,12 +201,12 @@ def copy(src, dst):
copy(
os.path.join(
temp_dir,
'SDL2_image-devel-2.0.5-VC/SDL2_image-2.0.5'
'SDL2_image-devel-2.8.0-VCpgce/SDL2_image-2.8.0'
),
os.path.join(
move_to_dir,
prebuilt_dir,
'SDL2_image-2.0.5'
'SDL2_image-2.8.0'
)
)
copy(
Expand Down
Loading

0 comments on commit fd129e9

Please sign in to comment.