From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id tE4EI8iHJmFRoAAAgWs5BA (envelope-from ) for ; Wed, 25 Aug 2021 20:11:20 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id UNgEHsiHJmH3eQAAB5/wlQ (envelope-from ) for ; Wed, 25 Aug 2021 18:11:20 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 484492BEC2 for ; Wed, 25 Aug 2021 20:11:20 +0200 (CEST) Received: from localhost ([::1]:38538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIxMt-0007MW-7d for larch@yhetil.org; Wed, 25 Aug 2021 14:11:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIxMd-0006sL-PI for guix-patches@gnu.org; Wed, 25 Aug 2021 14:11:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36293) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mIxMd-0005yI-Hx for guix-patches@gnu.org; Wed, 25 Aug 2021 14:11:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mIxMd-00037h-Dd for guix-patches@gnu.org; Wed, 25 Aug 2021 14:11:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50201] [PATCH 45/52] gnu: Add pkg-config-for-build. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 25 Aug 2021 18:11:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50201 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50201@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 50201-submit@debbugs.gnu.org id=B50201.162991504111947 (code B ref 50201); Wed, 25 Aug 2021 18:11:03 +0000 Received: (at 50201) by debbugs.gnu.org; 25 Aug 2021 18:10:41 +0000 Received: from localhost ([127.0.0.1]:47834 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIxMG-00036X-PG for submit@debbugs.gnu.org; Wed, 25 Aug 2021 14:10:41 -0400 Received: from newton.telenet-ops.be ([195.130.132.45]:38030) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIxME-00035j-Qd for 50201@debbugs.gnu.org; Wed, 25 Aug 2021 14:10:39 -0400 Received: from laurent.telenet-ops.be (laurent.telenet-ops.be [IPv6:2a02:1800:110:4::f00:19]) by newton.telenet-ops.be (Postfix) with ESMTPS id 4Gvv444vJBzMr096 for <50201@debbugs.gnu.org>; Wed, 25 Aug 2021 20:03:48 +0200 (CEST) Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by laurent.telenet-ops.be with bizsmtp id lu3n2500L0mfAB401u3o9k; Wed, 25 Aug 2021 20:03:48 +0200 From: Maxime Devos Date: Wed, 25 Aug 2021 20:03:25 +0200 Message-Id: <20210825180332.5720-45-maximedevos@telenet.be> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210825180332.5720-1-maximedevos@telenet.be> References: <20210825180332.5720-1-maximedevos@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1629914628; bh=+X6gWZHIl7bx9msF6MB/IgoQUd0S8kuaDIrVutH/PaI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=n6ttHKBHKNOKTZdrO6dpx3cyof0lyAWBFMZLdNTh7AHhj1YCYdL2q6wN+NkNq9cyV lgnXueBDvs4chC3OjXdfsdPJ3MudyjEjbTcv4UzHoR7hVv2MnnnwHng3lMtTMpUZbX kpzQsUmrlnPm8t+fEiLG9w3lBwqqc27wy9HGGm5LjAGUEHykBHb/ZtI40IxPriGipn Y6d30V2VOSPLyfme8BUU4TH92in9K9m7b/EykKDhadBY7ax/UXgk0UyxktPPZMOmIW 9qpxkU99As+VSInkGhTfQEYHTjc+Fd2TXrEwolDw50w7lueVAZ1LVhRO5iTqpVpz5x Qcu0bW0P9KM/g== 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1629915080; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=+X6gWZHIl7bx9msF6MB/IgoQUd0S8kuaDIrVutH/PaI=; b=dNXHVhpPStZkkyiSRe5SH1N1pfZl/kzMEmhOkMCb0tZMpfSNHxy2cRWhzyXkcTpXUh+f9y NRNX8IPhzb2/2rsko+B5SYxIxKkWkQHwf8Th+k2+l5LSTDAfmnwHGv1EEOYz+Crv68rZET H3Z9iFhxNu1HhqkpFU+NfByap0mC04yeAx9BeeRUrhsvfHfQr5bViGJU3Ekq382aWLSCjY nkSaVQkTJpb7fKcDZgSrf7jMCIQZNSTo9xB8Qjih9lFbSczrXKXjy7QjlKZfszVYrzSkBn zfPefd+lVS1HXwbocPNm6xzfPc9rdjwkh4G4vzbeEy081fQQYIqJRAUS/TNJCQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1629915080; a=rsa-sha256; cv=none; b=l1mPha59fL/mpoLO7I2B1ol/8JD0qjfWpG90pnD18nsMq+G2CZT/TIkhkzaTYeUNzK1Qxr 4xK5UyHe/+HEUheirv7leVw+pD1EVHT+roXbsQEy8MkPgKNXHJQz9TsmvnZp3jq2ZqDJQh ruDIKO/Cm4tWmX9mKnvfj2ynFJnIEcZQbzCzrM7pLFqENlNc5RVVapbKBTP9tMuiTLiTXW y3CZptMznrS+O9I8CD6ykJqzFnjpjBPvvrBV1Hvvbvz4pwz0brOboF7KpuIvgoOu2DIKHp 3BG3AOLPHebj9q2ieYcAdbZ0/B1gOk/Q3EuQlriD3c5gassO50ZmHla31j11Sw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=n6ttHKBH; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -0.32 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=n6ttHKBH; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 484492BEC2 X-Spam-Score: -0.32 X-Migadu-Scanner: scn0.migadu.com X-TUID: y0BSp3oEWoKX * gnu/packages/pkg-config.scm (pkg-config-for-build): New variable. --- gnu/packages/pkg-config.scm | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/gnu/packages/pkg-config.scm b/gnu/packages/pkg-config.scm index 9c632532be..9d1588338e 100644 --- a/gnu/packages/pkg-config.scm +++ b/gnu/packages/pkg-config.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014, 2016 Ludovic Courtès ;;; Copyright © 2019 Mathieu Othacehe +;;; Copyright © 2021 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,8 +22,10 @@ #:use-module (guix licenses) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix gexp) #:use-module (guix build-system gnu) #:use-module (guix build-system trivial) + #:use-module (gnu packages bash) #:use-module (guix memoization) #:export (pkg-config)) @@ -130,3 +133,36 @@ build, or a GNU triplet." ;; environment or not. (define-syntax pkg-config (identifier-syntax (pkg-config-for-target (%current-target-system)))) + +;; This hack allows for using both "pkg-config" and "TARGET-pkg-config" +;; at the same time. Simply using '%pkg-config' and 'pkg-config' won't +;; work because they both use the "PKG_CONFIG_PATH" environment variable. +(define-public pkg-config-for-build + (package + (inherit (hidden-package pkg-config)) + (name "pkg-config-for-build") + (version "0") + (source #f) + (build-system trivial-build-system) + (inputs + `(("bash-minimal" ,bash-minimal) + ("pkg-config" ,%pkg-config))) + (arguments + `(#:modules ((guix build utils)) + #:builder + ,#~(begin + (use-modules (guix build utils)) + (define where (string-append #$output "/bin/pkg-config")) + (mkdir-p (dirname where)) + (call-with-output-file where + (lambda (port) + (format port "#!~a +export PKG_CONFIG_PATH=\"$PKG_CONFIG_PATH_FOR_BUILD\" +exec ~a \"$@\"" + (search-input-file %build-inputs "bin/bash") + (search-input-file %build-inputs "bin/pkg-config")))) + (chmod where #o500)))) + (native-search-paths + (list (search-path-specification + (variable "PKG_CONFIG_PATH_FOR_BUILD") + (files '("lib/pkgconfig" "lib64/pkgconfig" "share/pkgconfig"))))))) -- 2.33.0