3
0
Fork 0
forked from mirrors/nixpkgs

ghostscript: fix broken rpath on Darwin

Dynamic library name on Darwin contains only 'maj.min' eg "9.53";
the build however used $version to set rpath;
this broke on 2029ca37 when $version went from "9.52" to "9.53.3".

Add a call to 'gs' in installCheckPhase,
to break the build if dylib issues arise in the future.

Signed-off-by: Sirio Balmelli <sirio@b-ad.ch>
Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
This commit is contained in:
Sirio Balmelli 2020-11-24 10:46:19 +01:00
parent 54745a4f5e
commit a775974c8a
No known key found for this signature in database
GPG key ID: 0437A96EFE4C426E

View file

@ -103,8 +103,20 @@ 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.${version} $out/lib/libgs.dylib.${version} $out/bin/gs
install_name_tool -change libgs.dylib.$dylib_version $out/lib/libgs.dylib.$dylib_version $out/bin/gs
'';
# validate dynamic linkage
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/gs --version
runHook postInstallCheck
'';
meta = {