diff --git a/pkgs/misc/ghostscript/default.nix b/pkgs/misc/ghostscript/default.nix index 5a7762640f73..6f113bcd99cb 100644 --- a/pkgs/misc/ghostscript/default.nix +++ b/pkgs/misc/ghostscript/default.nix @@ -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 = {