2021-01-11 07:54:33 +00:00
|
|
|
{lib, stdenv, pkgs, fetchurl, graphviz, fontconfig, liberation_ttf,
|
2013-11-16 01:43:38 +00:00
|
|
|
experimentalKernel ? true}:
|
2012-03-20 19:11:22 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
pname = "hol4";
|
2021-02-19 20:24:48 +00:00
|
|
|
vnum = "14";
|
2015-06-23 23:17:51 +01:00
|
|
|
in
|
|
|
|
|
|
|
|
let
|
|
|
|
version = "k.${vnum}";
|
|
|
|
longVersion = "kananaskis-${vnum}";
|
|
|
|
holsubdir = "hol-${longVersion}";
|
2021-02-19 20:24:48 +00:00
|
|
|
kernelFlag = if experimentalKernel then "--expk" else "--stdknl";
|
2012-03-20 19:11:22 +00:00
|
|
|
in
|
2010-08-25 20:50:24 +01:00
|
|
|
|
2015-06-23 23:17:51 +01:00
|
|
|
let
|
|
|
|
polymlEnableShared = with pkgs; lib.overrideDerivation polyml (attrs: {
|
2018-07-25 22:44:21 +01:00
|
|
|
configureFlags = [ "--enable-shared" ];
|
2015-06-23 23:17:51 +01:00
|
|
|
});
|
|
|
|
in
|
|
|
|
|
2010-08-25 20:50:24 +01:00
|
|
|
stdenv.mkDerivation {
|
2012-03-20 19:11:22 +00:00
|
|
|
name = "${pname}-${version}";
|
2010-08-25 20:50:24 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-06-23 23:17:51 +01:00
|
|
|
url = "mirror://sourceforge/hol/hol/${longVersion}/${holsubdir}.tar.gz";
|
2021-02-19 20:24:48 +00:00
|
|
|
sha256 = "6Mc/qsEjzxGqzt6yP6x/1Tmqpwc1UDGlwV1Gl+4pMsY=";
|
2010-08-25 20:50:24 +01:00
|
|
|
};
|
|
|
|
|
2015-06-23 23:17:51 +01:00
|
|
|
buildInputs = [polymlEnableShared graphviz fontconfig liberation_ttf];
|
2010-08-25 20:50:24 +01:00
|
|
|
|
|
|
|
buildCommand = ''
|
2013-11-16 01:43:38 +00:00
|
|
|
|
|
|
|
mkdir chroot-fontconfig
|
2015-10-05 11:23:02 +01:00
|
|
|
cat ${fontconfig.out}/etc/fonts/fonts.conf > chroot-fontconfig/fonts.conf
|
2013-11-16 01:43:38 +00:00
|
|
|
sed -e 's@</fontconfig>@@' -i chroot-fontconfig/fonts.conf
|
|
|
|
echo "<dir>${liberation_ttf}</dir>" >> chroot-fontconfig/fonts.conf
|
|
|
|
echo "</fontconfig>" >> chroot-fontconfig/fonts.conf
|
|
|
|
|
|
|
|
export FONTCONFIG_FILE=$(pwd)/chroot-fontconfig/fonts.conf
|
|
|
|
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p "$out/src"
|
2010-08-25 20:50:24 +01:00
|
|
|
cd "$out/src"
|
|
|
|
|
|
|
|
tar -xzf "$src"
|
2013-10-10 11:00:12 +01:00
|
|
|
cd ${holsubdir}
|
2010-08-25 20:50:24 +01:00
|
|
|
|
2012-03-20 19:11:22 +00:00
|
|
|
substituteInPlace tools/Holmake/Holmake_types.sml \
|
2021-02-19 20:24:48 +00:00
|
|
|
--replace "\"/bin/" "\"" \
|
|
|
|
|
2010-08-25 20:50:24 +01:00
|
|
|
|
2013-11-16 01:43:38 +00:00
|
|
|
for f in tools/buildutils.sml help/src-sml/DOT;
|
|
|
|
do
|
|
|
|
substituteInPlace $f --replace "\"/usr/bin/dot\"" "\"${graphviz}/bin/dot\""
|
|
|
|
done
|
2013-10-10 11:00:12 +01:00
|
|
|
|
2010-08-25 20:50:24 +01:00
|
|
|
#sed -ie "/compute/,999 d" tools/build-sequence # for testing
|
|
|
|
|
|
|
|
poly < tools/smart-configure.sml
|
2015-06-23 23:17:51 +01:00
|
|
|
|
2021-02-19 20:24:48 +00:00
|
|
|
bin/build ${kernelFlag}
|
2010-08-25 20:50:24 +01:00
|
|
|
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p "$out/bin"
|
2013-11-16 00:52:36 +00:00
|
|
|
ln -st $out/bin $out/src/${holsubdir}/bin/*
|
2012-03-20 19:11:22 +00:00
|
|
|
# ln -s $out/src/hol4.${version}/bin $out/bin
|
2010-08-25 20:50:24 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2013-10-06 10:49:53 +01:00
|
|
|
description = "Interactive theorem prover based on Higher-Order Logic";
|
2010-08-25 20:50:24 +01:00
|
|
|
longDescription = ''
|
|
|
|
HOL4 is the latest version of the HOL interactive proof
|
|
|
|
assistant for higher order logic: a programming environment in
|
|
|
|
which theorems can be proved and proof tools
|
|
|
|
implemented. Built-in decision procedures and theorem provers
|
|
|
|
can automatically establish many simple theorems (users may have
|
|
|
|
to prove the hard theorems themselves!) An oracle mechanism
|
|
|
|
gives access to external programs such as SMT and BDD
|
|
|
|
engines. HOL4 is particularly suitable as a platform for
|
|
|
|
implementing combinations of deduction, execution and property
|
|
|
|
checking.
|
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://hol.sourceforge.net/";
|
2015-06-23 23:17:51 +01:00
|
|
|
license = licenses.bsd3;
|
2021-02-19 20:24:48 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2015-06-23 23:17:51 +01:00
|
|
|
maintainers = with maintainers; [ mudri ];
|
2010-08-25 20:50:24 +01:00
|
|
|
};
|
|
|
|
}
|