From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:42039) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4oLK-0001Nr-AB for guix-patches@gnu.org; Mon, 02 Sep 2019 11:34:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i4oLI-0002ea-2l for guix-patches@gnu.org; Mon, 02 Sep 2019 11:34:09 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49907) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i4oLH-0002e1-Vh for guix-patches@gnu.org; Mon, 02 Sep 2019 11:34:08 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i4oLH-0006S6-PV for guix-patches@gnu.org; Mon, 02 Sep 2019 11:34:07 -0400 Subject: [bug#36477] [PATCH v3 06/48] gnu: groff: Fix cross compilation. Resent-Message-ID: From: Mathieu Othacehe Date: Mon, 2 Sep 2019 17:32:51 +0200 Message-Id: <20190902153333.11190-7-m.othacehe@gmail.com> In-Reply-To: <20190902153333.11190-1-m.othacehe@gmail.com> References: <20190902153333.11190-1-m.othacehe@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 36477@debbugs.gnu.org Cc: Mathieu Othacehe * 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 ;;; Copyright © 2019 Efraim Flashner ;;; Copyright © 2019 Eric Bavier +;;; Copyright © 2019 Mathieu Othacehe ;;; ;;; 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/bug-groff@gnu.org/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.20.1