Skip to content

Commit

Permalink
ghostscript: fix install names on Darwin (#358079)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilazy authored Nov 25, 2024
2 parents e4fde56 + 8b3d3d5 commit df75a12
Showing 1 changed file with 2 additions and 11 deletions.
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

0 comments on commit df75a12

Please sign in to comment.