diff --git a/.github/workflows/musl.yml b/.github/workflows/musl.yml index aa5c9037..927f4785 100644 --- a/.github/workflows/musl.yml +++ b/.github/workflows/musl.yml @@ -10,7 +10,7 @@ jobs: build: name: ${{ matrix.config.name }} runs-on: ubuntu-24.04 - container: alpine:3.20 + container: alpine:3.21 strategy: fail-fast: false @@ -32,9 +32,9 @@ jobs: - name: Install dependencies run: | apk update - apk add wget meson ca-certificates samurai git openssl-dev openssl pkgconf sdl2 sdl2-dev sdl2_mixer-dev sdl2_ttf-dev sdl2_mixer-dev sdl2_image-dev dbus-dev patchelf ${{ ( matrix.config.use-clang == true ) && 'clang18' || 'gcc g++' }} ${{ ( matrix.config.use-clang == true && matrix.config.use-clang_stdlib == true ) && 'libc++ libc++-dev' || '' }} - echo "CC=${{ matrix.config.use-clang == true && 'clang-18' || 'gcc' }}" >> "$GITHUB_ENV" - echo "CXX=${{ matrix.config.use-clang == true && 'clang++-18' || 'g++' }}" >> "$GITHUB_ENV" + apk add wget meson ca-certificates samurai git openssl-dev openssl pkgconf sdl2 sdl2-dev sdl2_mixer-dev sdl2_ttf-dev sdl2_mixer-dev sdl2_image-dev dbus-dev patchelf ${{ ( matrix.config.use-clang == true ) && 'clang19' || 'gcc g++' }} ${{ ( matrix.config.use-clang == true && matrix.config.use-clang_stdlib == true ) && 'libc++ libc++-dev llvm-libunwind llvm-libunwind-dev ' || '' }} + echo "CC=${{ matrix.config.use-clang == true && 'clang-19' || 'gcc' }}" >> "$GITHUB_ENV" + echo "CXX=${{ matrix.config.use-clang == true && 'clang++-19' || 'g++' }}" >> "$GITHUB_ENV" - uses: actions/checkout@v4 with: diff --git a/platforms/build-web.sh b/platforms/build-web.sh index f2d099dc..8da584df 100755 --- a/platforms/build-web.sh +++ b/platforms/build-web.sh @@ -25,6 +25,7 @@ if ! [ -e "$EMSCRIPTEN_PACTH_FILE" ]; then ##TODO: upstream those patches # see: https://github.com/emscripten-core/emscripten/pull/18379/commits # and: https://github.com/emscripten-core/emscripten/pull/18379 + # and: https://github.com/emscripten-core/emscripten/pull/22946 git apply --unsafe-paths -p1 --directory="$EMSCRIPTEN_UPSTREAM_ROOT" "$PATCH_DIR/sdl2_image_port.diff" git apply --unsafe-paths -p1 --directory="$EMSCRIPTEN_UPSTREAM_ROOT" "$PATCH_DIR/sdl2_mixer_port.diff" diff --git a/platforms/emscripten/sdl2_image_port.diff b/platforms/emscripten/sdl2_image_port.diff index 402868e7..c0c67612 100644 --- a/platforms/emscripten/sdl2_image_port.diff +++ b/platforms/emscripten/sdl2_image_port.diff @@ -1,8 +1,8 @@ diff --git a/tools/ports/sdl2_image.py b/tools/ports/sdl2_image.py -index c72ef576..0c12feba 100644 +index 70fa1499..36be807b 100644 --- a/tools/ports/sdl2_image.py +++ b/tools/ports/sdl2_image.py -@@ -16,15 +16,17 @@ variants = { +@@ -18,7 +18,8 @@ variants = { } OPTIONS = { @@ -12,40 +12,38 @@ index c72ef576..0c12feba 100644 } SUPPORTED_FORMATS = {'avif', 'bmp', 'gif', 'jpg', 'jxl', 'lbm', 'pcx', 'png', - 'pnm', 'qoi', 'svg', 'tga', 'tif', 'webp', 'xcf', 'xpm', 'xv'} +@@ -26,7 +27,8 @@ SUPPORTED_FORMATS = {'avif', 'bmp', 'gif', 'jpg', 'jxl', 'lbm', 'pcx', 'png', # user options (from --use-port) --opts: Dict[str, Set] = { + opts: Dict[str, Set] = { - 'formats': set() -+opts = { + 'formats': set(), + 'mt': 0 } -@@ -42,7 +44,7 @@ def get_lib_name(settings): +@@ -44,7 +46,7 @@ def get_lib_name(settings): libname = 'libSDL2_image' if formats != '': - libname += '_' + formats -- return libname + '.a' -+ return libname + ('-mt' if opts['mt'] else '') + '.a' - - - def get(ports, settings, shared): -@@ -70,6 +72,8 @@ def get(ports, settings, shared): + libname += '-' + formats +- if settings.PTHREADS: ++ if settings.PTHREADS or opts['mt']: + libname += '-mt' + return libname + '.a' +@@ -75,7 +77,7 @@ def get(ports, settings, shared): if 'jpg' in formats: - defs += ['-sUSE_LIBJPEG'] -+ if opts['mt']: -+ defs += ['-pthread'] + flags += ['-sUSE_LIBJPEG'] - ports.build_port(src_dir, final, 'sdl2_image', flags=defs, srcs=srcs) +- if settings.PTHREADS: ++ if settings.PTHREADS or opts['mt']: + flags += ['-pthread'] -@@ -99,7 +103,12 @@ def handle_options(options, error_handler): + ports.build_port(src_dir, final, 'sdl2_image', flags=flags, srcs=srcs) +@@ -106,6 +108,12 @@ def handle_options(options, error_handler): error_handler(f'{format} is not a supported format') else: opts['formats'].add(format) -- + + mt = options['mt'] + if mt not in ["1","0"]: @@ -53,5 +51,5 @@ index c72ef576..0c12feba 100644 + else: + opts['mt'] = int(mt) + def show(): - return 'sdl2_image (-sUSE_SDL_IMAGE=2 or --use-port=sdl2_image; zlib license)' diff --git a/tools/dependencies/meson.build b/tools/dependencies/meson.build index f00e47fd..f4689926 100644 --- a/tools/dependencies/meson.build +++ b/tools/dependencies/meson.build @@ -61,7 +61,7 @@ if meson.is_cross_build() ['SDL2_ttf'], ['mpg123'], ['SDL2_mixer_mp3', 'SDL2_mixer'], - ['SDL2_image_png-svg-mt', 'SDL2_image'], + ['SDL2_image-png-svg-mt', 'SDL2_image'], ['icu_common-mt', 'icu-uc'], ] foreach native_dependency_tuple : map_native_dependencies