From unknown Tue Aug 19 14:23:51 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#61776] [PATCH] gnu: perl-extutils-pkgconfig: Support cross-compilation. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 25 Feb 2023 01:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61776 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61776@debbugs.gnu.org Cc: Josselin Poiret , Tobias Geerinckx-Rice , Maxim Cournoyer , Simon Tournier , Mathieu Othacehe , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Christopher Baines , Ricardo Wurmus X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167728799410388 (code B ref -1); Sat, 25 Feb 2023 01:20:01 +0000 Received: (at submit) by debbugs.gnu.org; 25 Feb 2023 01:19:54 +0000 Received: from localhost ([127.0.0.1]:38642 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVjEA-0002hU-0N for submit@debbugs.gnu.org; Fri, 24 Feb 2023 20:19:54 -0500 Received: from lists.gnu.org ([209.51.188.17]:60190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVjE7-0002hM-UB for submit@debbugs.gnu.org; Fri, 24 Feb 2023 20:19:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVjE7-0000gs-Gm for guix-patches@gnu.org; Fri, 24 Feb 2023 20:19:51 -0500 Received: from mail-qt1-x82a.google.com ([2607:f8b0:4864:20::82a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVjE5-00032z-5b; Fri, 24 Feb 2023 20:19:50 -0500 Received: by mail-qt1-x82a.google.com with SMTP id ay9so1325850qtb.9; Fri, 24 Feb 2023 17:19:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=yaMz1S7I3rqjlxiMwP/i9VRdL9fl/5KgAhE3ZHni+8A=; b=kiWsxs1319R4Ls05PsBai8ZP743dicJsqGj/Qu/1lL47h1rHIdETCDCt+OJlblAAu/ +/8bH2uD+YHiyL9TURoDlFjpJyNGYqaLf00BTzpRAr6yb4XtXQ9gi3DPA0LPBnD+PIbc K4aqtynpIOuOuuXnkqH42NcLVeTj51TIXHDoHcXEqkYcbeK5V+ftjRZoE5kVbTDu9Lk8 Xy8bgfHjQCPhelRllosAfg8/8ZpYvPa+TogZhcJ/aY5t6SAdP6vNnbybDSuhWzVY+sND BUhADRVCWXID5lhneLOxCrJdrUYGnES4dtTAAXcmyPG0m8AbsmjjuwYluKtdg5Z4jNFp AiQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yaMz1S7I3rqjlxiMwP/i9VRdL9fl/5KgAhE3ZHni+8A=; b=GUHrFrnRifZlEWLc6GKN8qC9T8G0Ab+6bjfU3dLIOpbej4T70IcJSO61Ww0RC8/t3Y oEHZYq3KHq7XSJ7Q5HcbHmMVqAfrvYKSQqCJhvfR6cZWvhke6eUc9rEeB83HIwhJhWXD jbv8zxSRGlZD0hzzHCxFYWBRfUHBsd8g2JPlq1WIKxdL+YqqyVeXcESrf/Rh8/DhgUpL tNp1Is+XqtnsbOBEADNYrOgxNBXZ1ujsd8fnfbtUWkyAxXB3lELQOMBIR+oBiEBGu3ed 32P4lMKtQ72Nf1FA5rqo+UB/1SP5d1zkom7Kdb5F7oYyQLSRHyrlPHFgbwny+oAQe1S3 P6LA== X-Gm-Message-State: AO0yUKW621eDlbAE/N69AINQ3AAYDYN4/J7ork6Z6qEfTJkPoLkjqElf YHIkNNPmfHt2OxdIih9+3u4q2iYIK163u9/F X-Google-Smtp-Source: AK7set8C9jygrwE6iTCb5qQW1vwDzG3F4eYllEev/qVZqNrdEc1CuKdegZVP/JiwoHb9GHqak6gXYg== X-Received: by 2002:a05:622a:390:b0:3af:b6bd:aba7 with SMTP id j16-20020a05622a039000b003afb6bdaba7mr19120409qtx.43.1677287986095; Fri, 24 Feb 2023 17:19:46 -0800 (PST) Received: from localhost.localdomain (dsl-141-27.b2b2c.ca. [66.158.141.27]) by smtp.gmail.com with ESMTPSA id f16-20020ac86ed0000000b003bfa66b7484sm540830qtv.35.2023.02.24.17.19.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Feb 2023 17:19:45 -0800 (PST) From: Maxim Cournoyer Date: Fri, 24 Feb 2023 20:19:33 -0500 Message-Id: <20230225011934.27451-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::82a; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qt1-x82a.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) * guix/search-paths.scm ($PKG_CONFIG_PATH): New variable. * gnu/packages/pkg-config.scm (%pkg-config): Use it. * gnu/packages/perl.scm (perl-extutils-pkgconfig-for-target): New procedure. (perl-extutils-pkgconfig): Turn into a syntax that conditionally expands to... (cross-perl-extutils-pkgconfig): ... this when %current-target-system is set, or... (%perl-extutils-pkgconfig): ... this in a native compilation context. [arguments]: New field. [propagated-inputs]: Turn into... [native-inputs]: ... this. [native-search-paths]: New field. --- gnu/packages/perl.scm | 63 ++++++++++++++++++++++++++++++++++--- gnu/packages/pkg-config.scm | 5 ++- guix/search-paths.scm | 8 +++++ 3 files changed, 68 insertions(+), 8 deletions(-) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 7b97e7adfa..69a897d827 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -28,7 +28,7 @@ ;;; Copyright © 2020 Paul Garlick ;;; Copyright © 2020 Nicolas Goaziou ;;; Copyright © 2020 Malte Frank Gerdes -;;; Copyright © 2021 Maxim Cournoyer +;;; Copyright © 2021, 2023 Maxim Cournoyer ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021 Raghav Gururajan ;;; Copyright © 2021 Maxime Devos @@ -63,6 +63,8 @@ (define-module (gnu packages perl) #:use-module (guix utils) #:use-module (guix build-system gnu) #:use-module (guix build-system perl) + #:use-module (guix memoization) + #:use-module (guix search-paths) #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages compression) @@ -90,7 +92,8 @@ (define-module (gnu packages perl) #:use-module (gnu packages video) #:use-module (gnu packages web) #:use-module (gnu packages xml) - #:use-module (gnu packages xorg)) + #:use-module (gnu packages xorg) + #:export (perl-extutils-pkgconfig)) ;;; ;;; Please: Try to add new module packages in alphabetic order. @@ -4618,7 +4621,10 @@ (define-public perl-extutils-parsexs handle Perl/XS typemap files, and their submodules.") (license (package-license perl)))) -(define-public perl-extutils-pkgconfig +;; This is the "primitive" perl-extutils-pkgconfig package. People should use +;; `perl-extutils-pkgconfig' instead (see below)', but we export +;; %perl-extutils-pkgconfig so that `fold-packages' finds it. +(define-public %perl-extutils-pkgconfig (package (name "perl-extutils-pkgconfig") (version "1.16") @@ -4630,8 +4636,32 @@ (define-public perl-extutils-pkgconfig (base32 "0vhwh0731rhh1sswmvagq0myn754dnkab8sizh6d3n6pjpcwxsmv")))) (build-system perl-build-system) - (propagated-inputs - (list pkg-config)) + ;; XXX: Patch the pkg-config references to avoid propagating it, as that + ;; would cause the search path to be wrong when cross-building, due to + ;; propagated inputs being treated as host inputs, not native inputs. + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-pkg-config-path + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (let* ((target #$(%current-target-system)) + (pkg-config-name (if target + (string-append target "-pkg-config") + "pkg-config")) + (pkg-config (search-input-file + (or native-inputs inputs) + (string-append "bin/" pkg-config-name)))) + (substitute* '("Makefile.PL" + "lib/ExtUtils/PkgConfig.pm") + (("qx/pkg-config([^/]*)/" _ args) + (string-append "`" pkg-config args "`")) + (("(`|\")pkg-config" _ quote) + (string-append quote pkg-config))))))))) + (native-inputs (list pkg-config)) + ;; Note: do not use the pkg-config syntax here, as the search paths fields + ;; are not thunked and its value could be wrong. + (native-search-paths (list $PKG_CONFIG_PATH)) (home-page "https://metacpan.org/release/ExtUtils-PkgConfig") (synopsis "Simplistic interface to pkg-config") (description @@ -4641,6 +4671,29 @@ (define-public perl-extutils-pkgconfig It is really just boilerplate code that you would have written yourself.") (license license:lgpl2.1+))) +(define-public cross-perl-extutils-pkgconfig + (mlambda (target) + "Return a perl-extutils-pkgconfig for TARGET, adjusting the search paths." + (package + (inherit %perl-extutils-pkgconfig) + ;; Ignore native inputs, and set `PKG_CONFIG_PATH' for target inputs. + (native-search-paths '()) + (search-paths (list $PKG_CONFIG_PATH))))) + +(define (perl-extutils-pkgconfig-for-target target) + "Return a perl-extutils-pkgconfig package for TARGET, which may be either #f +for a native build, or a GNU triplet." + (if target + (cross-perl-extutils-pkgconfig target) + %perl-extutils-pkgconfig)) + +;; This hack mimics the one for pkg-config, to allow automatically choosing +;; the native or the cross `pkg-config' depending on whether it's being used +;; in a cross-build environment or not. +(define-syntax perl-extutils-pkgconfig + (identifier-syntax (perl-extutils-pkgconfig-for-target + (%current-target-system)))) + (define-public perl-extutils-typemaps-default (package (name "perl-extutils-typemaps-default") diff --git a/gnu/packages/pkg-config.scm b/gnu/packages/pkg-config.scm index 6263e90f1f..b15b646416 100644 --- a/gnu/packages/pkg-config.scm +++ b/gnu/packages/pkg-config.scm @@ -24,6 +24,7 @@ (define-module (gnu packages pkg-config) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix gexp) + #:use-module (guix search-paths) #:use-module (guix build-system gnu) #:use-module (guix build-system trivial) #:use-module (gnu packages bash) @@ -66,9 +67,7 @@ (define-public %pkg-config "ac_cv_func_posix_getgrgid_r=yes") '())))) (native-search-paths - (list (search-path-specification - (variable "PKG_CONFIG_PATH") - (files '("lib/pkgconfig" "lib64/pkgconfig" "share/pkgconfig"))))) + (list $PKG_CONFIG_PATH)) (home-page "https://www.freedesktop.org/wiki/Software/pkg-config") (license gpl2+) (synopsis "Helper tool used when compiling applications and libraries") diff --git a/guix/search-paths.scm b/guix/search-paths.scm index 4a8f5131ed..fcbe7b7953 100644 --- a/guix/search-paths.scm +++ b/guix/search-paths.scm @@ -34,6 +34,7 @@ (define-module (guix search-paths) $PATH $GUIX_EXTENSIONS_PATH + $PKG_CONFIG_PATH $SSL_CERT_DIR $SSL_CERT_FILE @@ -83,6 +84,13 @@ (define $GUIX_EXTENSIONS_PATH (variable "GUIX_EXTENSIONS_PATH") (files '("share/guix/extensions")))) +(define $PKG_CONFIG_PATH + ;; 'PKG_CONFIG_PATH' is used by pkg-config to locate available header files + ;; and libraries, via their .pc files. + (search-path-specification + (variable "PKG_CONFIG_PATH") + (files '("lib/pkgconfig" "lib64/pkgconfig" "share/pkgconfig")))) + ;; Two variables for certificates (info "(guix)X.509 Certificates"), ;; respected by OpenSSL and possibly GnuTLS in the future ;; (https://gitlab.com/gnutls/gnutls/-/merge_requests/1541) base-commit: b12ee1ee5b8b53bf27b79ce81b1b2158cc7de484 -- 2.39.1 From unknown Tue Aug 19 14:23:51 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#61776] [PATCH] gnu: perl-extutils-pkgconfig: Support cross-compilation. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 02 Mar 2023 09:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61776 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: 61776@debbugs.gnu.org Received: via spool by 61776-submit@debbugs.gnu.org id=B61776.167775100732307 (code B ref 61776); Thu, 02 Mar 2023 09:57:02 +0000 Received: (at 61776) by debbugs.gnu.org; 2 Mar 2023 09:56:47 +0000 Received: from localhost ([127.0.0.1]:55828 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pXfg7-0008P1-27 for submit@debbugs.gnu.org; Thu, 02 Mar 2023 04:56:47 -0500 Received: from mira.cbaines.net ([212.71.252.8]:42338) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pXfg5-0008Ot-Jx for 61776@debbugs.gnu.org; Thu, 02 Mar 2023 04:56:45 -0500 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:54d1:d5d4:280e:f699]) by mira.cbaines.net (Postfix) with ESMTPSA id D1E9116C22; Thu, 2 Mar 2023 09:56:44 +0000 (GMT) Received: from felis (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id df6367a7; Thu, 2 Mar 2023 09:56:44 +0000 (UTC) References: <20230225011934.27451-1-maxim.cournoyer@gmail.com> User-agent: mu4e 1.8.13; emacs 28.2 From: Christopher Baines Date: Thu, 02 Mar 2023 09:51:58 +0000 In-reply-to: <20230225011934.27451-1-maxim.cournoyer@gmail.com> Message-ID: <87fsanv5ly.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Maxim Cournoyer writes: > * guix/search-paths.scm ($PKG_CONFIG_PATH): New variable. > * gnu/packages/pkg-config.scm (%pkg-config): Use it. > * gnu/packages/perl.scm (perl-extutils-pkgconfig-for-target): New procedure. > (perl-extutils-pkgconfig): Turn into a syntax that > conditionally expands to... > (cross-perl-extutils-pkgconfig): ... this when %current-target-system is set, > or... > (%perl-extutils-pkgconfig): ... this in a native compilation context. > [arguments]: New field. > [propagated-inputs]: Turn into... > [native-inputs]: ... this. > [native-search-paths]: New field. > --- > > gnu/packages/perl.scm | 63 ++++++++++++++++++++++++++++++++++--- > gnu/packages/pkg-config.scm | 5 ++- > guix/search-paths.scm | 8 +++++ > 3 files changed, 68 insertions(+), 8 deletions(-) I guess I've been sent this email personally because of "teams", it's quite confusing, I can't determine the bug number from the email, but I believe it's #61776. I'm going to reply to that bug. Anyway, according to QA this might break perl-gtk2. Unfortunately the comparison is a bit confused due to the openmpi related breakage, so do ignore that in the comparison. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmQActlfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XfGzg//QbCSrXh7uGJogfl3UH35+rwdvjY0HqHA P2cut94xpVRCIHdq+NiM+0bWPSpAIeHVeJio/SysWX07PEWbUtNiNVyvvRE290EQ lROCCpZSbr70qffVfHppD14c9/7QNNfNGxu4g+uSBOLwfjr5+RNe46hydLCPHoE5 zuuz3HHKdy220iycTlyM4rA68pcuEElOgMitTpDn4hJ0iFC4sco4hv12e+QFL7TO pw8wdSaBwaSqI8HyB20xDysXuP5ai30fI9AU3Fq4Digq3FKqU9RIM33W+2aG7iha oRW4NPc9bBp6EhTmwfcAlNCSdfGBUoWv3Y9aXcvQ5nI9aLfRucdVV4xCZpSqF31d ewoTywn/Ponyxw3tHe1W6pqPe9BKWhgKycYIBeyzOFy2duQMUKU2lPgKWYJpapc5 8fU2tXxk385s8bC3R/5NuM3dzbtsUz/S6rC/nQzvjB1A4wEanE8qFQSWWyk+3xid n5mj/7hIpl63VlR2u8GUWB4y7UCgzukXzN6/RQ0wACt/TmbR4Hy7ckviy1fjLpu6 cddh3S2oiFpFSrp+BgfrwMZNdfY0snjBDb+oenWqN6IVVY8ut4EIIBbAJZC5vKG+ 3bbuTsNgD9yhajwnV5rbLH2zdCRpxll2+TH4x6zkqDCGqqraaO514rEzfx7COYtW Zzp9o79up+0= =k+zo -----END PGP SIGNATURE----- --=-=-=-- From unknown Tue Aug 19 14:23:51 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#61776] [PATCH] gnu: perl-extutils-pkgconfig: Support cross-compilation. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 02 Mar 2023 18:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61776 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Christopher Baines Cc: 61776@debbugs.gnu.org Received: via spool by 61776-submit@debbugs.gnu.org id=B61776.16777816623389 (code B ref 61776); Thu, 02 Mar 2023 18:28:02 +0000 Received: (at 61776) by debbugs.gnu.org; 2 Mar 2023 18:27:42 +0000 Received: from localhost ([127.0.0.1]:58358 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pXneX-0000sb-L4 for submit@debbugs.gnu.org; Thu, 02 Mar 2023 13:27:41 -0500 Received: from mail-qt1-f178.google.com ([209.85.160.178]:33335) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pXneU-0000sO-U9 for 61776@debbugs.gnu.org; Thu, 02 Mar 2023 13:27:40 -0500 Received: by mail-qt1-f178.google.com with SMTP id z6so309669qtv.0 for <61776@debbugs.gnu.org>; Thu, 02 Mar 2023 10:27:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=h+IyRLxNo7P+mXEuw0tmUe5if8vWKtMsgtAosyvpmU0=; b=inGiZWRGVnv62uwtb9yFEDZXfHL9g/oIfvzibyVyEyY83pWTo/rF9fjMO2OOxV5kon TWLJRtXYR2m0H+3JhAxHNPkRQbjnJKP1hlalK05VfPyBOz2urGmjMBNNBdh/Iqor9bdw LI9e7DQMWMOdHsKg5MH2SGYU7uVnbHtXBOi1tWpfwPGoVq2Mw9tg8cAB6OIE9qnBnfWE 9hme4ghvC2jAaD0EedvvXBZ531pX2jVDzVVe/VNiboVQnsQ4XzufclQBre79T3DMoz9j dWDj91hJjk7EZkrRCA2RrHIlchKlkPR/tmGrdivplmZ6uNJY3TAO7Ao3gwcgl8YLatwj C+xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=h+IyRLxNo7P+mXEuw0tmUe5if8vWKtMsgtAosyvpmU0=; b=hdTiH7/tlxaT1FtiqTf4fcAdMjQaUKGkKOktK53e7fTFSQseADU3tog0Hmn1nQWYyu rKo/OkhqJ1DzjYsekh5NqepOC+yBO156FUhjYJIQgNqLfBX7XIUaNxT/eZPxDqem8Qru mLpJIMU2sXi+52mP8qf/SwxwlcYjL1B/59Cq3zL/KkYRfWHku18i3rSC1AMsrUOxSw4v 96bxZufYMRoVo6CKPU7woKYynWP2HrxdI9JFZZn79Cxyz0wCZc+LyEyDof35dq8mjAoP 6RoMwK93PYDkji9/TM7FSpFdhzSwcsqq+KVEedqZmZ6NBbxeaA83/DoZWeALEKn7ybks mQoQ== X-Gm-Message-State: AO0yUKXFjezLWJsszA0sk4R6r96lIMhT7KH/CxDm4nquqe+Mv/u+ecVX 5OTLs/UFDFkR+HeLooBzkhGxHtm15me5Og== X-Google-Smtp-Source: AK7set/91KbxmfTejixICRBhLhezn16ZsKKoZvRdEy0RtaH1aKQH9VIMQQYGxDAhZ5hGQW31Xnm4bA== X-Received: by 2002:ac8:5fd0:0:b0:3b9:17d7:66f4 with SMTP id k16-20020ac85fd0000000b003b917d766f4mr17272596qta.11.1677781653017; Thu, 02 Mar 2023 10:27:33 -0800 (PST) Received: from hurd (dsl-10-128-15.b2b2c.ca. [72.10.128.15]) by smtp.gmail.com with ESMTPSA id s12-20020a05622a018c00b003b323387c1asm212932qtw.18.2023.03.02.10.27.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Mar 2023 10:27:32 -0800 (PST) From: Maxim Cournoyer References: <20230225011934.27451-1-maxim.cournoyer@gmail.com> <87fsanv5ly.fsf@cbaines.net> Date: Thu, 02 Mar 2023 13:27:31 -0500 In-Reply-To: <87fsanv5ly.fsf@cbaines.net> (Christopher Baines's message of "Thu, 02 Mar 2023 09:51:58 +0000") Message-ID: <87lekff1po.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Christopher, Christopher Baines writes: > Maxim Cournoyer writes: > >> * guix/search-paths.scm ($PKG_CONFIG_PATH): New variable. >> * gnu/packages/pkg-config.scm (%pkg-config): Use it. >> * gnu/packages/perl.scm (perl-extutils-pkgconfig-for-target): New procedure. >> (perl-extutils-pkgconfig): Turn into a syntax that >> conditionally expands to... >> (cross-perl-extutils-pkgconfig): ... this when %current-target-system is set, >> or... >> (%perl-extutils-pkgconfig): ... this in a native compilation context. >> [arguments]: New field. >> [propagated-inputs]: Turn into... >> [native-inputs]: ... this. >> [native-search-paths]: New field. >> --- >> >> gnu/packages/perl.scm | 63 ++++++++++++++++++++++++++++++++++--- >> gnu/packages/pkg-config.scm | 5 ++- >> guix/search-paths.scm | 8 +++++ >> 3 files changed, 68 insertions(+), 8 deletions(-) > > I guess I've been sent this email personally because of "teams", it's > quite confusing, I can't determine the bug number from the email, but I > believe it's #61776. I'm going to reply to that bug. Indeed! Patman uses '--cc=email' instead of '--add-header=X:-Debbugs-Cc: email', which explains why recipients do not see the actual bug #. I'll see if I can modify the behavior of the tool. > Anyway, according to QA this might break perl-gtk2. Unfortunately the > comparison is a bit confused due to the openmpi related breakage, so do > ignore that in the comparison. I'll look into it and report back, thanks! -- Thanks, Maxim From unknown Tue Aug 19 14:23:51 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Maxim Cournoyer Subject: bug#61776: closed (Re: [PATCH] gnu: perl-extutils-pkgconfig: Support cross-compilation.) Message-ID: References: <87wn3txnj7.fsf@gmail.com> <20230225011934.27451-1-maxim.cournoyer@gmail.com> X-Gnu-PR-Message: they-closed 61776 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 61776@debbugs.gnu.org Date: Tue, 07 Mar 2023 03:13:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1678158782-5266-1" This is a multi-part message in MIME format... ------------=_1678158782-5266-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #61776: [PATCH] gnu: perl-extutils-pkgconfig: Support cross-compilation. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 61776@debbugs.gnu.org. --=20 61776: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D61776 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1678158782-5266-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 61776-done) by debbugs.gnu.org; 7 Mar 2023 03:12:39 +0000 Received: from localhost ([127.0.0.1]:44141 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZNkk-0001MJ-PL for submit@debbugs.gnu.org; Mon, 06 Mar 2023 22:12:39 -0500 Received: from mail-qt1-f180.google.com ([209.85.160.180]:42683) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZNki-0001M5-Iv for 61776-done@debbugs.gnu.org; Mon, 06 Mar 2023 22:12:37 -0500 Received: by mail-qt1-f180.google.com with SMTP id r16so11460295qtx.9 for <61776-done@debbugs.gnu.org>; Mon, 06 Mar 2023 19:12:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678158750; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=crBxSepV1gNTXD85BHgBy2c20PT7/nFiuI7/5Hu/2RI=; b=duP8WcRXxPVVq+1Kxofw9A7J+i0eJdaYLwezr/OLmZpU1MOl5ZqeUUasH1ydmMGv0U VQcQrVz/OCDC6IR4aCQeiC8S7VJS25hhS9YQHvV7IPMvav/BKm8znRNqJqLgvgmj4o6u qnteYmtPGMuTEcH/pYOh3A5nsmdWrIl+cUx6q2OhaZkJmnMBN9DI+MziYOxdBBybK6Ir IxfR1THhe9/s11cP4gYTmUnYCiFB4PTGgsNT/x5qAC5UE/34pR8Xdl+Vcc/9NJbkxY3d J0j1XOaWV7UOdMUxI6aSZfMctD600sbBi6zk1QseoRoF/wDQotUB6jo66JTF7jM/0LPS gbig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678158750; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=crBxSepV1gNTXD85BHgBy2c20PT7/nFiuI7/5Hu/2RI=; b=72F9Gc0zBQN7mGcTcFPJf7hrwSiMMywtaSqabwwIvPsNZHRW77fDsYQ+ZPFV7VSLTl THkiuh/vn10pLVxOTpCM+N2C9wN7rHHuMBuWwHgJWzLZkVq/rC/i8jUX0kpACRyyY5x1 O9C4jlNKNioDT0f3IQY6SExh6my6RirNpKXnZqjEiOKu4UBrqbUlXCsr9JHY+7eBeC2E oTml5kvDcDlSYkXoUZgKFnDy3geNtb1fw/i8sIfW9ogctHfHBn4MjDOLoXpdJaWvZOVn m0htZ6J6luQzC0Q97qJ3Q1Judhw4LGC+yOBiNLhHZipebdldZC9pJi5XB1GVuSbjsmdp 2rVw== X-Gm-Message-State: AO0yUKUSEbijizwAAiXY5hwnV2wiV4QuT6/KQyS2MlE9mYa3cT8JpO8+ c4LI0yxAUvG0Ko/0rWWWKhXizPHNXPp4Kw== X-Google-Smtp-Source: AK7set8BSbvVhtij41ZDUMEDpCR3m7s9JS1nrhJRA3V/JD2DRdExSWc1w1ufeC5n7iBRD8RMpSkcoQ== X-Received: by 2002:ac8:5a11:0:b0:3bf:cc25:ebfc with SMTP id n17-20020ac85a11000000b003bfcc25ebfcmr21812385qta.0.1678158750511; Mon, 06 Mar 2023 19:12:30 -0800 (PST) Received: from hurd ([2607:fad8:4:3::1000]) by smtp.gmail.com with ESMTPSA id c22-20020a379a16000000b0074233b15a72sm8652121qke.116.2023.03.06.19.12.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Mar 2023 19:12:30 -0800 (PST) From: Maxim Cournoyer To: Christopher Baines Subject: Re: [PATCH] gnu: perl-extutils-pkgconfig: Support cross-compilation. References: <20230225011934.27451-1-maxim.cournoyer@gmail.com> <87fsanv5ly.fsf@cbaines.net> Date: Mon, 06 Mar 2023 22:12:28 -0500 In-Reply-To: <87fsanv5ly.fsf@cbaines.net> (Christopher Baines's message of "Thu, 02 Mar 2023 09:51:58 +0000") Message-ID: <87wn3txnj7.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61776-done Cc: 61776-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Christopher Baines writes: > Maxim Cournoyer writes: > >> * guix/search-paths.scm ($PKG_CONFIG_PATH): New variable. >> * gnu/packages/pkg-config.scm (%pkg-config): Use it. >> * gnu/packages/perl.scm (perl-extutils-pkgconfig-for-target): New procedure. >> (perl-extutils-pkgconfig): Turn into a syntax that >> conditionally expands to... >> (cross-perl-extutils-pkgconfig): ... this when %current-target-system is set, >> or... >> (%perl-extutils-pkgconfig): ... this in a native compilation context. >> [arguments]: New field. >> [propagated-inputs]: Turn into... >> [native-inputs]: ... this. >> [native-search-paths]: New field. >> --- >> >> gnu/packages/perl.scm | 63 ++++++++++++++++++++++++++++++++++--- >> gnu/packages/pkg-config.scm | 5 ++- >> guix/search-paths.scm | 8 +++++ >> 3 files changed, 68 insertions(+), 8 deletions(-) > > I guess I've been sent this email personally because of "teams", it's > quite confusing, I can't determine the bug number from the email, but I > believe it's #61776. I'm going to reply to that bug. > > Anyway, according to QA this might break perl-gtk2. Unfortunately the > comparison is a bit confused due to the openmpi related breakage, so do > ignore that in the comparison. I fixed perl-gtk2; it also required pkg-config, which perl-extutils-pkgconfig no longer propagates, and pushed. Thanks for the heads-up and the useful data! -- Maxim ------------=_1678158782-5266-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 25 Feb 2023 01:19:54 +0000 Received: from localhost ([127.0.0.1]:38642 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVjEA-0002hU-0N for submit@debbugs.gnu.org; Fri, 24 Feb 2023 20:19:54 -0500 Received: from lists.gnu.org ([209.51.188.17]:60190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVjE7-0002hM-UB for submit@debbugs.gnu.org; Fri, 24 Feb 2023 20:19:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVjE7-0000gs-Gm for guix-patches@gnu.org; Fri, 24 Feb 2023 20:19:51 -0500 Received: from mail-qt1-x82a.google.com ([2607:f8b0:4864:20::82a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVjE5-00032z-5b; Fri, 24 Feb 2023 20:19:50 -0500 Received: by mail-qt1-x82a.google.com with SMTP id ay9so1325850qtb.9; Fri, 24 Feb 2023 17:19:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=yaMz1S7I3rqjlxiMwP/i9VRdL9fl/5KgAhE3ZHni+8A=; b=kiWsxs1319R4Ls05PsBai8ZP743dicJsqGj/Qu/1lL47h1rHIdETCDCt+OJlblAAu/ +/8bH2uD+YHiyL9TURoDlFjpJyNGYqaLf00BTzpRAr6yb4XtXQ9gi3DPA0LPBnD+PIbc K4aqtynpIOuOuuXnkqH42NcLVeTj51TIXHDoHcXEqkYcbeK5V+ftjRZoE5kVbTDu9Lk8 Xy8bgfHjQCPhelRllosAfg8/8ZpYvPa+TogZhcJ/aY5t6SAdP6vNnbybDSuhWzVY+sND BUhADRVCWXID5lhneLOxCrJdrUYGnES4dtTAAXcmyPG0m8AbsmjjuwYluKtdg5Z4jNFp AiQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yaMz1S7I3rqjlxiMwP/i9VRdL9fl/5KgAhE3ZHni+8A=; b=GUHrFrnRifZlEWLc6GKN8qC9T8G0Ab+6bjfU3dLIOpbej4T70IcJSO61Ww0RC8/t3Y oEHZYq3KHq7XSJ7Q5HcbHmMVqAfrvYKSQqCJhvfR6cZWvhke6eUc9rEeB83HIwhJhWXD jbv8zxSRGlZD0hzzHCxFYWBRfUHBsd8g2JPlq1WIKxdL+YqqyVeXcESrf/Rh8/DhgUpL tNp1Is+XqtnsbOBEADNYrOgxNBXZ1ujsd8fnfbtUWkyAxXB3lELQOMBIR+oBiEBGu3ed 32P4lMKtQ72Nf1FA5rqo+UB/1SP5d1zkom7Kdb5F7oYyQLSRHyrlPHFgbwny+oAQe1S3 P6LA== X-Gm-Message-State: AO0yUKW621eDlbAE/N69AINQ3AAYDYN4/J7ork6Z6qEfTJkPoLkjqElf YHIkNNPmfHt2OxdIih9+3u4q2iYIK163u9/F X-Google-Smtp-Source: AK7set8C9jygrwE6iTCb5qQW1vwDzG3F4eYllEev/qVZqNrdEc1CuKdegZVP/JiwoHb9GHqak6gXYg== X-Received: by 2002:a05:622a:390:b0:3af:b6bd:aba7 with SMTP id j16-20020a05622a039000b003afb6bdaba7mr19120409qtx.43.1677287986095; Fri, 24 Feb 2023 17:19:46 -0800 (PST) Received: from localhost.localdomain (dsl-141-27.b2b2c.ca. [66.158.141.27]) by smtp.gmail.com with ESMTPSA id f16-20020ac86ed0000000b003bfa66b7484sm540830qtv.35.2023.02.24.17.19.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Feb 2023 17:19:45 -0800 (PST) From: Maxim Cournoyer To: guix-patches@gnu.org Subject: [PATCH] gnu: perl-extutils-pkgconfig: Support cross-compilation. Date: Fri, 24 Feb 2023 20:19:33 -0500 Message-Id: <20230225011934.27451-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::82a; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qt1-x82a.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Josselin Poiret , Tobias Geerinckx-Rice , Maxim Cournoyer , Simon Tournier , Mathieu Othacehe , =?UTF-8?q?Ludovic=20Court=C3=A8s?= , Christopher Baines , Ricardo Wurmus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) * guix/search-paths.scm ($PKG_CONFIG_PATH): New variable. * gnu/packages/pkg-config.scm (%pkg-config): Use it. * gnu/packages/perl.scm (perl-extutils-pkgconfig-for-target): New procedure. (perl-extutils-pkgconfig): Turn into a syntax that conditionally expands to... (cross-perl-extutils-pkgconfig): ... this when %current-target-system is set, or... (%perl-extutils-pkgconfig): ... this in a native compilation context. [arguments]: New field. [propagated-inputs]: Turn into... [native-inputs]: ... this. [native-search-paths]: New field. --- gnu/packages/perl.scm | 63 ++++++++++++++++++++++++++++++++++--- gnu/packages/pkg-config.scm | 5 ++- guix/search-paths.scm | 8 +++++ 3 files changed, 68 insertions(+), 8 deletions(-) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 7b97e7adfa..69a897d827 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -28,7 +28,7 @@ ;;; Copyright © 2020 Paul Garlick ;;; Copyright © 2020 Nicolas Goaziou ;;; Copyright © 2020 Malte Frank Gerdes -;;; Copyright © 2021 Maxim Cournoyer +;;; Copyright © 2021, 2023 Maxim Cournoyer ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021 Raghav Gururajan ;;; Copyright © 2021 Maxime Devos @@ -63,6 +63,8 @@ (define-module (gnu packages perl) #:use-module (guix utils) #:use-module (guix build-system gnu) #:use-module (guix build-system perl) + #:use-module (guix memoization) + #:use-module (guix search-paths) #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages compression) @@ -90,7 +92,8 @@ (define-module (gnu packages perl) #:use-module (gnu packages video) #:use-module (gnu packages web) #:use-module (gnu packages xml) - #:use-module (gnu packages xorg)) + #:use-module (gnu packages xorg) + #:export (perl-extutils-pkgconfig)) ;;; ;;; Please: Try to add new module packages in alphabetic order. @@ -4618,7 +4621,10 @@ (define-public perl-extutils-parsexs handle Perl/XS typemap files, and their submodules.") (license (package-license perl)))) -(define-public perl-extutils-pkgconfig +;; This is the "primitive" perl-extutils-pkgconfig package. People should use +;; `perl-extutils-pkgconfig' instead (see below)', but we export +;; %perl-extutils-pkgconfig so that `fold-packages' finds it. +(define-public %perl-extutils-pkgconfig (package (name "perl-extutils-pkgconfig") (version "1.16") @@ -4630,8 +4636,32 @@ (define-public perl-extutils-pkgconfig (base32 "0vhwh0731rhh1sswmvagq0myn754dnkab8sizh6d3n6pjpcwxsmv")))) (build-system perl-build-system) - (propagated-inputs - (list pkg-config)) + ;; XXX: Patch the pkg-config references to avoid propagating it, as that + ;; would cause the search path to be wrong when cross-building, due to + ;; propagated inputs being treated as host inputs, not native inputs. + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-pkg-config-path + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (let* ((target #$(%current-target-system)) + (pkg-config-name (if target + (string-append target "-pkg-config") + "pkg-config")) + (pkg-config (search-input-file + (or native-inputs inputs) + (string-append "bin/" pkg-config-name)))) + (substitute* '("Makefile.PL" + "lib/ExtUtils/PkgConfig.pm") + (("qx/pkg-config([^/]*)/" _ args) + (string-append "`" pkg-config args "`")) + (("(`|\")pkg-config" _ quote) + (string-append quote pkg-config))))))))) + (native-inputs (list pkg-config)) + ;; Note: do not use the pkg-config syntax here, as the search paths fields + ;; are not thunked and its value could be wrong. + (native-search-paths (list $PKG_CONFIG_PATH)) (home-page "https://metacpan.org/release/ExtUtils-PkgConfig") (synopsis "Simplistic interface to pkg-config") (description @@ -4641,6 +4671,29 @@ (define-public perl-extutils-pkgconfig It is really just boilerplate code that you would have written yourself.") (license license:lgpl2.1+))) +(define-public cross-perl-extutils-pkgconfig + (mlambda (target) + "Return a perl-extutils-pkgconfig for TARGET, adjusting the search paths." + (package + (inherit %perl-extutils-pkgconfig) + ;; Ignore native inputs, and set `PKG_CONFIG_PATH' for target inputs. + (native-search-paths '()) + (search-paths (list $PKG_CONFIG_PATH))))) + +(define (perl-extutils-pkgconfig-for-target target) + "Return a perl-extutils-pkgconfig package for TARGET, which may be either #f +for a native build, or a GNU triplet." + (if target + (cross-perl-extutils-pkgconfig target) + %perl-extutils-pkgconfig)) + +;; This hack mimics the one for pkg-config, to allow automatically choosing +;; the native or the cross `pkg-config' depending on whether it's being used +;; in a cross-build environment or not. +(define-syntax perl-extutils-pkgconfig + (identifier-syntax (perl-extutils-pkgconfig-for-target + (%current-target-system)))) + (define-public perl-extutils-typemaps-default (package (name "perl-extutils-typemaps-default") diff --git a/gnu/packages/pkg-config.scm b/gnu/packages/pkg-config.scm index 6263e90f1f..b15b646416 100644 --- a/gnu/packages/pkg-config.scm +++ b/gnu/packages/pkg-config.scm @@ -24,6 +24,7 @@ (define-module (gnu packages pkg-config) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix gexp) + #:use-module (guix search-paths) #:use-module (guix build-system gnu) #:use-module (guix build-system trivial) #:use-module (gnu packages bash) @@ -66,9 +67,7 @@ (define-public %pkg-config "ac_cv_func_posix_getgrgid_r=yes") '())))) (native-search-paths - (list (search-path-specification - (variable "PKG_CONFIG_PATH") - (files '("lib/pkgconfig" "lib64/pkgconfig" "share/pkgconfig"))))) + (list $PKG_CONFIG_PATH)) (home-page "https://www.freedesktop.org/wiki/Software/pkg-config") (license gpl2+) (synopsis "Helper tool used when compiling applications and libraries") diff --git a/guix/search-paths.scm b/guix/search-paths.scm index 4a8f5131ed..fcbe7b7953 100644 --- a/guix/search-paths.scm +++ b/guix/search-paths.scm @@ -34,6 +34,7 @@ (define-module (guix search-paths) $PATH $GUIX_EXTENSIONS_PATH + $PKG_CONFIG_PATH $SSL_CERT_DIR $SSL_CERT_FILE @@ -83,6 +84,13 @@ (define $GUIX_EXTENSIONS_PATH (variable "GUIX_EXTENSIONS_PATH") (files '("share/guix/extensions")))) +(define $PKG_CONFIG_PATH + ;; 'PKG_CONFIG_PATH' is used by pkg-config to locate available header files + ;; and libraries, via their .pc files. + (search-path-specification + (variable "PKG_CONFIG_PATH") + (files '("lib/pkgconfig" "lib64/pkgconfig" "share/pkgconfig")))) + ;; Two variables for certificates (info "(guix)X.509 Certificates"), ;; respected by OpenSSL and possibly GnuTLS in the future ;; (https://gitlab.com/gnutls/gnutls/-/merge_requests/1541) base-commit: b12ee1ee5b8b53bf27b79ce81b1b2158cc7de484 -- 2.39.1 ------------=_1678158782-5266-1--