summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorNiklas Hambüchen <mail@nh2.me>2020-10-17 19:31:15 +0200
committerFrederik Rietdijk <freddyrietdijk@fridh.nl>2020-10-20 21:02:43 +0200
commit70a924fa80e12df7b508e21d3a92f824ce238b5f (patch)
tree137fa7825ab1af950488c98e983e11803a2dfa44 /pkgs
parent3775af7057e11995ac6c7db60e1419c2b9229ab5 (diff)
downloadnixpkgs-70a924fa80e12df7b508e21d3a92f824ce238b5f.tar
nixpkgs-70a924fa80e12df7b508e21d3a92f824ce238b5f.tar.gz
nixpkgs-70a924fa80e12df7b508e21d3a92f824ce238b5f.tar.bz2
nixpkgs-70a924fa80e12df7b508e21d3a92f824ce238b5f.tar.lz
nixpkgs-70a924fa80e12df7b508e21d3a92f824ce238b5f.tar.xz
nixpkgs-70a924fa80e12df7b508e21d3a92f824ce238b5f.tar.zst
nixpkgs-70a924fa80e12df7b508e21d3a92f824ce238b5f.zip
meson: Patch out default boost search paths. See #86131.
Avoids impure builds on unsandboxed non-NixOS builds, see:
https://github.com/NixOS/nixpkgs/issues/86131#issuecomment-711051774
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/tools/build-managers/meson/boost-Do-not-add-system-paths-on-nix.patch40
-rw-r--r--pkgs/development/tools/build-managers/meson/default.nix5
2 files changed, 45 insertions, 0 deletions
diff --git a/pkgs/development/tools/build-managers/meson/boost-Do-not-add-system-paths-on-nix.patch b/pkgs/development/tools/build-managers/meson/boost-Do-not-add-system-paths-on-nix.patch
new file mode 100644
index 00000000000..5b9020b3d54
--- /dev/null
+++ b/pkgs/development/tools/build-managers/meson/boost-Do-not-add-system-paths-on-nix.patch
@@ -0,0 +1,40 @@
+From 536108b10271f2f42d41c7d9ddb4ce2ea1851f4f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= <mail@nh2.me>
+Date: Sat, 17 Oct 2020 19:27:08 +0200
+Subject: [PATCH] boost: Do not add system paths on nix
+
+---
+ mesonbuild/dependencies/boost.py | 17 +----------------
+ 1 file changed, 1 insertion(+), 16 deletions(-)
+
+diff --git a/mesonbuild/dependencies/boost.py b/mesonbuild/dependencies/boost.py
+index 907c0c275..ecaf11b18 100644
+--- a/mesonbuild/dependencies/boost.py
++++ b/mesonbuild/dependencies/boost.py
+@@ -643,22 +643,7 @@ class BoostDependency(ExternalDependency):
+             roots += [x for x in candidates if x.name.lower().startswith('boost') and x.is_dir()]
+         else:
+             tmp = []  # type: T.List[Path]
+-
+-            # Homebrew
+-            brew_boost = Path('/usr/local/Cellar/boost')
+-            if brew_boost.is_dir():
+-                tmp += [x for x in brew_boost.iterdir()]
+-
+-            # Add some default system paths
+-            tmp += [Path('/opt/local')]
+-            tmp += [Path('/usr/local/opt/boost')]
+-            tmp += [Path('/usr/local')]
+-            tmp += [Path('/usr')]
+-
+-            # Cleanup paths
+-            tmp = [x for x in tmp if x.is_dir()]
+-            tmp = [x.resolve() for x in tmp]
+-            roots += tmp
++            # Do not add any non-explicit paths on nix
+ 
+         return roots
+ 
+-- 
+2.25.4
+
diff --git a/pkgs/development/tools/build-managers/meson/default.nix b/pkgs/development/tools/build-managers/meson/default.nix
index 8421fb7d70a..1b9c3ef6477 100644
--- a/pkgs/development/tools/build-managers/meson/default.nix
+++ b/pkgs/development/tools/build-managers/meson/default.nix
@@ -52,6 +52,11 @@ python3.pkgs.buildPythonApplication rec {
     # cut-in-half-by-\0 store path references.
     # Let’s just clear the whole rpath and hope for the best.
     ./clear-old-rpath.patch
+
+    # Patch out default boost search paths to avoid impure builds on
+    # unsandboxed non-NixOS builds, see:
+    # https://github.com/NixOS/nixpkgs/issues/86131#issuecomment-711051774
+    ./boost-Do-not-add-system-paths-on-nix.patch
   ];
 
   setupHook = ./setup-hook.sh;