Skip to content

ci: use newest alpine for musl build #207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/musl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions platforms/build-web.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
38 changes: 18 additions & 20 deletions platforms/emscripten/sdl2_image_port.diff
Original file line number Diff line number Diff line change
@@ -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 = {
Expand All @@ -12,46 +12,44 @@ 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"]:
+ error_handler(f'{mt} has to be either 0 or 1')
+ else:
+ opts['mt'] = int(mt)


def show():
return 'sdl2_image (-sUSE_SDL_IMAGE=2 or --use-port=sdl2_image; zlib license)'
2 changes: 1 addition & 1 deletion tools/dependencies/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading