Skip to content

Commit 26f18e7

Browse files
authored
Merge pull request #207 from OpenBrickProtocolFoundation/update_alpine
ci: use newest alpine for musl build
2 parents 19023cd + 1d78538 commit 26f18e7

File tree

4 files changed

+24
-25
lines changed

4 files changed

+24
-25
lines changed

.github/workflows/musl.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
build:
1111
name: ${{ matrix.config.name }}
1212
runs-on: ubuntu-24.04
13-
container: alpine:3.20
13+
container: alpine:3.21
1414

1515
strategy:
1616
fail-fast: false
@@ -32,9 +32,9 @@ jobs:
3232
- name: Install dependencies
3333
run: |
3434
apk update
35-
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' || '' }}
36-
echo "CC=${{ matrix.config.use-clang == true && 'clang-18' || 'gcc' }}" >> "$GITHUB_ENV"
37-
echo "CXX=${{ matrix.config.use-clang == true && 'clang++-18' || 'g++' }}" >> "$GITHUB_ENV"
35+
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 ' || '' }}
36+
echo "CC=${{ matrix.config.use-clang == true && 'clang-19' || 'gcc' }}" >> "$GITHUB_ENV"
37+
echo "CXX=${{ matrix.config.use-clang == true && 'clang++-19' || 'g++' }}" >> "$GITHUB_ENV"
3838
3939
- uses: actions/checkout@v4
4040
with:

platforms/build-web.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ if ! [ -e "$EMSCRIPTEN_PACTH_FILE" ]; then
2525
##TODO: upstream those patches
2626
# see: https://github.com/emscripten-core/emscripten/pull/18379/commits
2727
# and: https://github.com/emscripten-core/emscripten/pull/18379
28+
# and: https://github.com/emscripten-core/emscripten/pull/22946
2829

2930
git apply --unsafe-paths -p1 --directory="$EMSCRIPTEN_UPSTREAM_ROOT" "$PATCH_DIR/sdl2_image_port.diff"
3031
git apply --unsafe-paths -p1 --directory="$EMSCRIPTEN_UPSTREAM_ROOT" "$PATCH_DIR/sdl2_mixer_port.diff"
Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/tools/ports/sdl2_image.py b/tools/ports/sdl2_image.py
2-
index c72ef576..0c12feba 100644
2+
index 70fa1499..36be807b 100644
33
--- a/tools/ports/sdl2_image.py
44
+++ b/tools/ports/sdl2_image.py
5-
@@ -16,15 +16,17 @@ variants = {
5+
@@ -18,7 +18,8 @@ variants = {
66
}
77

88
OPTIONS = {
@@ -12,46 +12,44 @@ index c72ef576..0c12feba 100644
1212
}
1313

1414
SUPPORTED_FORMATS = {'avif', 'bmp', 'gif', 'jpg', 'jxl', 'lbm', 'pcx', 'png',
15-
'pnm', 'qoi', 'svg', 'tga', 'tif', 'webp', 'xcf', 'xpm', 'xv'}
15+
@@ -26,7 +27,8 @@ SUPPORTED_FORMATS = {'avif', 'bmp', 'gif', 'jpg', 'jxl', 'lbm', 'pcx', 'png',
1616

1717
# user options (from --use-port)
18-
-opts: Dict[str, Set] = {
18+
opts: Dict[str, Set] = {
1919
- 'formats': set()
20-
+opts = {
2120
+ 'formats': set(),
2221
+ 'mt': 0
2322
}
2423

2524

26-
@@ -42,7 +44,7 @@ def get_lib_name(settings):
25+
@@ -44,7 +46,7 @@ def get_lib_name(settings):
2726
libname = 'libSDL2_image'
2827
if formats != '':
29-
libname += '_' + formats
30-
- return libname + '.a'
31-
+ return libname + ('-mt' if opts['mt'] else '') + '.a'
32-
33-
34-
def get(ports, settings, shared):
35-
@@ -70,6 +72,8 @@ def get(ports, settings, shared):
28+
libname += '-' + formats
29+
- if settings.PTHREADS:
30+
+ if settings.PTHREADS or opts['mt']:
31+
libname += '-mt'
32+
return libname + '.a'
3633

34+
@@ -75,7 +77,7 @@ def get(ports, settings, shared):
3735
if 'jpg' in formats:
38-
defs += ['-sUSE_LIBJPEG']
39-
+ if opts['mt']:
40-
+ defs += ['-pthread']
36+
flags += ['-sUSE_LIBJPEG']
4137

42-
ports.build_port(src_dir, final, 'sdl2_image', flags=defs, srcs=srcs)
38+
- if settings.PTHREADS:
39+
+ if settings.PTHREADS or opts['mt']:
40+
flags += ['-pthread']
4341

44-
@@ -99,7 +103,12 @@ def handle_options(options, error_handler):
42+
ports.build_port(src_dir, final, 'sdl2_image', flags=flags, srcs=srcs)
43+
@@ -106,6 +108,12 @@ def handle_options(options, error_handler):
4544
error_handler(f'{format} is not a supported format')
4645
else:
4746
opts['formats'].add(format)
48-
-
4947
+
5048
+ mt = options['mt']
5149
+ if mt not in ["1","0"]:
5250
+ error_handler(f'{mt} has to be either 0 or 1')
5351
+ else:
5452
+ opts['mt'] = int(mt)
5553

54+
5655
def show():
57-
return 'sdl2_image (-sUSE_SDL_IMAGE=2 or --use-port=sdl2_image; zlib license)'

tools/dependencies/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ if meson.is_cross_build()
6161
['SDL2_ttf'],
6262
['mpg123'],
6363
['SDL2_mixer_mp3', 'SDL2_mixer'],
64-
['SDL2_image_png-svg-mt', 'SDL2_image'],
64+
['SDL2_image-png-svg-mt', 'SDL2_image'],
6565
['icu_common-mt', 'icu-uc'],
6666
]
6767
foreach native_dependency_tuple : map_native_dependencies

0 commit comments

Comments
 (0)