2021-07-19 10:04:30 +00:00
|
|
|
{ lib, stdenv, fetchurl, perl, perlPackages, makeWrapper, nettools, java, polyml, z3, rlwrap, makeDesktopItem }:
|
2009-12-11 17:00:52 +00:00
|
|
|
# nettools needed for hostname
|
|
|
|
|
2019-03-12 13:30:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "isabelle";
|
2021-07-18 21:49:43 +00:00
|
|
|
version = "2021";
|
2009-12-11 17:00:52 +00:00
|
|
|
|
2019-03-12 13:30:52 +00:00
|
|
|
dirname = "Isabelle${version}";
|
2009-12-11 17:00:52 +00:00
|
|
|
|
2014-09-30 17:56:48 +00:00
|
|
|
src = if stdenv.isDarwin
|
|
|
|
then fetchurl {
|
2020-05-09 22:46:00 +00:00
|
|
|
url = "https://isabelle.in.tum.de/website-${dirname}/dist/${dirname}_macos.tar.gz";
|
2021-07-18 21:49:43 +00:00
|
|
|
sha256 = "1c2qm2ksmpyxyccyyn4lyj2wqj5m74nz2i0c5abrd1hj45zcnh1m";
|
2014-09-30 17:56:48 +00:00
|
|
|
}
|
|
|
|
else fetchurl {
|
2018-06-28 18:43:35 +00:00
|
|
|
url = "https://isabelle.in.tum.de/website-${dirname}/dist/${dirname}_linux.tar.gz";
|
2021-07-18 21:49:43 +00:00
|
|
|
sha256 = "1isgc9w4q95638dcag9gxz1kmf97pkin3jz1dm2lhd64b2k12y2x";
|
2014-09-30 17:56:48 +00:00
|
|
|
};
|
2009-12-11 17:00:52 +00:00
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ perl polyml z3 ]
|
2021-01-15 13:21:58 +00:00
|
|
|
++ lib.optionals (!stdenv.isDarwin) [ nettools java ];
|
2009-12-11 17:00:52 +00:00
|
|
|
|
2013-06-07 00:13:54 +00:00
|
|
|
sourceRoot = dirname;
|
2009-12-11 17:00:52 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
2019-03-14 10:43:06 +00:00
|
|
|
patchShebangs .
|
|
|
|
|
|
|
|
cat >contrib/z3*/etc/settings <<EOF
|
|
|
|
Z3_HOME=${z3}
|
|
|
|
Z3_VERSION=${z3.version}
|
|
|
|
Z3_SOLVER=${z3}/bin/z3
|
|
|
|
Z3_INSTALLED=yes
|
|
|
|
EOF
|
2017-10-10 09:18:22 +00:00
|
|
|
|
2019-03-12 13:30: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-05-07 22:33:03 +00:00
|
|
|
cat >contrib/jdk*/etc/settings <<EOF
|
2019-03-14 10:43:06 +00:00
|
|
|
ISABELLE_JAVA_PLATFORM=${stdenv.system}
|
|
|
|
ISABELLE_JDK_HOME=${java}
|
|
|
|
EOF
|
|
|
|
|
2021-07-18 21:49:43 +00:00
|
|
|
sed -i -e 's/naproche_server : bool = true/naproche_server : bool = false/' contrib/naproche-*/etc/options
|
|
|
|
|
2019-03-14 10:43:06 +00:00
|
|
|
echo ISABELLE_LINE_EDITOR=${rlwrap}/bin/rlwrap >>etc/settings
|
|
|
|
|
2020-05-07 22:33:03 +00:00
|
|
|
for comp in contrib/jdk* contrib/polyml-* contrib/z3-*; do
|
2017-10-10 09:18:22 +00:00
|
|
|
rm -rf $comp/x86*
|
|
|
|
done
|
2017-01-11 22:24:23 +00:00
|
|
|
'' + (if ! stdenv.isLinux then "" else ''
|
2018-08-20 19:11:29 +00:00
|
|
|
arch=${if stdenv.hostPlatform.system == "x86_64-linux" then "x86_64-linux" else "x86-linux"}
|
2017-01-11 22:24:23 +00:00
|
|
|
for f in contrib/*/$arch/{bash_process,epclextract,eprover,nunchaku,SPASS}; do
|
|
|
|
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f"
|
|
|
|
done
|
|
|
|
'');
|
2009-12-11 17:00:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out/bin
|
2013-06-07 00:13:54 +00:00
|
|
|
mv $TMP/$dirname $out
|
|
|
|
cd $out/$dirname
|
2014-09-30 17:56:48 +00:00
|
|
|
bin/isabelle install $out/bin
|
2021-01-28 10:05:39 +00:00
|
|
|
|
2021-07-19 10:04:30 +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"
|
|
|
|
|
2021-01-28 10:05:39 +00:00
|
|
|
wrapProgram $out/$dirname/src/HOL/Tools/ATP/scripts/remote_atp --set PERL5LIB ${perlPackages.makeFullPerlPath [ perlPackages.LWP ]}
|
2009-12-11 17:00:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-07-19 10:04:30 +00:00
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "isabelle";
|
|
|
|
exec = "isabelle jedit";
|
|
|
|
icon = "isabelle";
|
|
|
|
desktopName = "Isabelle";
|
|
|
|
comment = meta.description;
|
|
|
|
categories = "Education;Science;Math;";
|
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2009-12-11 17:00: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-05-09 22:46:00 +00:00
|
|
|
homepage = "https://isabelle.in.tum.de/";
|
2020-05-09 22:49:56 +00:00
|
|
|
license = licenses.bsd3;
|
2020-06-05 10:44:13 +00:00
|
|
|
maintainers = [ maintainers.jwiegley ];
|
2020-05-09 22:49:56 +00:00
|
|
|
platforms = platforms.linux;
|
2009-12-11 17:00:52 +00:00
|
|
|
};
|
|
|
|
}
|