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