mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
ghostscript: fix build on darwin
3230e58d06
https://hydra.nixos.org/build/274082857/nixlog/3/tail
This commit is contained in:
parent
b90a808faa
commit
3070d8a681
@ -21,6 +21,7 @@
|
|||||||
, bash
|
, bash
|
||||||
, buildPackages
|
, buildPackages
|
||||||
, openjpeg
|
, openjpeg
|
||||||
|
, fixDarwinDylibNames
|
||||||
, cupsSupport ? config.ghostscript.cups or (!stdenv.hostPlatform.isDarwin)
|
, cupsSupport ? config.ghostscript.cups or (!stdenv.hostPlatform.isDarwin)
|
||||||
, cups
|
, cups
|
||||||
, x11Support ? cupsSupport
|
, x11Support ? cupsSupport
|
||||||
@ -82,7 +83,8 @@ stdenv.mkDerivation rec {
|
|||||||
];
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [ pkg-config autoconf zlib ]
|
nativeBuildInputs = [ pkg-config autoconf zlib ]
|
||||||
++ lib.optional cupsSupport cups;
|
++ lib.optional cupsSupport cups
|
||||||
|
++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
zlib expat openssl
|
zlib expat openssl
|
||||||
@ -136,17 +138,14 @@ stdenv.mkDerivation rec {
|
|||||||
mkdir -p $fonts/share/fonts
|
mkdir -p $fonts/share/fonts
|
||||||
cp -rv ${fonts}/* "$fonts/share/fonts/"
|
cp -rv ${fonts}/* "$fonts/share/fonts/"
|
||||||
ln -s "$fonts/share/fonts" "$out/share/ghostscript/fonts"
|
ln -s "$fonts/share/fonts" "$out/share/ghostscript/fonts"
|
||||||
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
||||||
for file in $out/lib/*.dylib* ; do
|
|
||||||
install_name_tool -id "$file" $file
|
|
||||||
done
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# dynamic library name only contains maj.min, eg. '9.53'
|
# dynamic library name only contains major version number, eg. '10'
|
||||||
dylib_version = lib.versions.majorMinor version;
|
dylib_version = lib.versions.major version;
|
||||||
preFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
preFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||||
install_name_tool -change libgs.dylib.$dylib_version $out/lib/libgs.dylib.$dylib_version $out/bin/gs
|
for file in $out/bin/{gs,gsc,gsx}; do
|
||||||
install_name_tool -change libgs.dylib.$dylib_version $out/lib/libgs.dylib.$dylib_version $out/bin/gsx
|
install_name_tool -change libgs.$dylib_version.dylib $out/lib/libgs.$dylib_version.dylib $file
|
||||||
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# validate dynamic linkage
|
# validate dynamic linkage
|
||||||
|
Loading…
Reference in New Issue
Block a user