Skip to content

Commit 6c9a9e4

Browse files
andriiryzhkovTurboGit
authored andcommitted
Fix macOS DMG startup crash by bundling libSDL3 for sdl2-compat
1 parent 3e55636 commit 6c9a9e4

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

.ci/Brewfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ brew 'portmidi'
5555
brew 'potrace'
5656
brew 'pugixml'
5757
brew 'sdl2'
58+
brew 'sdl3'
5859
brew 'shared-mime-info'
5960
brew 'curl'
6061
brew 'perl'

packaging/macosx/3_make_hb_darktable_package.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,15 @@ for dtSharedObj in $dtSharedObjDirs; do
249249
cp -LR "$homebrewHome"/lib/"$dtSharedObj"/* "$dtResourcesDir"/lib/"$dtSharedObj"/
250250
done
251251

252+
# Homebrew's `sdl2` is sdl2-compat, which dlopen()s libSDL3 at runtime —
253+
# otool can't see that, so install_dependencies misses it; copy explicitly
254+
sdl3Source="$homebrewHome/opt/sdl3/lib/libSDL3.dylib"
255+
if [[ -f "$sdl3Source" ]]; then
256+
cp -L "$sdl3Source" "$dtResourcesDir"/lib/libSDL3.dylib
257+
install_name_tool -id "@executable_path/../Resources/lib/libSDL3.dylib" \
258+
"$dtResourcesDir"/lib/libSDL3.dylib || true
259+
fi
260+
252261
dtSharedObjDirs="libgphoto2 libgphoto2_port"
253262
for dtSharedObj in $dtSharedObjDirs; do
254263
mkdir "$dtResourcesDir"/lib/"$dtSharedObj"

0 commit comments

Comments
 (0)