about summary refs log tree commit diff
path: root/pkgs/development/rocm-modules/6/llvm/base.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/rocm-modules/6/llvm/base.nix')
-rw-r--r--pkgs/development/rocm-modules/6/llvm/base.nix11
1 files changed, 9 insertions, 2 deletions
diff --git a/pkgs/development/rocm-modules/6/llvm/base.nix b/pkgs/development/rocm-modules/6/llvm/base.nix
index 95f57b052045e..caa2ebe42823a 100644
--- a/pkgs/development/rocm-modules/6/llvm/base.nix
+++ b/pkgs/development/rocm-modules/6/llvm/base.nix
@@ -133,7 +133,14 @@ in stdenv.mkDerivation (finalAttrs: {
     "-DLLVM_EXTERNAL_LIT=${lit}/bin/.lit-wrapped"
   ] ++ extraCMakeFlags;
 
-  postPatch = lib.optionalString finalAttrs.passthru.isLLVM ''
+  prePatch = ''
+    cd ../
+    chmod -R u+w .
+  '';
+
+  postPatch = ''
+    cd ${targetDir}
+  '' + lib.optionalString finalAttrs.passthru.isLLVM ''
     patchShebangs lib/OffloadArch/make_generated_offload_arch_h.sh
   '' + lib.optionalString (buildTests && finalAttrs.passthru.isLLVM) ''
     # FileSystem permissions tests fail with various special bits
@@ -141,7 +148,7 @@ in stdenv.mkDerivation (finalAttrs: {
     rm unittests/Support/Path.cpp
 
     substituteInPlace unittests/Support/CMakeLists.txt \
-      --replace "Path.cpp" ""
+      --replace-fail "Path.cpp" ""
   '' + extraPostPatch;
 
   doCheck = buildTests;