summaryrefslogtreecommitdiff
path: root/gnu
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
parent0a3aca47d9baed5f3cd25c6a6489a625776fd26e (diff)
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')
-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 b15b032a726..d5d5aa2dffb 100644
--- a/gnu/packages/ghostscript.scm
+++ b/gnu/packages/ghostscript.scm
@@ -2,7 +2,7 @@
2;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> 2;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3;;; Copyright © 2014, 2015, 2016, 2017 Mark H Weaver <mhw@netris.org> 3;;; Copyright © 2014, 2015, 2016, 2017 Mark H Weaver <mhw@netris.org>
4;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net> 4;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
5;;; Copyright © 2013, 2015, 2016 Ludovic Courtès <ludo@gnu.org> 5;;; Copyright © 2013, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
6;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com> 6;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
7;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il> 7;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
8;;; Copyright © 2017 Leo Famulari <leo@famulari.name> 8;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
@@ -165,7 +165,18 @@ printing, and psresize, for adjusting page sizes.")
165 "LIBS=-lz" 165 "LIBS=-lz"
166 (string-append "ZLIBDIR=" 166 (string-append "ZLIBDIR="
167 (assoc-ref %build-inputs "zlib") "/include") 167 (assoc-ref %build-inputs "zlib") "/include")
168 "--enable-dynamic") 168 "--enable-dynamic"
169
170 ,@(if (%current-target-system)
171 '(;; Specify the native compiler, which is used to build 'echogs'
172 ;; and other intermediary tools when cross-compiling; see
173 ;; <https://ghostscript.com/FAQ.html>.
174 "CCAUX=gcc"
175
176 ;; Save 'config.log' etc. of the native build under
177 ;; auxtmp/, useful for debugging.
178 "--enable-save_confaux")
179 '()))
169 #:phases 180 #:phases
170 (modify-phases %standard-phases 181 (modify-phases %standard-phases
171 (add-after 'unpack 'fix-doc-dir 182 (add-after 'unpack 'fix-doc-dir
@@ -189,6 +200,15 @@ printing, and psresize, for adjusting page sizes.")
189 (substitute* "base/unixhead.mak" 200 (substitute* "base/unixhead.mak"
190 (("/bin/sh") (which "sh"))) 201 (("/bin/sh") (which "sh")))
191 #t)) 202 #t))
203 ,@(if (%current-target-system)
204 `((add-after 'configure 'add-native-lz
205 (lambda _
206 ;; Add missing '-lz' for native tools such as 'mkromfs'.
207 (substitute* "Makefile"
208 (("^AUXEXTRALIBS=(.*)$" _ value)
209 (string-append "AUXEXTRALIBS = -lz " value "\n")))
210 #t)))
211 '())
192 (replace 'build 212 (replace 'build
193 (lambda _ 213 (lambda _
194 ;; Build 'libgs.so', but don't build the statically-linked 'gs' 214 ;; Build 'libgs.so', but don't build the statically-linked 'gs'
@@ -207,7 +227,15 @@ printing, and psresize, for adjusting page sizes.")
207 (native-inputs 227 (native-inputs
208 `(("perl" ,perl) 228 `(("perl" ,perl)
209 ("python" ,python-wrapper) 229 ("python" ,python-wrapper)
210 ("tcl" ,tcl))) 230 ("tcl" ,tcl)
231
232 ;; When cross-compiling, some of the natively-built tools require all
233 ;; these libraries.
234 ,@(if (%current-target-system)
235 `(("zlib/native" ,zlib)
236 ("libjpeg/native" ,libjpeg)
237 ("lcms2/native" ,lcms))
238 '())))
211 (inputs 239 (inputs
212 `(("freetype" ,freetype) 240 `(("freetype" ,freetype)
213 ("jbig2dec" ,jbig2dec) 241 ("jbig2dec" ,jbig2dec)