[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
45/52: gnu: Add pkg-config-for-build.
From: |
guix-commits |
Subject: |
45/52: gnu: Add pkg-config-for-build. |
Date: |
Mon, 20 Sep 2021 07:19:40 -0400 (EDT) |
mothacehe pushed a commit to branch core-updates-frozen
in repository guix.
commit d169b5a84d53f23f2cf9805481a16b5456ff0e2b
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Wed Aug 25 15:25:18 2021 +0200
gnu: Add pkg-config-for-build.
* gnu/packages/pkg-config.scm (pkg-config-for-build): New variable.
---
gnu/packages/pkg-config.scm | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/gnu/packages/pkg-config.scm b/gnu/packages/pkg-config.scm
index 9c63253..2b4173a 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 <ludo@gnu.org>
;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;;
;;; 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,38 @@ 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
+ (map (lambda (original)
+ (search-path-specification
+ (inherit original)
+ (variable "PKG_CONFIG_FOR_BUILD")))
+ (package-native-search-paths %pkg-config)))))
- 30/52: gnu: json-glib: Find docbook inputs when cross-compiling., (continued)
- 30/52: gnu: json-glib: Find docbook inputs when cross-compiling., guix-commits, 2021/09/20
- 31/52: gnu: json-glib: Don't build gtk documentation when cross-compiling., guix-commits, 2021/09/20
- 36/52: gnu: avahi: Use the cross-compiled bash., guix-commits, 2021/09/20
- 38/52: gnu: at-spi2-core: Find docbook when cross-compiling., guix-commits, 2021/09/20
- 44/52: gnu: libxxf85vm: Add --disable-malloc0-returnsnull when necessary., guix-commits, 2021/09/20
- 41/52: gnu: libxinerama: Add --disable-malloc0-returnsnull when necessary., guix-commits, 2021/09/20
- 43/52: gnu: libxrandr: Add --disable-malloc0-returnsnull when necessary., guix-commits, 2021/09/20
- 39/52: gnu: at-spi2-core: Add missing "bash-minimal" input., guix-commits, 2021/09/20
- 40/52: gnu: xorg: Unify --disable-malloc0-returnsnull code., guix-commits, 2021/09/20
- 42/52: gnu: libxi: Add --disable-malloc0-returnsnull when necessary., guix-commits, 2021/09/20
- 45/52: gnu: Add pkg-config-for-build.,
guix-commits <=
- 48/52: gnu: libproxy: Don't run tests when cross-compiling., guix-commits, 2021/09/20
- 51/52: gnu: pango: Add bash-minimal input when cross-compiling., guix-commits, 2021/09/20
- 33/52: gnu: libthai: Add datrie as native-input when cross-compiling., guix-commits, 2021/09/20
- 37/52: gnu: at-spi2-core: Don't cross-compile documentation., guix-commits, 2021/09/20
- 50/52: gnu: gdk-pixbuf: Add bash-minimal input when cross-compiling., guix-commits, 2021/09/20
- 49/52: gnu: gdk-pixbuf: Find docbook when cross-compiling., guix-commits, 2021/09/20
- 52/52: gnu: at-spi2-atk: Don't compile tests when cross-compiling., guix-commits, 2021/09/20
- 47/52: gnu: wayland: Find docbook-xml when cross-compiling., guix-commits, 2021/09/20
- 46/52: gnu: wayland: Find wayland-scanner when cross-compiling., guix-commits, 2021/09/20