Skip to content
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

ghostscript: fix install names on Darwin #358079

Merged
merged 1 commit into from
Nov 25, 2024
Merged
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
13 changes: 2 additions & 11 deletions pkgs/misc/ghostscript/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ stdenv.mkDerivation rec {
sed "s@^ZLIBDIR=.*@ZLIBDIR=${zlib.dev}/include@" -i configure.ac

autoconf
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
export DARWIN_LDFLAGS_SO_PREFIX=$out/lib/
'';

configureFlags = [
Expand Down Expand Up @@ -140,19 +142,8 @@ stdenv.mkDerivation rec {
done
'';

# dynamic library name only contains maj.min, eg. '9.53'
dylib_version = lib.versions.majorMinor version;
preFixup = lib.optionalString stdenv.isDarwin ''
install_name_tool -change libgs.dylib.$dylib_version $out/lib/libgs.dylib.$dylib_version $out/bin/gs
install_name_tool -change libgs.dylib.$dylib_version $out/lib/libgs.dylib.$dylib_version $out/bin/gsx
'';

# validate dynamic linkage
doInstallCheck = true;
preInstallCheck = if stdenv.hostPlatform.isDarwin then ''
DYLD_LIBRARY_PATH=$out/lib
export DYLD_LIBRARY_PATH
'' else null;
installCheckPhase = ''
runHook preInstallCheck

Expand Down