summary refs log tree commit diff
path: root/pkgs/development/libraries/cminpack
diff options
context:
space:
mode:
authorBen Siraphob <bensiraphob@gmail.com>2021-03-08 22:54:25 +0700
committerBen Siraphob <bensiraphob@gmail.com>2021-03-09 09:16:10 +0700
commit06f3076639a85720976822808a47e1f1a0770134 (patch)
treee231048b229e3e2d2e57ed735c9c01c94a5e3b41 /pkgs/development/libraries/cminpack
parent9ed137b640625fbc715be9c19ec9320cdd513e42 (diff)
downloadnixpkgs-06f3076639a85720976822808a47e1f1a0770134.tar
nixpkgs-06f3076639a85720976822808a47e1f1a0770134.tar.gz
nixpkgs-06f3076639a85720976822808a47e1f1a0770134.tar.bz2
nixpkgs-06f3076639a85720976822808a47e1f1a0770134.tar.lz
nixpkgs-06f3076639a85720976822808a47e1f1a0770134.tar.xz
nixpkgs-06f3076639a85720976822808a47e1f1a0770134.tar.zst
nixpkgs-06f3076639a85720976822808a47e1f1a0770134.zip
cminpack: fix darwin build
Diffstat (limited to 'pkgs/development/libraries/cminpack')
-rw-r--r--pkgs/development/libraries/cminpack/default.nix10
1 files changed, 7 insertions, 3 deletions
diff --git a/pkgs/development/libraries/cminpack/default.nix b/pkgs/development/libraries/cminpack/default.nix
index 39d4849f380..10d06860436 100644
--- a/pkgs/development/libraries/cminpack/default.nix
+++ b/pkgs/development/libraries/cminpack/default.nix
@@ -8,8 +8,12 @@ stdenv.mkDerivation rec {
     sha256 = "17yh695aim508x1kn9zf6g13jxwk3pi3404h5ix4g5lc60hzs1rw";
   };
 
-  patchPhase = ''
-    sed -i s,/usr/local,$out, Makefile
+  postPatch = ''
+    substituteInPlace Makefile \
+      --replace '/usr/local' '${placeholder "out"}' \
+      --replace 'gcc' '${stdenv.cc.targetPrefix}cc' \
+      --replace 'ranlib -t' '${stdenv.cc.targetPrefix}ranlib' \
+      --replace 'ranlib' '${stdenv.cc.targetPrefix}ranlib'
   '';
 
   preInstall = ''
@@ -20,7 +24,7 @@ stdenv.mkDerivation rec {
     homepage = "http://devernay.free.fr/hacks/cminpack/cminpack.html";
     license = lib.licenses.bsd3;
     description = "Software for solving nonlinear equations and nonlinear least squares problems";
-    platforms = lib.platforms.linux;
+    platforms = lib.platforms.all;
   };
 
 }