summaryrefslogtreecommitdiff
path: root/gnu/packages/ghostscript.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-07-11 15:28:51 +0200
committerLudovic Courtès <ludo@gnu.org>2017-07-13 00:28:07 +0200
commit49d035ff96c626df6145064efb0c044d74e39e03 (patch)
tree54a2a1e6513ca89c10ef0417745abf8c3e4fed90 /gnu/packages/ghostscript.scm
parent0a3aca47d9baed5f3cd25c6a6489a625776fd26e (diff)
downloadguix-patches-49d035ff96c626df6145064efb0c044d74e39e03.tar
guix-patches-49d035ff96c626df6145064efb0c044d74e39e03.tar.gz
gnu: ghostscript: Support cross-compilation.
* gnu/packages/ghostscript.scm (ghostscript)[arguments]: Pass "CCAUX" and "--enable-save_confaux" to #:configure-flags. Add 'add-native-lz' phase when cross-compiling. [native-inputs]: Add ZLIB, LIBJPEG, and LCMS when cross-compiling.
Diffstat (limited to 'gnu/packages/ghostscript.scm')
-rw-r--r--gnu/packages/ghostscript.scm34
1 files changed, 31 insertions, 3 deletions
diff --git a/gnu/packages/ghostscript.scm b/gnu/packages/ghostscript.scm
index b15b032a72..d5d5aa2dff 100644
--- a/gnu/packages/ghostscript.scm
+++ b/gnu/packages/ghostscript.scm
@@ -2,7 +2,7 @@
;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2014, 2015, 2016, 2017 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
-;;; Copyright © 2013, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
@@ -165,7 +165,18 @@ printing, and psresize, for adjusting page sizes.")
"LIBS=-lz"
(string-append "ZLIBDIR="
(assoc-ref %build-inputs "zlib") "/include")
- "--enable-dynamic")
+ "--enable-dynamic"
+
+ ,@(if (%current-target-system)
+ '(;; Specify the native compiler, which is used to build 'echogs'
+ ;; and other intermediary tools when cross-compiling; see
+ ;; <https://ghostscript.com/FAQ.html>.
+ "CCAUX=gcc"
+
+ ;; Save 'config.log' etc. of the native build under
+ ;; auxtmp/, useful for debugging.
+ "--enable-save_confaux")
+ '()))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'fix-doc-dir
@@ -189,6 +200,15 @@ printing, and psresize, for adjusting page sizes.")
(substitute* "base/unixhead.mak"
(("/bin/sh") (which "sh")))
#t))
+ ,@(if (%current-target-system)
+ `((add-after 'configure 'add-native-lz
+ (lambda _
+ ;; Add missing '-lz' for native tools such as 'mkromfs'.
+ (substitute* "Makefile"
+ (("^AUXEXTRALIBS=(.*)$" _ value)
+ (string-append "AUXEXTRALIBS = -lz " value "\n")))
+ #t)))
+ '())
(replace 'build
(lambda _
;; Build 'libgs.so', but don't build the statically-linked 'gs'
@@ -207,7 +227,15 @@ printing, and psresize, for adjusting page sizes.")
(native-inputs
`(("perl" ,perl)
("python" ,python-wrapper)
- ("tcl" ,tcl)))
+ ("tcl" ,tcl)
+
+ ;; When cross-compiling, some of the natively-built tools require all
+ ;; these libraries.
+ ,@(if (%current-target-system)
+ `(("zlib/native" ,zlib)
+ ("libjpeg/native" ,libjpeg)
+ ("lcms2/native" ,lcms))
+ '())))
(inputs
`(("freetype" ,freetype)
("jbig2dec" ,jbig2dec)