From patchwork Mon Jul 8 09:58:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 14529 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 ECBDA171D4; Mon, 8 Jul 2019 11:04:43 +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 A17DF171D2 for ; Mon, 8 Jul 2019 11:04:43 +0100 (BST) Received: from localhost ([::1]:40062 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkQVn-0007A9-AS for patchwork@mira.cbaines.net; Mon, 08 Jul 2019 06:04:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54937) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkQRW-0005NB-56 for guix-patches@gnu.org; Mon, 08 Jul 2019 06:00:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hkQRU-0003Ao-Iv for guix-patches@gnu.org; Mon, 08 Jul 2019 06:00:18 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49056) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hkQRU-0003AZ-DB for guix-patches@gnu.org; Mon, 08 Jul 2019 06:00:16 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hkQRU-0004v0-8V for guix-patches@gnu.org; Mon, 08 Jul 2019 06:00:16 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36477] [PATCH 16/31] gnu: groff: Fix cross compilation. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 08 Jul 2019 10:00:16 +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.156257999618634 (code B ref 36477); Mon, 08 Jul 2019 10:00:16 +0000 Received: (at 36477) by debbugs.gnu.org; 8 Jul 2019 09:59:56 +0000 Received: from localhost ([127.0.0.1]:57833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkQRA-0004qN-1s for submit@debbugs.gnu.org; Mon, 08 Jul 2019 05:59:56 -0400 Received: from mail-wm1-f47.google.com ([209.85.128.47]:37233) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkQQy-0004ma-4S for 36477@debbugs.gnu.org; Mon, 08 Jul 2019 05:59:44 -0400 Received: by mail-wm1-f47.google.com with SMTP id f17so15706290wme.2 for <36477@debbugs.gnu.org>; Mon, 08 Jul 2019 02:59:43 -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=cdktz/646Qgig/gTAHwYTMUiUjQY7smlZadvPf2oztc=; b=IM/pLNKlERy3EsBxIP9cJ0WQCzs4pZHrHoaFiJ0RPhCBjZY9zEgBi3C8x8Un4Mo5e8 3YeDJOUJnAl95wgjfOlyPhJqRg39+X12zm9Y+sYe5OWpcQ3DNiXUW33f6tgTTLtlYiTw qMMxrtKVo1vUdP39YnoPN4Qa3RrX3IoewdTBNsNEN6CmbNHBPv9kcPV9oNbGeYZxUHwa b2Q8ovYtZOCTCQVw3dPsvkGqy3Ehgw3iEM7cjCcyrZn+aSPqKdO47oaM6m0Dp+e9l4j+ 7L6/Bhfzf4qY4Ys67lGwMmVqK+alsaL8GibZrPG1SM0ya3/COSaJicRGOtaUY/nF0KmA 3M2A== 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=cdktz/646Qgig/gTAHwYTMUiUjQY7smlZadvPf2oztc=; b=Vte/s/7HfAfqMN2659/7m8juayLqFzKf0C8u1s7mcZMxP8+lSMgVv1flrwstUt/nXM 5EmeRi2Fncuc8b180/yrxznjMzc1zFrDb5PD5I201oZcpn2DJ8ZcfXO5Ra9F2AgyH43V qvx5YT2Yz36RpbdPx1RIi04P2Ps/+AllQFl9IkwzdY47n7wpaBB+3q9yJClqJaaZ6sq5 rN8x5bp3Y01DMwAnFzLXcJjGO+y6NVMAZJprcOss6rbbnY9aBF5xBUpbwuDYkAIUId0U nxE5pLxJxpXPk1FDJbb0HFN7+EBkkZqeW1eK4HxG+ELDrhlVSCZLHZHNFiiD/nh5mgzu KWXg== X-Gm-Message-State: APjAAAX0Li4/x6JusfyNmeneLJkoCv1slOroGIGE2sReTiY5csbwOe6a dc+5fFF8MsRHsFjHxkai4kJfCDKF X-Google-Smtp-Source: APXvYqy+ssPmguv+l5C9YLSrKTHcO4gEp0pXHAqGahPuWsdLKgfuhyCH1uaYea8Tk965iLnc+B+rkA== X-Received: by 2002:a1c:d107:: with SMTP id i7mr17105383wmg.92.1562579978167; Mon, 08 Jul 2019 02:59:38 -0700 (PDT) Received: from fuji.Parrot.Biz (smtp.parrot.biz. [62.23.167.188]) by smtp.gmail.com with ESMTPSA id i66sm3165127wmi.11.2019.07.08.02.59.37 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 08 Jul 2019 02:59:37 -0700 (PDT) From: Mathieu Othacehe Date: Mon, 8 Jul 2019 11:58:58 +0200 Message-Id: <20190708095913.3460-17-m.othacehe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190708095913.3460-1-m.othacehe@gmail.com> References: <20190708095913.3460-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 cf392f5468..27f796eb98 100644 --- a/gnu/packages/groff.scm +++ b/gnu/packages/groff.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2014 Mark H Weaver ;;; Copyright © 2016 Ricardo Wurmus ;;; Copyright © 2017 Ludovic Courtès +;;; Copyright © 2019 Mathieu Othacehe ;;; ;;; This file is part of GNU Guix. ;;; @@ -54,7 +55,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))) @@ -65,7 +72,33 @@ (add-after 'unpack 'setenv (lambda _ (setenv "GS_GENERATE_UUIDS" "0") - #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 @@ -86,7 +119,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)