2022-01-03 16:56:52 +00:00
|
|
|
{ lib, stdenv, fetchurl, nettools, java, polyml, z3, veriT, vampire, eprover-ho, rlwrap, makeDesktopItem }:
|
2020-04-24 23:36:52 +00:00
|
|
|
# nettools needed for hostname
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "isabelle";
|
2022-01-03 16:56:52 +00:00
|
|
|
version = "2021-1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
dirname = "Isabelle${version}";
|
|
|
|
|
|
|
|
src = if stdenv.isDarwin
|
|
|
|
then fetchurl {
|
2020-09-25 04:45:31 +00:00
|
|
|
url = "https://isabelle.in.tum.de/website-${dirname}/dist/${dirname}_macos.tar.gz";
|
2022-01-03 16:56:52 +00:00
|
|
|
sha256 = "0n1ls9vwf0ps1x8zpb7c1xz1wkasgvc34h5bz280hy2z6iqwmwbc";
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|
|
|
|
else fetchurl {
|
|
|
|
url = "https://isabelle.in.tum.de/website-${dirname}/dist/${dirname}_linux.tar.gz";
|
2022-01-03 16:56:52 +00:00
|
|
|
sha256 = "0jfaqckhg388jh9b4msrpkv6wrd6xzlw18m0bngbby8k8ywalp9i";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
buildInputs = [ polyml z3 veriT vampire eprover-ho ]
|
2021-01-17 00:15:33 +00:00
|
|
|
++ lib.optionals (!stdenv.isDarwin) [ nettools java ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
sourceRoot = dirname;
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs .
|
|
|
|
|
|
|
|
cat >contrib/z3*/etc/settings <<EOF
|
|
|
|
Z3_HOME=${z3}
|
|
|
|
Z3_VERSION=${z3.version}
|
|
|
|
Z3_SOLVER=${z3}/bin/z3
|
|
|
|
Z3_INSTALLED=yes
|
|
|
|
EOF
|
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
cat >contrib/verit-*/etc/settings <<EOF
|
|
|
|
ISABELLE_VERIT=${veriT}/bin/veriT
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cat >contrib/e-*/etc/settings <<EOF
|
|
|
|
E_HOME=${eprover-ho}/bin
|
|
|
|
E_VERSION=${eprover-ho.version}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cat >contrib/vampire-*/etc/settings <<EOF
|
|
|
|
VAMPIRE_HOME=${vampire}/bin
|
|
|
|
VAMPIRE_VERSION=${vampire.version}
|
|
|
|
VAMPIRE_EXTRA_OPTIONS="--mode casc"
|
|
|
|
EOF
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
cat >contrib/polyml-*/etc/settings <<EOF
|
|
|
|
ML_SYSTEM_64=true
|
|
|
|
ML_SYSTEM=${polyml.name}
|
|
|
|
ML_PLATFORM=${stdenv.system}
|
|
|
|
ML_HOME=${polyml}/bin
|
|
|
|
ML_OPTIONS="--minheap 1000"
|
|
|
|
POLYML_HOME="\$COMPONENT"
|
|
|
|
ML_SOURCES="\$POLYML_HOME/src"
|
|
|
|
EOF
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
cat >contrib/jdk*/etc/settings <<EOF
|
2020-04-24 23:36:52 +00:00
|
|
|
ISABELLE_JAVA_PLATFORM=${stdenv.system}
|
|
|
|
ISABELLE_JDK_HOME=${java}
|
|
|
|
EOF
|
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
sed -i -e 's/naproche_server : bool = true/naproche_server : bool = false/' contrib/naproche-*/etc/options
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
echo ISABELLE_LINE_EDITOR=${rlwrap}/bin/rlwrap >>etc/settings
|
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
for comp in contrib/jdk* contrib/polyml-* contrib/z3-* contrib/verit-* contrib/vampire-* contrib/e-*; do
|
2020-04-24 23:36:52 +00:00
|
|
|
rm -rf $comp/x86*
|
|
|
|
done
|
|
|
|
'' + (if ! stdenv.isLinux then "" else ''
|
|
|
|
arch=${if stdenv.hostPlatform.system == "x86_64-linux" then "x86_64-linux" else "x86-linux"}
|
2022-01-03 16:56:52 +00:00
|
|
|
for f in contrib/*/$arch/{bash_process,epclextract,nunchaku,SPASS}; do
|
2020-04-24 23:36:52 +00:00
|
|
|
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f"
|
|
|
|
done
|
|
|
|
'');
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mv $TMP/$dirname $out
|
|
|
|
cd $out/$dirname
|
|
|
|
bin/isabelle install $out/bin
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
# icon
|
|
|
|
mkdir -p "$out/share/icons/hicolor/isabelle/apps"
|
|
|
|
cp "$out/Isabelle${version}/lib/icons/isabelle.xpm" "$out/share/icons/hicolor/isabelle/apps/"
|
|
|
|
|
|
|
|
# desktop item
|
|
|
|
mkdir -p "$out/share"
|
|
|
|
cp -r "${desktopItem}/share/applications" "$out/share/applications"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "isabelle";
|
|
|
|
exec = "isabelle jedit";
|
|
|
|
icon = "isabelle";
|
|
|
|
desktopName = "Isabelle";
|
|
|
|
comment = meta.description;
|
|
|
|
categories = "Education;Science;Math;";
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A generic proof assistant";
|
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
Isabelle is a generic proof assistant. It allows mathematical formulas
|
|
|
|
to be expressed in a formal language and provides tools for proving those
|
|
|
|
formulas in a logical calculus.
|
|
|
|
'';
|
2020-09-25 04:45:31 +00:00
|
|
|
homepage = "https://isabelle.in.tum.de/";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.jwiegley ];
|
|
|
|
platforms = platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|