summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2022-07-06 23:44:03 +0200
committerMarius Bakke <marius@gnu.org>2022-07-16 23:25:18 +0200
commitff5b912c143c4be2e49a93706cecb97cf510c1f2 (patch)
tree421e021a435fb8a8eb71ce7a45ba216e7b16c697
parent22b9a056ea0ebc77bd191e486f0bf3d1263add5b (diff)
gnu: ghostscript: Remove input labels.
* gnu/packages/ghostscript.scm (ghostscript)[native-inputs, inputs]: Remove labels. [arguments]: Use G-expression. (ghostscript/x, ghostscript/cups)[inputs]: Use MODIFY-INPUTS.
-rw-r--r--gnu/packages/ghostscript.scm220
1 files changed, 110 insertions, 110 deletions
diff --git a/gnu/packages/ghostscript.scm b/gnu/packages/ghostscript.scm
index d61f391189f..e11ab0c6ad1 100644
--- a/gnu/packages/ghostscript.scm
+++ b/gnu/packages/ghostscript.scm
@@ -150,116 +150,117 @@ printing, and psresize, for adjusting page sizes.")
150 (name "ghostscript") 150 (name "ghostscript")
151 (version "9.56.1") 151 (version "9.56.1")
152 (source 152 (source
153 (origin 153 (origin
154 (method url-fetch) 154 (method url-fetch)
155 (uri (string-append "https://github.com/ArtifexSoftware/" 155 (uri (string-append "https://github.com/ArtifexSoftware/"
156 "ghostpdl-downloads/releases/download/gs" 156 "ghostpdl-downloads/releases/download/gs"
157 (string-delete #\. version) 157 (string-delete #\. version)
158 "/ghostscript-" version ".tar.xz")) 158 "/ghostscript-" version ".tar.xz"))
159 (sha256 159 (sha256
160 (base32 160 (base32
161 "1r5qash65m6ignki6z72q4rlai9ka99xrxnmqd19n02has00cd6l")) 161 "1r5qash65m6ignki6z72q4rlai9ka99xrxnmqd19n02has00cd6l"))
162 (patches (search-patches "ghostscript-no-header-creationdate.patch" 162 (patches (search-patches "ghostscript-no-header-creationdate.patch"
163 "ghostscript-no-header-id.patch" 163 "ghostscript-no-header-id.patch"
164 "ghostscript-no-header-uuid.patch")) 164 "ghostscript-no-header-uuid.patch"))
165 (modules '((guix build utils))) 165 (modules '((guix build utils)))
166 (snippet 166 (snippet
167 ;; Remove bundled libraries. The bundled OpenJPEG is a patched fork so 167 ;; Remove bundled libraries. The bundled OpenJPEG is a patched fork so
168 ;; we leave it, at least for now. 168 ;; we leave it, at least for now.
169 ;; TODO Try unbundling ijs, which is developed alongside Ghostscript. 169 ;; TODO Try unbundling ijs, which is developed alongside Ghostscript.
170 ;; Likewise for the thread-safe lcms2 fork called "lcms2art". 170 ;; Likewise for the thread-safe lcms2 fork called "lcms2art".
171 '(begin 171 '(begin
172 (for-each delete-file-recursively '("freetype" "jbig2dec" "jpeg" 172 (for-each delete-file-recursively '("freetype" "jbig2dec" "jpeg"
173 "libpng" "tiff" "zlib")))))) 173 "libpng" "tiff" "zlib"))))))
174 (build-system gnu-build-system) 174 (build-system gnu-build-system)
175 (outputs '("out" "doc")) ;19 MiB of HTML/PS doc + examples 175 (outputs '("out" "doc")) ;19 MiB of HTML/PS doc + examples
176 (arguments 176 (arguments
177 `(#:disallowed-references ("doc") 177 (list
178 #:configure-flags 178 #:disallowed-references '("doc")
179 (list (string-append "LDFLAGS=-Wl,-rpath=" 179 #:configure-flags
180 (assoc-ref %outputs "out") "/lib") 180 #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
181 "--with-system-libtiff" 181 "--with-system-libtiff"
182 "LIBS=-lz" 182 "LIBS=-lz"
183 (string-append "ZLIBDIR=" 183 (string-append "ZLIBDIR="
184 (assoc-ref %build-inputs "zlib") "/include") 184 (dirname (search-input-file %build-inputs
185 "--enable-dynamic" 185 "include/zlib.h")))
186 "--disable-compile-inits" 186 "--enable-dynamic"
187 (string-append "--with-fontpath=" 187 "--disable-compile-inits"
188 (assoc-ref %build-inputs "font-ghostscript") 188 (string-append "--with-fontpath="
189 "/share/fonts/type1/ghostscript") 189 (search-input-directory
190 ,@(if (%current-target-system) 190 %build-inputs
191 '(;; Specify the native compiler, which is used to build 'echogs' 191 "share/fonts/type1/ghostscript"))
192 ;; and other intermediary tools when cross-compiling; see
193 ;; <https://ghostscript.com/FAQ.html>.
194 "CCAUX=gcc"
195 192
196 ;; Save 'config.log' etc. of the native build under 193 #$@(if (%current-target-system)
197 ;; auxtmp/, useful for debugging. 194 '(;; Specify the native compiler, which is used to build 'echogs'
198 "--enable-save_confaux") 195 ;; and other intermediary tools when cross-compiling; see
199 '())) 196 ;; <https://ghostscript.com/FAQ.html>.
200 #:phases 197 "CCAUX=gcc"
201 (modify-phases %standard-phases
202 (add-before 'configure 'create-output-directory
203 (lambda* (#:key outputs #:allow-other-keys)
204 ;; The configure script refuses to function if the directory
205 ;; specified as -rpath does not already exist.
206 (mkdir-p (string-append (assoc-ref outputs "out") "/lib"))))
207 (add-after 'configure 'remove-doc-reference
208 (lambda _
209 ;; Don't retain a reference to the 'doc' output in 'gs'.
210 ;; The only use of this definition is in the output of
211 ;; 'gs --help', so this change is fine.
212 (substitute* "base/gscdef.c"
213 (("GS_DOCDIR")
214 "\"~/.guix-profile/share/doc/ghostscript\""))))
215 (add-after 'configure 'patch-config-files
216 (lambda _
217 (substitute* "base/unixhead.mak"
218 (("/bin/sh") (which "sh")))))
219 ,@(if (%current-target-system)
220 `((add-after 'configure 'add-native-lz
221 (lambda _
222 ;; Add missing '-lz' for native tools such as 'mkromfs'.
223 (substitute* "Makefile"
224 (("^AUXEXTRALIBS=(.*)$" _ value)
225 (string-append "AUXEXTRALIBS = -lz " value "\n"))))))
226 '())
227 (replace 'build
228 (lambda _
229 ;; Build 'libgs.so', but don't build the statically-linked 'gs'
230 ;; binary (saves 22 MiB).
231 (invoke "make" "so" "-j"
232 (number->string (parallel-job-count)))))
233 (replace 'install
234 (lambda _
235 (invoke "make" "soinstall")))
236 (add-after 'install 'create-gs-symlink
237 (lambda* (#:key outputs #:allow-other-keys)
238 (let ((out (assoc-ref outputs "out")))
239 ;; Some programs depend on having a 'gs' binary available.
240 (symlink "gsc" (string-append out "/bin/gs"))))))))
241 (native-inputs
242 `(("perl" ,perl)
243 ("pkg-config" ,pkg-config) ;needed for freetype
244 ("python" ,python-minimal-wrapper)
245 ("tcl" ,tcl)
246 198
247 ;; When cross-compiling, some of the natively-built tools require all 199 ;; Save 'config.log' etc. of the native build under
248 ;; these libraries. 200 ;; auxtmp/, useful for debugging.
249 ,@(if (%current-target-system) 201 "--enable-save_confaux")
250 `(("zlib/native" ,zlib) 202 '()))
251 ("libjpeg/native" ,libjpeg-turbo)) 203 #:phases
252 '()))) 204 #~(modify-phases %standard-phases
205 (add-before 'configure 'create-output-directory
206 (lambda _
207 ;; The configure script refuses to function if the directory
208 ;; specified as -rpath does not already exist.
209 (mkdir-p (string-append #$output "/lib"))))
210 (add-after 'configure 'remove-doc-reference
211 (lambda _
212 ;; Don't retain a reference to the 'doc' output in 'gs'.
213 ;; The only use of this definition is in the output of
214 ;; 'gs --help', so this change is fine.
215 (substitute* "base/gscdef.c"
216 (("GS_DOCDIR")
217 "\"~/.guix-profile/share/doc/ghostscript\""))))
218 (add-after 'configure 'patch-config-files
219 (lambda _
220 (substitute* "base/unixhead.mak"
221 (("/bin/sh") (which "sh")))))
222 #$@(if (%current-target-system)
223 '((add-after 'configure 'add-native-lz
224 (lambda _
225 ;; Add missing '-lz' for native tools such as 'mkromfs'.
226 (substitute* "Makefile"
227 (("^AUXEXTRALIBS=(.*)$" _ value)
228 (string-append "AUXEXTRALIBS = -lz " value "\n"))))))
229 '())
230 (replace 'build
231 (lambda _
232 ;; Build 'libgs.so', but don't build the statically-linked 'gs'
233 ;; binary (saves 22 MiB).
234 (invoke "make" "so" "-j"
235 (number->string (parallel-job-count)))))
236 (replace 'install
237 (lambda _
238 (invoke "make" "soinstall")))
239 (add-after 'install 'create-gs-symlink
240 (lambda _
241 ;; Some programs depend on having a 'gs' binary available.
242 (symlink "gsc" (string-append #$output "/bin/gs")))))))
243 (native-inputs
244 (append
245 (list perl
246 pkg-config ;needed for freetype
247 python-minimal-wrapper
248 tcl)
249 ;; When cross-compiling, some of the natively-built tools require all
250 ;; these libraries.
251 (if (%current-target-system)
252 (list zlib libjpeg-turbo)
253 '())))
253 (inputs 254 (inputs
254 `(("fontconfig" ,fontconfig) 255 (list fontconfig
255 ("freetype" ,freetype) 256 freetype
256 ("font-ghostscript" ,font-ghostscript) 257 font-ghostscript
257 ("jbig2dec" ,jbig2dec) 258 jbig2dec
258 ("libjpeg" ,libjpeg-turbo) 259 libjpeg-turbo
259 ("libpaper" ,libpaper) 260 libpaper
260 ("libpng" ,libpng) 261 libpng
261 ("libtiff" ,libtiff) 262 libtiff
262 ("zlib" ,zlib))) 263 zlib))
263 (synopsis "PostScript and PDF interpreter") 264 (synopsis "PostScript and PDF interpreter")
264 (description 265 (description
265 "Ghostscript is an interpreter for the PostScript language and the PDF 266 "Ghostscript is an interpreter for the PostScript language and the PDF
@@ -272,15 +273,14 @@ output file formats and printers.")
272(define-public ghostscript/x 273(define-public ghostscript/x
273 (package/inherit ghostscript 274 (package/inherit ghostscript
274 (name (string-append (package-name ghostscript) "-with-x")) 275 (name (string-append (package-name ghostscript) "-with-x"))
275 (inputs `(("libxext" ,libxext) 276 (inputs (modify-inputs (package-inputs ghostscript)
276 ("libxt" ,libxt) 277 (prepend libxext libxt)))))
277 ,@(package-inputs ghostscript)))))
278 278
279(define-public ghostscript/cups 279(define-public ghostscript/cups
280 (package/inherit ghostscript 280 (package/inherit ghostscript
281 (name "ghostscript-with-cups") 281 (name "ghostscript-with-cups")
282 (inputs `(("cups" ,cups-minimal) 282 (inputs (modify-inputs (package-inputs ghostscript)
283 ,@(package-inputs ghostscript))))) 283 (prepend cups-minimal)))))
284 284
285(define-public ijs 285(define-public ijs
286 (package 286 (package