summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/build_systems/autotools.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/spack/spack/build_systems/autotools.py b/lib/spack/spack/build_systems/autotools.py
index 0a9946a1c0..97b5e9ef51 100644
--- a/lib/spack/spack/build_systems/autotools.py
+++ b/lib/spack/spack/build_systems/autotools.py
@@ -239,6 +239,15 @@ To resolve this problem, please try the following:
os.chmod(abs_path, mode)
@run_before("configure")
+ def _patch_usr_bin_file(self):
+ """On NixOS file is not available in /usr/bin/file. Patch configure
+ scripts to use file from path."""
+
+ if self.spec.os.startswith("nixos"):
+ for configure_file in fs.find(".", files=["configure"], recursive=True):
+ fs.filter_file("/usr/bin/file", "file", configure_file, string=True)
+
+ @run_before("configure")
def _set_autotools_environment_variables(self):
"""Many autotools builds use a version of mknod.m4 that fails when
running as root unless FORCE_UNSAFE_CONFIGURE is set to 1.