about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEmily Trau <13267947+emilytrau@users.noreply.github.com>2024-05-15 09:56:49 +1000
committerGitHub <noreply@github.com>2024-05-15 09:56:49 +1000
commit311cd0a3d88abaafdd5b5218efd6affea48fba7e (patch)
tree682002986be9444f5222e423f03bc275550e8755
parente5d9b197e9f13b29ca797e6a0aab21840eab64d4 (diff)
parent228c11d09df9ad4bc968d7e5b0dc7d2972360e64 (diff)
Merge pull request #311145 from TomaSajt/odin
odin: fix patches for darwin
-rw-r--r--pkgs/development/compilers/odin/default.nix12
1 files changed, 5 insertions, 7 deletions
diff --git a/pkgs/development/compilers/odin/default.nix b/pkgs/development/compilers/odin/default.nix
index 9168ad485e277..3cf9d568af031 100644
--- a/pkgs/development/compilers/odin/default.nix
+++ b/pkgs/development/compilers/odin/default.nix
@@ -30,13 +30,11 @@ in stdenv.mkDerivation rec {
   LLVM_CONFIG = "${llvmPackages.llvm.dev}/bin/llvm-config";
 
   postPatch = lib.optionalString stdenv.isDarwin ''
-    sed -i src/main.cpp \
-      -e 's|-syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk|-syslibroot ${MacOSX-SDK}|'
-  '' + ''
-    sed -i build_odin.sh \
-      -e 's/^GIT_SHA=.*$/GIT_SHA=/' \
-      -e 's/LLVM-C/LLVM/' \
-      -e 's/framework System/lSystem/'
+    substituteInPlace src/linker.cpp \
+        --replace-fail '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' ${MacOSX-SDK}
+    '' + ''
+    substituteInPlace build_odin.sh \
+        --replace-fail '-framework System' '-lSystem'
     patchShebangs build_odin.sh
   '';