me
/
guix
Archived
1
0
Fork 0

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.
master
Marius Bakke 2022-07-06 23:44:03 +02:00
parent 22b9a056ea
commit ff5b912c14
No known key found for this signature in database
GPG Key ID: A2A06DF2A33A54FA
1 changed files with 110 additions and 110 deletions

View File

@ -150,116 +150,117 @@ printing, and psresize, for adjusting page sizes.")
(name "ghostscript") (name "ghostscript")
(version "9.56.1") (version "9.56.1")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (string-append "https://github.com/ArtifexSoftware/" (uri (string-append "https://github.com/ArtifexSoftware/"
"ghostpdl-downloads/releases/download/gs" "ghostpdl-downloads/releases/download/gs"
(string-delete #\. version) (string-delete #\. version)
"/ghostscript-" version ".tar.xz")) "/ghostscript-" version ".tar.xz"))
(sha256 (sha256
(base32 (base32
"1r5qash65m6ignki6z72q4rlai9ka99xrxnmqd19n02has00cd6l")) "1r5qash65m6ignki6z72q4rlai9ka99xrxnmqd19n02has00cd6l"))
(patches (search-patches "ghostscript-no-header-creationdate.patch" (patches (search-patches "ghostscript-no-header-creationdate.patch"
"ghostscript-no-header-id.patch" "ghostscript-no-header-id.patch"
"ghostscript-no-header-uuid.patch")) "ghostscript-no-header-uuid.patch"))
(modules '((guix build utils))) (modules '((guix build utils)))
(snippet (snippet
;; Remove bundled libraries. The bundled OpenJPEG is a patched fork so ;; Remove bundled libraries. The bundled OpenJPEG is a patched fork so
;; we leave it, at least for now. ;; we leave it, at least for now.
;; TODO Try unbundling ijs, which is developed alongside Ghostscript. ;; TODO Try unbundling ijs, which is developed alongside Ghostscript.
;; Likewise for the thread-safe lcms2 fork called "lcms2art". ;; Likewise for the thread-safe lcms2 fork called "lcms2art".
'(begin '(begin
(for-each delete-file-recursively '("freetype" "jbig2dec" "jpeg" (for-each delete-file-recursively '("freetype" "jbig2dec" "jpeg"
"libpng" "tiff" "zlib")))))) "libpng" "tiff" "zlib"))))))
(build-system gnu-build-system) (build-system gnu-build-system)
(outputs '("out" "doc")) ;19 MiB of HTML/PS doc + examples (outputs '("out" "doc")) ;19 MiB of HTML/PS doc + examples
(arguments (arguments
`(#:disallowed-references ("doc") (list
#:configure-flags #:disallowed-references '("doc")
(list (string-append "LDFLAGS=-Wl,-rpath=" #:configure-flags
(assoc-ref %outputs "out") "/lib") #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")
"--with-system-libtiff" "--with-system-libtiff"
"LIBS=-lz" "LIBS=-lz"
(string-append "ZLIBDIR=" (string-append "ZLIBDIR="
(assoc-ref %build-inputs "zlib") "/include") (dirname (search-input-file %build-inputs
"--enable-dynamic" "include/zlib.h")))
"--disable-compile-inits" "--enable-dynamic"
(string-append "--with-fontpath=" "--disable-compile-inits"
(assoc-ref %build-inputs "font-ghostscript") (string-append "--with-fontpath="
"/share/fonts/type1/ghostscript") (search-input-directory
,@(if (%current-target-system) %build-inputs
'(;; Specify the native compiler, which is used to build 'echogs' "share/fonts/type1/ghostscript"))
;; and other intermediary tools when cross-compiling; see
;; <https://ghostscript.com/FAQ.html>.
"CCAUX=gcc"
;; Save 'config.log' etc. of the native build under #$@(if (%current-target-system)
;; auxtmp/, useful for debugging. '(;; Specify the native compiler, which is used to build 'echogs'
"--enable-save_confaux") ;; and other intermediary tools when cross-compiling; see
'())) ;; <https://ghostscript.com/FAQ.html>.
#:phases "CCAUX=gcc"
(modify-phases %standard-phases
(add-before 'configure 'create-output-directory ;; Save 'config.log' etc. of the native build under
(lambda* (#:key outputs #:allow-other-keys) ;; auxtmp/, useful for debugging.
;; The configure script refuses to function if the directory "--enable-save_confaux")
;; specified as -rpath does not already exist. '()))
(mkdir-p (string-append (assoc-ref outputs "out") "/lib")))) #:phases
(add-after 'configure 'remove-doc-reference #~(modify-phases %standard-phases
(lambda _ (add-before 'configure 'create-output-directory
;; Don't retain a reference to the 'doc' output in 'gs'. (lambda _
;; The only use of this definition is in the output of ;; The configure script refuses to function if the directory
;; 'gs --help', so this change is fine. ;; specified as -rpath does not already exist.
(substitute* "base/gscdef.c" (mkdir-p (string-append #$output "/lib"))))
(("GS_DOCDIR") (add-after 'configure 'remove-doc-reference
"\"~/.guix-profile/share/doc/ghostscript\"")))) (lambda _
(add-after 'configure 'patch-config-files ;; Don't retain a reference to the 'doc' output in 'gs'.
(lambda _ ;; The only use of this definition is in the output of
(substitute* "base/unixhead.mak" ;; 'gs --help', so this change is fine.
(("/bin/sh") (which "sh"))))) (substitute* "base/gscdef.c"
,@(if (%current-target-system) (("GS_DOCDIR")
`((add-after 'configure 'add-native-lz "\"~/.guix-profile/share/doc/ghostscript\""))))
(lambda _ (add-after 'configure 'patch-config-files
;; Add missing '-lz' for native tools such as 'mkromfs'. (lambda _
(substitute* "Makefile" (substitute* "base/unixhead.mak"
(("^AUXEXTRALIBS=(.*)$" _ value) (("/bin/sh") (which "sh")))))
(string-append "AUXEXTRALIBS = -lz " value "\n")))))) #$@(if (%current-target-system)
'()) '((add-after 'configure 'add-native-lz
(replace 'build (lambda _
(lambda _ ;; Add missing '-lz' for native tools such as 'mkromfs'.
;; Build 'libgs.so', but don't build the statically-linked 'gs' (substitute* "Makefile"
;; binary (saves 22 MiB). (("^AUXEXTRALIBS=(.*)$" _ value)
(invoke "make" "so" "-j" (string-append "AUXEXTRALIBS = -lz " value "\n"))))))
(number->string (parallel-job-count))))) '())
(replace 'install (replace 'build
(lambda _ (lambda _
(invoke "make" "soinstall"))) ;; Build 'libgs.so', but don't build the statically-linked 'gs'
(add-after 'install 'create-gs-symlink ;; binary (saves 22 MiB).
(lambda* (#:key outputs #:allow-other-keys) (invoke "make" "so" "-j"
(let ((out (assoc-ref outputs "out"))) (number->string (parallel-job-count)))))
;; Some programs depend on having a 'gs' binary available. (replace 'install
(symlink "gsc" (string-append out "/bin/gs")))))))) (lambda _
(invoke "make" "soinstall")))
(add-after 'install 'create-gs-symlink
(lambda _
;; Some programs depend on having a 'gs' binary available.
(symlink "gsc" (string-append #$output "/bin/gs")))))))
(native-inputs (native-inputs
`(("perl" ,perl) (append
("pkg-config" ,pkg-config) ;needed for freetype (list perl
("python" ,python-minimal-wrapper) pkg-config ;needed for freetype
("tcl" ,tcl) python-minimal-wrapper
tcl)
;; When cross-compiling, some of the natively-built tools require all ;; When cross-compiling, some of the natively-built tools require all
;; these libraries. ;; these libraries.
,@(if (%current-target-system) (if (%current-target-system)
`(("zlib/native" ,zlib) (list zlib libjpeg-turbo)
("libjpeg/native" ,libjpeg-turbo)) '())))
'())))
(inputs (inputs
`(("fontconfig" ,fontconfig) (list fontconfig
("freetype" ,freetype) freetype
("font-ghostscript" ,font-ghostscript) font-ghostscript
("jbig2dec" ,jbig2dec) jbig2dec
("libjpeg" ,libjpeg-turbo) libjpeg-turbo
("libpaper" ,libpaper) libpaper
("libpng" ,libpng) libpng
("libtiff" ,libtiff) libtiff
("zlib" ,zlib))) zlib))
(synopsis "PostScript and PDF interpreter") (synopsis "PostScript and PDF interpreter")
(description (description
"Ghostscript is an interpreter for the PostScript language and the PDF "Ghostscript is an interpreter for the PostScript language and the PDF
@ -272,15 +273,14 @@ output file formats and printers.")
(define-public ghostscript/x (define-public ghostscript/x
(package/inherit ghostscript (package/inherit ghostscript
(name (string-append (package-name ghostscript) "-with-x")) (name (string-append (package-name ghostscript) "-with-x"))
(inputs `(("libxext" ,libxext) (inputs (modify-inputs (package-inputs ghostscript)
("libxt" ,libxt) (prepend libxext libxt)))))
,@(package-inputs ghostscript)))))
(define-public ghostscript/cups (define-public ghostscript/cups
(package/inherit ghostscript (package/inherit ghostscript
(name "ghostscript-with-cups") (name "ghostscript-with-cups")
(inputs `(("cups" ,cups-minimal) (inputs (modify-inputs (package-inputs ghostscript)
,@(package-inputs ghostscript))))) (prepend cups-minimal)))))
(define-public ijs (define-public ijs
(package (package