[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#36477] [PATCH v2 16/61] gnu: groff: Fix cross compilation.
From: |
Mathieu Othacehe |
Subject: |
[bug#36477] [PATCH v2 16/61] gnu: groff: Fix cross compilation. |
Date: |
Wed, 21 Aug 2019 10:54:10 +0200 |
* gnu/packages/groff.scm (groff)[arguments]: Replace build phase to pass
GROFF_BIN_PATH and GROFFBIN variables when cross-compiling.
Also add native groff as a native-input when cross-compiling.
---
gnu/packages/groff.scm | 40 +++++++++++++++++++++++++++++++++++++---
1 file changed, 37 insertions(+), 3 deletions(-)
diff --git a/gnu/packages/groff.scm b/gnu/packages/groff.scm
index 98f17914bf..65b661cd79 100644
--- a/gnu/packages/groff.scm
+++ b/gnu/packages/groff.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2017 Ludovic Courtès <address@hidden>
;;; Copyright © 2019 Efraim Flashner <address@hidden>
;;; Copyright © 2019 Eric Bavier <address@hidden>
+;;; Copyright © 2019 Mathieu Othacehe <address@hidden>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -55,7 +56,13 @@
;; from 'inputs'.
(inputs `(("ghostscript" ,ghostscript)))
- (native-inputs `(("bison" ,bison)
+
+ ;; When cross-compiling, this package depends upon a native install of
+ ;; itself.
+ (native-inputs `(,@(if (%current-target-system)
+ `(("self" ,this-package))
+ '())
+ ("bison" ,bison)
("perl" ,perl)
("psutils" ,psutils)
("texinfo" ,texinfo)))
@@ -94,7 +101,33 @@
(lambda _ ;see https://savannah.gnu.org/bugs/index.php?55461
(substitute* "Makefile.in"
(("^docdir =.*") "docdir = @docdir@\n"))
- #t)))))
+ #t))
+ ,@(if (%current-target-system)
+ '((replace 'build
+ (lambda* (#:key
+ make-flags parallel-build?
+ native-inputs target #:allow-other-keys)
+ ;; When cross-compiling, native groff is needed, see:
+ ;; http://www.mail-archive.com/address@hidden/msg01335.html
+ (let ((parallel
+ (if parallel-build?
+ `("-j" ,(number->string (parallel-job-count)))
+ '()))
+ (flags
+ (if target
+ (let ((groff (or
+ (assoc-ref native-inputs "groff")
+ (assoc-ref native-inputs "self"))))
+ (append
+ make-flags
+ (list
+ (string-append "GROFF_BIN_PATH=" groff)
+ (string-append "GROFFBIN=" groff
+ "/bin/groff"))))
+ make-flags)))
+ (apply invoke `("make" ,@parallel ,@flags)))
+ #t)))
+ '()))))
(synopsis "Typesetting from plain text mixed with formatting commands")
(description
"Groff is a typesetting package that reads plain text and produces
@@ -115,7 +148,8 @@ is usually the formatter of \"man\" documentation pages.")
;; Omit the DVI, PS, PDF, and HTML backends.
(inputs '())
(native-inputs `(("bison" ,bison)
- ("perl" ,perl)))
+ ("perl" ,perl)
+ ("groff" ,groff)))
(arguments
`(#:disallowed-references (,perl)
--
2.17.1
- [bug#36477] [PATCH v2 03/61] gnu: tcl: Fix cross-compilation., (continued)
- [bug#36477] [PATCH v2 03/61] gnu: tcl: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 06/61] gnu: xorg: Fix cross-compilation of multiple packages., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 08/61] gnu: python: Further cross-compilation fixes., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 11/61] gnu: texinfo: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 09/61] gnu: http-parser: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 12/61] gnu: cmake: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 13/61] gnu: libgit2: Fix cross compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 10/61] gnu: openssl: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 14/61] gnu: ath9k-htc-firmware: Fix cross compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 15/61] gnu: libpaper: Fix aarch64 cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 16/61] gnu: groff: Fix cross compilation.,
Mathieu Othacehe <=
- [bug#36477] [PATCH v2 19/61] gnu: indent: Fix aarch64 cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 21/61] gnu: mit-krb5: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 17/61] gnu: texinfo-5: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 22/61] gnu: cyrus-sasl: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 23/61] gnu: help2man: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 20/61] gnu: libsamplerate: Fix aarch64 cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 25/61] gnu: libarchive: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 26/61] gnu: tcsh: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 27/61] gnu: pkg-config: Fix cross-compilation., Mathieu Othacehe, 2019/08/21
- [bug#36477] [PATCH v2 28/61] gnu: mkfontdir: Fix aarch64 cross-compilation., Mathieu Othacehe, 2019/08/21