From patchwork Wed Jul 13 12:08:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jean Pierre De Jesus DIAZ X-Patchwork-Id: 40642 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 371EE27BBEA; Wed, 13 Jul 2022 13:10:17 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9052927BBE9 for ; Wed, 13 Jul 2022 13:10:16 +0100 (BST) Received: from localhost ([::1]:41338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBbC3-0004nS-O1 for patchwork@mira.cbaines.net; Wed, 13 Jul 2022 08:10:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBbBr-0004ec-3U for guix-patches@gnu.org; Wed, 13 Jul 2022 08:10:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50931) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oBbBq-0001dk-Pq for guix-patches@gnu.org; Wed, 13 Jul 2022 08:10:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oBbBq-0007DZ-K6 for guix-patches@gnu.org; Wed, 13 Jul 2022 08:10:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56536] [PATCH]: gnu: newt: Fix cross-compilationn Resent-From: Jean Pierre De Jesus DIAZ Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 13 Jul 2022 12:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56536 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56536@debbugs.gnu.org X-Debbugs-Original-To: "guix-patches@gnu.org" Received: via spool by submit@debbugs.gnu.org id=B.165771414327648 (code B ref -1); Wed, 13 Jul 2022 12:10:02 +0000 Received: (at submit) by debbugs.gnu.org; 13 Jul 2022 12:09:03 +0000 Received: from localhost ([127.0.0.1]:44825 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oBbAs-0007Br-KR for submit@debbugs.gnu.org; Wed, 13 Jul 2022 08:09:02 -0400 Received: from lists.gnu.org ([209.51.188.17]:55286) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oBbAq-0007BP-2l for submit@debbugs.gnu.org; Wed, 13 Jul 2022 08:09:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBbAp-0003dh-UX for guix-patches@gnu.org; Wed, 13 Jul 2022 08:08:59 -0400 Received: from mail-4317.proton.ch ([185.70.43.17]:50746) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBbAm-0001WQ-0n for guix-patches@gnu.org; Wed, 13 Jul 2022 08:08:59 -0400 Date: Wed, 13 Jul 2022 12:08:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jeandudey.tech; s=protonmail3; t=1657714122; x=1657973322; bh=KvigRysennxXTuLvOsQFVbTlJNLX0x4PxP9WZmwC1uA=; h=Date:To:From:Reply-To:Subject:Message-ID:Feedback-ID:From:To:Cc: Date:Subject:Reply-To:Feedback-ID:Message-ID; b=UVfumFL3dhrCOpkmfVL0j1ebypuR/9L2uvW5emjLN1Rf31GWYDc74dKcx9oMLgguf aBpj+oyrFC3dtZgU91Iu7rw/4EzI/ewaqFk9GYxxDEXGw1rX2XGNeSK00lUJRiAwDv BE4b8UPT1C+3lRY9uF6r0lytnkwSfr5jofQ54jA+nyDSPB+bT3B5L0hJ47Hrx/gJBJ cUfzGuh+TEfQZ3RPOGpJ0jPr8XspkeFzPOd0cVBWSII/qWqIkKZkGVtvKzVJQYf6Bd qVKrpOC+FQz/nTQYqk0p9DB5y03Nn1yMiRSlGeF+aVa5fjSQPL1R5yT0Ys00wK7qLg EQu40DKFcuT8w== Message-ID: Feedback-ID: 20187791:user:proton MIME-Version: 1.0 Received-SPF: pass client-ip=185.70.43.17; envelope-from=me@jeandudey.tech; helo=mail-4317.proton.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Jean Pierre De Jesus DIAZ X-ACL-Warn: , Jean Pierre De Jesus DIAZ via Guix-patches X-Patchwork-Original-From: Jean Pierre De Jesus DIAZ via Guix-patches via From: Jean Pierre De Jesus DIAZ X-getmail-retrieved-from-mailbox: Patches Updates the newt package to use G-Expressions and adds support for cross-compilation in the process by adding python3.9-config and python-config to $PATH. To test: ./pre-inst-env guix build newt \ --target=aarch64-linux-gnu — Jean-Pierre De Jesus DIAZ From 47dda376c0583aef2cf5c4ddd2a2223f357e4a98 Mon Sep 17 00:00:00 2001 Message-Id: <47dda376c0583aef2cf5c4ddd2a2223f357e4a98.1657713910.git.me@jeandudey.tech> From: Jean-Pierre De Jesus DIAZ Date: Wed, 13 Jul 2022 14:02:30 +0200 Subject: [PATCH] gnu: newt: Fix cross-compilation. * gnu/packages/slang.scm (newt): Fix-cross compilation. [arguments]: Use G-Expressions for `#:configure-flags', `#:make-flags' and `#:phases', also set correct path for `python-config'. --- gnu/packages/slang.scm | 50 ++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/gnu/packages/slang.scm b/gnu/packages/slang.scm index c8de04667f..ab13c874d2 100644 --- a/gnu/packages/slang.scm +++ b/gnu/packages/slang.scm @@ -24,6 +24,7 @@ (define-module (gnu packages slang) #:use-module (guix download) #:use-module (guix utils) #:use-module (guix build-system gnu) + #:use-module (guix gexp) #:use-module ((guix licenses) #:prefix license:) #:use-module (gnu packages readline) #:use-module (gnu packages ncurses) @@ -103,34 +104,41 @@ (define-public newt (inputs (list slang popt python fribidi)) (arguments - `(#:tests? #f ; no test suite + (list + #:tests? #f ; no test suite #:configure-flags ;; Set the correct RUNPATH in binaries. - (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")) + #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")) #:make-flags ;; configure uses a hard-coded search of /usr/include/python* to set ;; this variable, and does not allow us to override it from the ;; command line. Fortunately, the Makefile does, so provide it here. - (list (string-append "PYTHONVERS=python" - ,(version-major+minor (package-version python)))) + #~(list + (string-append "PYTHONVERS=python" + #$(version-major+minor (package-version python)))) #:phases - (modify-phases %standard-phases - (add-after - 'unpack 'patch-/usr/bin/install - (lambda _ - (substitute* "po/Makefile" - (("/usr/bin/install") "install")) - #t)) - (add-after - 'install 'move-python - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) - (py (assoc-ref outputs "python")) - (ver ,(version-major+minor (package-version python)))) - (mkdir-p (string-append py "/lib")) - (rename-file (string-append out "/lib/python" ver) - (string-append py "/lib/python" ver)) - #t)))))) + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-/usr/bin/install + (lambda _ + (substitute* "po/Makefile" + (("/usr/bin/install") "install")))) + (add-before 'build 'add-python-config-to-path + (lambda* (#:key target #:allow-other-keys) + ;; When cross-compiling python-config is not present in $PATH. + ;; + ;; It is a shell script without dependencies on target binaries + ;; so it can be run on the host to allow cross-compilation. + (when target + (let ((path (getenv "PATH")) + (py (string-append #$python "/bin"))) + (setenv "PATH" (string-append path ":" py)))))) + (add-after 'install 'move-python + (lambda* _ + (let ((ver #$(version-major+minor (package-version python)))) + (mkdir-p (string-append #$output:python "/lib")) + (rename-file + (string-append #$output "/lib/python" ver) + (string-append #$output:python "/lib/python" ver)))))))) (home-page "https://pagure.io/newt") (synopsis "Not Erik's Windowing Toolkit - text mode windowing with slang") (description -- 2.36.1