diff options
author | Efraim Flashner <[email protected]> | 2024-11-16 23:35:14 +0200 |
---|---|---|
committer | Hilton Chain <[email protected]> | 2024-12-31 10:56:34 +0800 |
commit | a6d9faf7dcfa210b3ceffb3e6c9aff1e9f789dec (patch) | |
tree | 0f3b3e4e3a62d4b4dbf118f7ce1939c9b8c07e16 /gnu/packages/patches/zig-0.12-build-respect-PKG_CONFIG-env-var.patch | |
parent | 18b7fce25cf72b4c86b17af32c2ca094fa79b126 (diff) |
gnu: zig: Respect the PKG_CONFIG environment variable.
* gnu/packages/patches/zig-0.9-build-respect-PKG_CONFIG-env-var.patch:
New file.
* gnu/packages/patches/zig-0.10-build-respect-PKG_CONFIG-env-var.patch:
New file.
* gnu/packages/patches/zig-0.11-build-respect-PKG_CONFIG-env-var.patch:
New file.
* gnu/packages/patches/zig-0.12-build-respect-PKG_CONFIG-env-var.patch:
New file.
* gnu/packages/patches/zig-0.13-build-respect-PKG_CONFIG-env-var.patch:
New file.
* gnu/local.mk (dist_patch_DATA): Register them.
* gnu/packages/zig.scm (zig-0.9,zig-0.10,zig-0.11,zig-0.12,zig-0.13)[source]:
Add patches.
* guix/build/zig-build-system.scm (configure): set PKG_CONFIG.
Change-Id: I0abf871c6990144fc472191bf1167aa2fc765161
Modified-by: Hilton Chain <[email protected]>
Signed-off-by: Hilton Chain <[email protected]>
Diffstat (limited to 'gnu/packages/patches/zig-0.12-build-respect-PKG_CONFIG-env-var.patch')
-rw-r--r-- | gnu/packages/patches/zig-0.12-build-respect-PKG_CONFIG-env-var.patch | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/gnu/packages/patches/zig-0.12-build-respect-PKG_CONFIG-env-var.patch b/gnu/packages/patches/zig-0.12-build-respect-PKG_CONFIG-env-var.patch new file mode 100644 index 0000000000..e2d6305f50 --- /dev/null +++ b/gnu/packages/patches/zig-0.12-build-respect-PKG_CONFIG-env-var.patch @@ -0,0 +1,48 @@ +From 80c90add63c44f2e06c73c13400d044a81078602 Mon Sep 17 00:00:00 2001 +From: Eric Joldasov <[email protected]> +Date: Wed, 8 May 2024 23:21:34 +0500 +Subject: [PATCH 1/5] zig build: respect `PKG_CONFIG` environment variable + +[Upstream commit: d263f1ec0eb988f0e4ed1859351f5040f590996b] + +`PKG_CONFIG` environment variable is used to override path to +pkg-config executable, for example when it's name is prepended by +target triple for cross-compilation purposes: + +``` +PKG_CONFIG=/usr/bin/aarch64-unknown-linux-gnu-pkgconf zig build +``` + +Signed-off-by: Eric Joldasov <[email protected]> +--- + lib/std/Build/Step/Compile.zig | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig +index 5bf0805e79..58ff3a0df6 100644 +--- a/lib/std/Build/Step/Compile.zig ++++ b/lib/std/Build/Step/Compile.zig +@@ -703,8 +703,9 @@ fn runPkgConfig(self: *Compile, lib_name: []const u8) !PkgConfigResult { + }; + + var code: u8 = undefined; ++ const pkg_config_exe = b.graph.env_map.get("PKG_CONFIG") orelse "pkg-config"; + const stdout = if (b.runAllowFail(&[_][]const u8{ +- "pkg-config", ++ pkg_config_exe, + pkg_name, + "--cflags", + "--libs", +@@ -1824,7 +1825,8 @@ pub fn doAtomicSymLinks( + } + + fn execPkgConfigList(self: *std.Build, out_code: *u8) (PkgConfigError || RunError)![]const PkgConfigPkg { +- const stdout = try self.runAllowFail(&[_][]const u8{ "pkg-config", "--list-all" }, out_code, .Ignore); ++ const pkg_config_exe = self.graph.env_map.get("PKG_CONFIG") orelse "pkg-config"; ++ const stdout = try self.runAllowFail(&[_][]const u8{ pkg_config_exe, "--list-all" }, out_code, .Ignore); + var list = ArrayList(PkgConfigPkg).init(self.allocator); + errdefer list.deinit(); + var line_it = mem.tokenizeAny(u8, stdout, "\r\n"); +-- +2.46.0 + |