tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
ghostscript: copy resources, cleanup
Nikolay Amiantov
10 years ago
70efc87a
53e0f8b1
+12
-13
1 changed file
expand all
collapse all
unified
split
pkgs
misc
ghostscript
default.nix
+12
-13
pkgs/misc/ghostscript/default.nix
···
1
-
{ stdenv, fetchurl, fetchpatch, pkgconfig, zlib, expat, openssl, autoconf
2
, libjpeg, libpng, libtiff, freetype, fontconfig, lcms2, libpaper, jbig2dec
3
, libiconv, ijs
4
, x11Support ? false, xlibsWrapper ? null
···
51
libjpeg libpng libtiff freetype fontconfig lcms2 libpaper jbig2dec
52
libiconv ijs
53
]
54
-
++ stdenv.lib.optional x11Support xlibsWrapper
55
-
++ stdenv.lib.optional cupsSupport cups
56
;
57
58
patches = [
···
87
})
88
];
89
90
-
makeFlags = [ "cups_serverroot=$(out)" "cups_serverbin=$(out)/lib/cups" ];
91
-
92
preConfigure = ''
93
# requires in-tree (heavily patched) openjpeg
94
rm -rf jpeg libpng zlib jasper expat tiff lcms{,2} jbig2dec freetype cups/libs ijs
···
97
sed "s@^ZLIBDIR=.*@ZLIBDIR=${zlib}/include@" -i configure.ac
98
99
autoconf
0
0
100
'';
101
102
configureFlags =
103
[ "--with-system-libtiff"
104
"--enable-dynamic"
105
-
(if x11Support then "--with-x" else "--without-x")
106
-
(if cupsSupport then "--enable-cups" else "--disable-cups")
107
-
];
108
109
doCheck = true;
110
-
preCheck = "mkdir ./obj";
111
-
# parallel check sometimes gave: Fatal error: can't create ./obj/whitelst.o
112
113
# don't build/install statically linked bin/gs
114
-
buildFlags = "so";
115
-
installTargets="soinstall";
116
117
postInstall = ''
118
ln -s gsc "$out"/bin/gs
119
0
0
120
mkdir -p "$doc/share/ghostscript/${version}"
121
mv "$out/share/ghostscript/${version}"/{doc,examples} "$doc/share/ghostscript/${version}/"
122
123
ln -s "${fonts}" "$out/share/ghostscript/fonts"
124
'';
125
126
-
preFixup = stdenv.lib.strings.optionalString stdenv.isDarwin ''
127
install_name_tool -change libgs.dylib.${version} $out/lib/libgs.dylib.${version} $out/bin/gs
128
'';
129
···
1
+
{ stdenv, lib, fetchurl, fetchpatch, pkgconfig, zlib, expat, openssl, autoconf
2
, libjpeg, libpng, libtiff, freetype, fontconfig, lcms2, libpaper, jbig2dec
3
, libiconv, ijs
4
, x11Support ? false, xlibsWrapper ? null
···
51
libjpeg libpng libtiff freetype fontconfig lcms2 libpaper jbig2dec
52
libiconv ijs
53
]
54
+
++ lib.optional x11Support xlibsWrapper
55
+
++ lib.optional cupsSupport cups
56
;
57
58
patches = [
···
87
})
88
];
89
0
0
90
preConfigure = ''
91
# requires in-tree (heavily patched) openjpeg
92
rm -rf jpeg libpng zlib jasper expat tiff lcms{,2} jbig2dec freetype cups/libs ijs
···
95
sed "s@^ZLIBDIR=.*@ZLIBDIR=${zlib}/include@" -i configure.ac
96
97
autoconf
98
+
'' + lib.optionalString cupsSupport ''
99
+
configureFlags="$configureFlags --with-cups-serverbin=$out/lib/cups --with-cups-serverroot=$out/etc/cups --with-cups-datadir=$out/share/cups"
100
'';
101
102
configureFlags =
103
[ "--with-system-libtiff"
104
"--enable-dynamic"
105
+
] ++ lib.optional x11Support "--with-x"
106
+
++ lib.optional cupsSupport "--enable-cups";
0
107
108
doCheck = true;
0
0
109
110
# don't build/install statically linked bin/gs
111
+
buildFlags = [ "so" ];
112
+
installTargets = [ "soinstall" ];
113
114
postInstall = ''
115
ln -s gsc "$out"/bin/gs
116
117
+
cp -r Resource "$out/share/ghostscript/${version}"
118
+
119
mkdir -p "$doc/share/ghostscript/${version}"
120
mv "$out/share/ghostscript/${version}"/{doc,examples} "$doc/share/ghostscript/${version}/"
121
122
ln -s "${fonts}" "$out/share/ghostscript/fonts"
123
'';
124
125
+
preFixup = lib.optionalString stdenv.isDarwin ''
126
install_name_tool -change libgs.dylib.${version} $out/lib/libgs.dylib.${version} $out/bin/gs
127
'';
128