summaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/zig-0.10-build-respect-PKG_CONFIG-env-var.patch48
-rw-r--r--gnu/packages/patches/zig-0.11-build-respect-PKG_CONFIG-env-var.patch48
-rw-r--r--gnu/packages/patches/zig-0.12-build-respect-PKG_CONFIG-env-var.patch48
-rw-r--r--gnu/packages/patches/zig-0.13-build-respect-PKG_CONFIG-env-var.patch48
-rw-r--r--gnu/packages/patches/zig-0.9-build-respect-PKG_CONFIG-env-var.patch48
5 files changed, 240 insertions, 0 deletions
diff --git a/gnu/packages/patches/zig-0.10-build-respect-PKG_CONFIG-env-var.patch b/gnu/packages/patches/zig-0.10-build-respect-PKG_CONFIG-env-var.patch
new file mode 100644
index 00000000000..a2a93a27115
--- /dev/null
+++ b/gnu/packages/patches/zig-0.10-build-respect-PKG_CONFIG-env-var.patch
@@ -0,0 +1,48 @@
+From eb630302e42f4f565d44f9894c5ab832b99267e2 Mon Sep 17 00:00:00 2001
+From: Hilton Chain <hako@ultrarare.space>
+Date: Sun, 17 Nov 2024 18:08:21 +0800
+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 <bratishkaerik@landless-city.net>
+---
+ lib/std/build.zig | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/lib/std/build.zig b/lib/std/build.zig
+index 1b9a61beb6..2fa6afa12d 100644
+--- a/lib/std/build.zig
++++ b/lib/std/build.zig
+@@ -1284,7 +1284,8 @@ pub const Builder = struct {
+ }
+
+ fn execPkgConfigList(self: *Builder, out_code: *u8) (PkgConfigError || ExecError)![]const PkgConfigPkg {
+- const stdout = try self.execAllowFail(&[_][]const u8{ "pkg-config", "--list-all" }, out_code, .Ignore);
++ const pkg_config_exe = self.env_map.get("PKG_CONFIG") orelse "pkg-config";
++ const stdout = try self.execAllowFail(&[_][]const u8{ pkg_config_exe, "--list-all" }, out_code, .Ignore);
+ var list = ArrayList(PkgConfigPkg).init(self.allocator);
+ errdefer list.deinit();
+ var line_it = mem.tokenize(u8, stdout, "\r\n");
+@@ -2113,8 +2114,9 @@ pub const LibExeObjStep = struct {
+ };
+
+ var code: u8 = undefined;
++ const pkg_config_exe = self.builder.env_map.get("PKG_CONFIG") orelse "pkg-config";
+ const stdout = if (self.builder.execAllowFail(&[_][]const u8{
+- "pkg-config",
++ pkg_config_exe,
+ pkg_name,
+ "--cflags",
+ "--libs",
+--
+2.46.0
+
diff --git a/gnu/packages/patches/zig-0.11-build-respect-PKG_CONFIG-env-var.patch b/gnu/packages/patches/zig-0.11-build-respect-PKG_CONFIG-env-var.patch
new file mode 100644
index 00000000000..ef7110c32f6
--- /dev/null
+++ b/gnu/packages/patches/zig-0.11-build-respect-PKG_CONFIG-env-var.patch
@@ -0,0 +1,48 @@
+From 0cdc9eedd666478ab6d0ca168ea7f7da91f94f2b Mon Sep 17 00:00:00 2001
+From: Eric Joldasov <bratishkaerik@landless-city.net>
+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 <bratishkaerik@landless-city.net>
+---
+ 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 335a7e2df7..1def445ef0 100644
+--- a/lib/std/Build/Step/Compile.zig
++++ b/lib/std/Build/Step/Compile.zig
+@@ -792,8 +792,9 @@ fn runPkgConfig(self: *Compile, lib_name: []const u8) ![]const []const u8 {
+ };
+
+ var code: u8 = undefined;
++ const pkg_config_exe = b.env_map.get("PKG_CONFIG") orelse "pkg-config";
+ const stdout = if (b.execAllowFail(&[_][]const u8{
+- "pkg-config",
++ pkg_config_exe,
+ pkg_name,
+ "--cflags",
+ "--libs",
+@@ -2147,7 +2148,8 @@ pub fn doAtomicSymLinks(
+ }
+
+ fn execPkgConfigList(self: *std.Build, out_code: *u8) (PkgConfigError || ExecError)![]const PkgConfigPkg {
+- const stdout = try self.execAllowFail(&[_][]const u8{ "pkg-config", "--list-all" }, out_code, .Ignore);
++ const pkg_config_exe = self.env_map.get("PKG_CONFIG") orelse "pkg-config";
++ const stdout = try self.execAllowFail(&[_][]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
+
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 00000000000..e2d6305f502
--- /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 <bratishkaerik@landless-city.net>
+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 <bratishkaerik@landless-city.net>
+---
+ 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
+
diff --git a/gnu/packages/patches/zig-0.13-build-respect-PKG_CONFIG-env-var.patch b/gnu/packages/patches/zig-0.13-build-respect-PKG_CONFIG-env-var.patch
new file mode 100644
index 00000000000..09126eed9e5
--- /dev/null
+++ b/gnu/packages/patches/zig-0.13-build-respect-PKG_CONFIG-env-var.patch
@@ -0,0 +1,48 @@
+From adc58a23c88f3f2004993043e36d72950fd12d00 Mon Sep 17 00:00:00 2001
+From: Eric Joldasov <bratishkaerik@landless-city.net>
+Date: Wed, 8 May 2024 23:21:34 +0500
+Subject: [PATCH] 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 <bratishkaerik@landless-city.net>
+---
+ 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 d18d8de413..fdc641f802 100644
+--- a/lib/std/Build/Step/Compile.zig
++++ b/lib/std/Build/Step/Compile.zig
+@@ -701,8 +701,9 @@ fn runPkgConfig(compile: *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",
+@@ -1823,7 +1824,8 @@ pub fn doAtomicSymLinks(
+ }
+
+ fn execPkgConfigList(compile: *std.Build, out_code: *u8) (PkgConfigError || RunError)![]const PkgConfigPkg {
+- const stdout = try compile.runAllowFail(&[_][]const u8{ "pkg-config", "--list-all" }, out_code, .Ignore);
++ const pkg_config_exe = compile.graph.env_map.get("PKG_CONFIG") orelse "pkg-config";
++ const stdout = try compile.runAllowFail(&[_][]const u8{ pkg_config_exe, "--list-all" }, out_code, .Ignore);
+ var list = ArrayList(PkgConfigPkg).init(compile.allocator);
+ errdefer list.deinit();
+ var line_it = mem.tokenizeAny(u8, stdout, "\r\n");
+--
+2.46.0
+
diff --git a/gnu/packages/patches/zig-0.9-build-respect-PKG_CONFIG-env-var.patch b/gnu/packages/patches/zig-0.9-build-respect-PKG_CONFIG-env-var.patch
new file mode 100644
index 00000000000..a1b41fcc558
--- /dev/null
+++ b/gnu/packages/patches/zig-0.9-build-respect-PKG_CONFIG-env-var.patch
@@ -0,0 +1,48 @@
+From 302d9fe6de6572f82c77c63585f77edb858197d7 Mon Sep 17 00:00:00 2001
+From: Hilton Chain <hako@ultrarare.space>
+Date: Sun, 17 Nov 2024 18:08:21 +0800
+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 <bratishkaerik@landless-city.net>
+---
+ lib/std/build.zig | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/lib/std/build.zig b/lib/std/build.zig
+index 8eda542d6e..e44093bde4 100644
+--- a/lib/std/build.zig
++++ b/lib/std/build.zig
+@@ -1265,7 +1265,8 @@ pub const Builder = struct {
+ }
+
+ fn execPkgConfigList(self: *Builder, out_code: *u8) ![]const PkgConfigPkg {
+- const stdout = try self.execAllowFail(&[_][]const u8{ "pkg-config", "--list-all" }, out_code, .Ignore);
++ const pkg_config_exe = self.env_map.get("PKG_CONFIG") orelse "pkg-config";
++ const stdout = try self.execAllowFail(&[_][]const u8{ pkg_config_exe, "--list-all" }, out_code, .Ignore);
+ var list = ArrayList(PkgConfigPkg).init(self.allocator);
+ errdefer list.deinit();
+ var line_it = mem.tokenize(u8, stdout, "\r\n");
+@@ -1932,8 +1933,9 @@ pub const LibExeObjStep = struct {
+ };
+
+ var code: u8 = undefined;
++ const pkg_config_exe = self.builder.env_map.get("PKG_CONFIG") orelse "pkg-config";
+ const stdout = if (self.builder.execAllowFail(&[_][]const u8{
+- "pkg-config",
++ pkg_config_exe,
+ pkg_name,
+ "--cflags",
+ "--libs",
+--
+2.46.0
+