summary refs log tree commit diff
path: root/pkgs/applications/science
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2022-06-23 13:24:53 -0400
committerShea Levy <shea@shealevy.com>2022-06-23 13:24:53 -0400
commitc4f2260cdbfdcedc57337821110eb6c1071a9b6d (patch)
treee140911238fb16055c750dc4af22d9fabceeee71 /pkgs/applications/science
parent4d781f329ded7a99d0225e4f01fc56303b1d18ab (diff)
downloadnixpkgs-c4f2260cdbfdcedc57337821110eb6c1071a9b6d.tar
nixpkgs-c4f2260cdbfdcedc57337821110eb6c1071a9b6d.tar.gz
nixpkgs-c4f2260cdbfdcedc57337821110eb6c1071a9b6d.tar.bz2
nixpkgs-c4f2260cdbfdcedc57337821110eb6c1071a9b6d.tar.lz
nixpkgs-c4f2260cdbfdcedc57337821110eb6c1071a9b6d.tar.xz
nixpkgs-c4f2260cdbfdcedc57337821110eb6c1071a9b6d.tar.zst
nixpkgs-c4f2260cdbfdcedc57337821110eb6c1071a9b6d.zip
isabelle: Fix build on darwin
Diffstat (limited to 'pkgs/applications/science')
-rw-r--r--pkgs/applications/science/logic/isabelle/default.nix16
1 files changed, 12 insertions, 4 deletions
diff --git a/pkgs/applications/science/logic/isabelle/default.nix b/pkgs/applications/science/logic/isabelle/default.nix
index 9e5d40be2c6..0bdcd352051 100644
--- a/pkgs/applications/science/logic/isabelle/default.nix
+++ b/pkgs/applications/science/logic/isabelle/default.nix
@@ -47,10 +47,15 @@ in stdenv.mkDerivation rec {
         sha256 = "0jfaqckhg388jh9b4msrpkv6wrd6xzlw18m0bngbby8k8ywalp9i";
       };
 
-  buildInputs = [ polyml z3 veriT vampire eprover-ho ]
-    ++ lib.optionals (!stdenv.isDarwin) [ nettools java ];
+  buildInputs = [ polyml z3 veriT vampire eprover-ho nettools ]
+    ++ lib.optionals (!stdenv.isDarwin) [ java ];
 
-  sourceRoot = dirname;
+  sourceRoot = "${dirname}${lib.optionalString stdenv.isDarwin ".app"}";
+
+  postUnpack = if stdenv.isDarwin then ''
+    mv $sourceRoot ${dirname}
+    sourceRoot=${dirname}
+  '' else null;
 
   postPatch = ''
     patchShebangs .
@@ -112,6 +117,9 @@ in stdenv.mkDerivation rec {
       --replace '"$ML_HOME/" ^ (if ML_System.platform_is_windows then "sha1.dll" else "libsha1.so")' '"${sha1}/lib/libsha1.so"'
 
     rm -r heaps
+  '' + lib.optionalString (stdenv.hostPlatform.system == "x86_64-darwin") ''
+    substituteInPlace lib/scripts/isabelle-platform \
+      --replace 'ISABELLE_APPLE_PLATFORM64=arm64-darwin' ""
   '' + (if ! stdenv.isLinux then "" else ''
     arch=${if stdenv.hostPlatform.system == "x86_64-linux" then "x86_64-linux" else "x86-linux"}
     for f in contrib/*/$arch/{bash_process,epclextract,nunchaku,SPASS,zipperposition}; do
@@ -180,7 +188,7 @@ in stdenv.mkDerivation rec {
     homepage = "https://isabelle.in.tum.de/";
     license = licenses.bsd3;
     maintainers = [ maintainers.jwiegley maintainers.jvanbruegge ];
-    platforms = platforms.linux;
+    platforms = platforms.unix;
   };
 } // {
   withComponents = f: