mupdf: fix bin libmupdf.dylib loading on darwin

This commit is contained in:
Lily Foster 2023-12-07 21:00:30 -05:00
parent 91050ea1e5
commit 11498aed21
No known key found for this signature in database
GPG Key ID: 49340081E484C893

View File

@ -165,10 +165,14 @@ stdenv.mkDerivation rec {
EOF
moveToOutput "bin" "$bin"
'' + lib.optionalString (enableX11 || enableGL) ''
'' + (lib.optionalString (stdenv.isDarwin) ''
for exe in $bin/bin/*; do
install_name_tool -change build/shared-release/libmupdf.dylib $out/lib/libmupdf.dylib "$exe"
done
'') + (lib.optionalString (enableX11 || enableGL) ''
mkdir -p $bin/share/icons/hicolor/48x48/apps
cp docs/logo/mupdf.png $bin/share/icons/hicolor/48x48/apps
'' + (if enableGL then ''
'') + (if enableGL then ''
ln -s "$bin/bin/mupdf-gl" "$bin/bin/mupdf"
'' else lib.optionalString (enableX11) ''
ln -s "$bin/bin/mupdf-x11" "$bin/bin/mupdf"