summary refs log tree commit diff
path: root/pkgs/applications/science
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2022-03-01 12:05:54 +0000
committerGitHub <noreply@github.com>2022-03-01 12:05:54 +0000
commit4ae3f9a06c832b7d125debe87a2fd0ec88ad165b (patch)
tree64381c27662b2b2d477094df3cc5803c11ce63bc /pkgs/applications/science
parent3135db28cb2d1136bde46aadb4adbbd8a7af0306 (diff)
parente3c78ec446db310c01504dca6cb7ee4cba0f8a7d (diff)
downloadnixpkgs-4ae3f9a06c832b7d125debe87a2fd0ec88ad165b.tar
nixpkgs-4ae3f9a06c832b7d125debe87a2fd0ec88ad165b.tar.gz
nixpkgs-4ae3f9a06c832b7d125debe87a2fd0ec88ad165b.tar.bz2
nixpkgs-4ae3f9a06c832b7d125debe87a2fd0ec88ad165b.tar.lz
nixpkgs-4ae3f9a06c832b7d125debe87a2fd0ec88ad165b.tar.xz
nixpkgs-4ae3f9a06c832b7d125debe87a2fd0ec88ad165b.tar.zst
nixpkgs-4ae3f9a06c832b7d125debe87a2fd0ec88ad165b.zip
Merge master into staging-next
Diffstat (limited to 'pkgs/applications/science')
-rw-r--r--pkgs/applications/science/logic/isabelle/default.nix24
1 files changed, 23 insertions, 1 deletions
diff --git a/pkgs/applications/science/logic/isabelle/default.nix b/pkgs/applications/science/logic/isabelle/default.nix
index 96e8da059a4..aaac288b615 100644
--- a/pkgs/applications/science/logic/isabelle/default.nix
+++ b/pkgs/applications/science/logic/isabelle/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, coreutils, nettools, java, polyml, z3, veriT, vampire, eprover-ho, rlwrap, makeDesktopItem }:
+{ lib, stdenv, fetchurl, coreutils, nettools, java, scala, polyml, z3, veriT, vampire, eprover-ho, rlwrap, perl, makeDesktopItem }:
 # nettools needed for hostname
 
 stdenv.mkDerivation rec {
@@ -77,6 +77,10 @@ stdenv.mkDerivation rec {
     substituteInPlace lib/Tools/env \
       --replace /usr/bin/env ${coreutils}/bin/env
 
+    substituteInPlace src/Tools/Setup/src/Environment.java \
+      --replace 'cmd.add("/usr/bin/env");' "" \
+      --replace 'cmd.add("bash");' "cmd.add(\"$SHELL\");"
+
     rm -r heaps
   '' + (if ! stdenv.isLinux then "" else ''
     arch=${if stdenv.hostPlatform.system == "x86_64-linux" then "x86_64-linux" else "x86-linux"}
@@ -90,6 +94,24 @@ stdenv.mkDerivation rec {
 
   buildPhase = ''
     export HOME=$TMP # The build fails if home is not set
+    setup_name=$(basename contrib/isabelle_setup*)
+
+    #The following is adapted from https://isabelle.sketis.net/repos/isabelle/file/Isabelle2021-1/Admin/lib/Tools/build_setup
+    TARGET_DIR="contrib/$setup_name/lib"
+    rm -rf "$TARGET_DIR"
+    mkdir -p "$TARGET_DIR/isabelle/setup"
+    declare -a ARGS=("-Xlint:unchecked")
+
+    SOURCES="$(${perl}/bin/perl -e 'while (<>) { if (m/(\S+\.java)/)  { print "$1 "; } }' "src/Tools/Setup/etc/build.props")"
+    for SRC in $SOURCES
+    do
+      ARGS["''${#ARGS[@]}"]="src/Tools/Setup/$SRC"
+    done
+    ${java}/bin/javac -d "$TARGET_DIR" -classpath ${scala}/lib/scala-compiler.jar "''${ARGS[@]}"
+    ${java}/bin/jar -c -f "$TARGET_DIR/isabelle_setup.jar" -e "isabelle.setup.Setup" -C "$TARGET_DIR" isabelle
+    rm -rf "$TARGET_DIR/isabelle"
+
+    # Prebuild HOL Session
     bin/isabelle build -v -o system_heaps -b HOL
   '';