From patchwork Mon Sep 2 15:32:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 15243 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id BBA311734D; Mon, 2 Sep 2019 16:36:49 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 3850B17329 for ; Mon, 2 Sep 2019 16:36:49 +0100 (BST) Received: from localhost ([::1]:37628 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4oNs-0003pf-Fh for patchwork@mira.cbaines.net; Mon, 02 Sep 2019 11:36:48 -0400 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 X-Loop: help-debbugs@gnu.org Subject: [bug#36477] [PATCH v3 06/48] gnu: groff: Fix cross compilation. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 02 Sep 2019 15:34:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36477 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 36477@debbugs.gnu.org Received: via spool by 36477-submit@debbugs.gnu.org id=B36477.156743844124663 (code B ref 36477); Mon, 02 Sep 2019 15:34:07 +0000 Received: (at 36477) by debbugs.gnu.org; 2 Sep 2019 15:34:01 +0000 Received: from localhost ([127.0.0.1]:58701 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i4oL6-0006PZ-Kq for submit@debbugs.gnu.org; Mon, 02 Sep 2019 11:34:00 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:34863) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i4oL4-0006O5-BN for 36477@debbugs.gnu.org; Mon, 02 Sep 2019 11:33:54 -0400 Received: by mail-wr1-f68.google.com with SMTP id g7so14485624wrx.2 for <36477@debbugs.gnu.org>; Mon, 02 Sep 2019 08:33:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MLoKM26KiDKSQJBPaWe+0gl5V43a258D4sP2wVkGi5c=; b=E+h2QSkwjPskIoMy9bj8dAvs+Ug0aVLWT/oXnq5DjtUtGw0AfoqT7+MIa31+uUJ+MH Mgqu2bskKIWPioc9o4oBGU5mTqSLsAnDUYdCJUnDmDo+iU7Qi662wZUhl3LeMTEag4Al egww1gqcWX/+LaR17gjSBBNqrCp12HuIrSbVO4f/qXpLXG7iqj5gX9QEDepMujH5fW8F wSF0+uWAtqFwzKkOpYUn/dfbCt0/+OsPjIRhEHOeHp/dQCdYB7YPslCAMxp5K/cBTxpV LDroI8rl5dx7ao6GnVXBncwmXM2mWSP3kLWp2OUfQmfdsKpYQoqy5G4T8XRM1l5UAJ1M k8AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MLoKM26KiDKSQJBPaWe+0gl5V43a258D4sP2wVkGi5c=; b=Wtlmo0850xf0mI/NstGV6tVF6IGDp1BvnTimUw6heWQmmJPzId7IkjqyMcmqlNPUNh t3oG8tvtlBEuSmDATDASEscdG6zCJ/TAatmU78tdCmamsARiG8mYEOCDzzovVc/q65bw i6nXuzO4yRkYgtKSiRAyYzwIREm44qSlHeLppkJXyrFxE1wlcSNS40ixbOrcL0VFPsx4 Jyk9FATfJ0/a4w1KTTgt3mHbqVbEq+0h5y0B4hEffh7CSjjMMxUFOi1xIY2WZ2BPB/At tX7yf/QDoWZboMUV4vEA+vn113AilUmpFIp+iXC3w10cz/DCcPS1wG869v7NHKLX4/2v TAqA== X-Gm-Message-State: APjAAAXiI0z5Z8s/4EVsQ0oG0BmxCCKmLAbi6yROHG9BWYklImz4A8RE LjDgjRtfw0RBl1Y4Q4pHb9uUHqdZ X-Google-Smtp-Source: APXvYqxSQaigKSHLAB6IqS3kLw+eRxhZZvCyN5DDCAc5zNVY6gbgaEkD/m0Fe97GBeVaFmlH2M58mg== X-Received: by 2002:a5d:5387:: with SMTP id d7mr20529868wrv.312.1567438428510; Mon, 02 Sep 2019 08:33:48 -0700 (PDT) Received: from localhost.localdomain ([80.12.63.115]) by smtp.gmail.com with ESMTPSA id b26sm17232265wmj.14.2019.09.02.08.33.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2019 08:33:48 -0700 (PDT) From: Mathieu Othacehe Date: Mon, 2 Sep 2019 17:32:51 +0200 Message-Id: <20190902153333.11190-7-m.othacehe@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190902153333.11190-1-m.othacehe@gmail.com> References: <20190902153333.11190-1-m.othacehe@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mathieu Othacehe Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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)