2023-08-01 06:15:31 +02:00
|
|
|
{ lib, stdenv, runtimeShell, fetchFromGitHub, fetchpatch, ocaml, findlib, num, camlp5, camlp-streams }:
|
2010-02-15 12:00:02 +01:00
|
|
|
|
2011-12-16 08:44:29 +01:00
|
|
|
let
|
2018-10-05 14:14:25 +02:00
|
|
|
load_num =
|
2023-06-24 20:19:19 +02:00
|
|
|
lib.optionalString (num != null) ''
|
2021-11-07 14:50:48 +01:00
|
|
|
-I ${num}/lib/ocaml/${ocaml.version}/site-lib/num \
|
|
|
|
-I ${num}/lib/ocaml/${ocaml.version}/site-lib/top-num \
|
|
|
|
-I ${num}/lib/ocaml/${ocaml.version}/site-lib/stublibs \
|
|
|
|
'';
|
2018-10-05 14:14:25 +02:00
|
|
|
|
|
|
|
start_script =
|
|
|
|
''
|
2019-02-26 12:45:54 +01:00
|
|
|
#!${runtimeShell}
|
2018-10-05 14:14:25 +02:00
|
|
|
cd $out/lib/hol_light
|
|
|
|
exec ${ocaml}/bin/ocaml \
|
|
|
|
-I \`${camlp5}/bin/camlp5 -where\` \
|
|
|
|
${load_num} \
|
2023-08-01 06:15:31 +02:00
|
|
|
-I ${camlp-streams}/lib/ocaml/${ocaml.version}/site-lib/camlp-streams camlp_streams.cma
|
2018-10-05 14:14:25 +02:00
|
|
|
-init make.ml
|
|
|
|
'';
|
2011-12-16 08:44:29 +01:00
|
|
|
in
|
2014-09-16 16:55:56 +02:00
|
|
|
|
2023-08-01 06:15:31 +02:00
|
|
|
lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
|
|
|
|
"hol_light is not available for OCaml ${ocaml.version}"
|
|
|
|
|
2015-11-03 15:24:32 +01:00
|
|
|
stdenv.mkDerivation {
|
2021-11-07 14:50:48 +01:00
|
|
|
pname = "hol_light";
|
2023-08-01 06:15:31 +02:00
|
|
|
version = "unstable-2023-07-21";
|
2011-12-16 08:44:29 +01:00
|
|
|
|
2015-11-03 15:24:32 +01:00
|
|
|
src = fetchFromGitHub {
|
2021-11-07 14:50:48 +01:00
|
|
|
owner = "jrh13";
|
|
|
|
repo = "hol-light";
|
2023-08-01 06:15:31 +02:00
|
|
|
rev = "29b3e114f5c166584f4fbcfd1e1f9b13a25b7349";
|
|
|
|
hash = "sha256-Z5/4dCfLRwLMHBmth3xMdFW1M6NzUT/aPEEwSz1/S2E=";
|
2011-12-16 08:44:29 +01:00
|
|
|
};
|
|
|
|
|
2021-11-07 14:50:48 +01:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://salsa.debian.org/ocaml-team/hol-light/-/raw/master/debian/patches/0004-Fix-compilation-with-camlp5-7.11.patch";
|
|
|
|
sha256 = "180qmxbrk3vb1ix7j77hcs8vsar91rs11s5mm8ir5352rz7ylicr";
|
|
|
|
})
|
|
|
|
];
|
2020-03-19 12:05:24 +01:00
|
|
|
|
2022-04-04 13:57:15 +02:00
|
|
|
strictDeps = true;
|
|
|
|
|
2023-08-01 06:15:31 +02:00
|
|
|
nativeBuildInputs = [ ocaml findlib camlp5 ];
|
|
|
|
propagatedBuildInputs = [ camlp-streams num ];
|
2016-11-29 19:30:15 +01:00
|
|
|
|
2011-05-21 13:18:35 +02:00
|
|
|
installPhase = ''
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p "$out/lib/hol_light" "$out/bin"
|
2011-05-21 13:18:35 +02:00
|
|
|
cp -a . $out/lib/hol_light
|
|
|
|
echo "${start_script}" > "$out/bin/hol_light"
|
|
|
|
chmod a+x "$out/bin/hol_light"
|
2010-02-15 12:00:02 +01:00
|
|
|
'';
|
2011-05-21 13:18:35 +02:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2013-10-06 11:49:53 +02:00
|
|
|
description = "Interactive theorem prover based on Higher-Order Logic";
|
2021-11-07 14:50:48 +01:00
|
|
|
homepage = "http://www.cl.cam.ac.uk/~jrh13/hol-light/";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
platforms = platforms.unix;
|
2019-10-07 16:44:58 +02:00
|
|
|
maintainers = with maintainers; [ thoughtpolice maggesi vbgl ];
|
2010-02-15 12:00:02 +01:00
|
|
|
};
|
|
|
|
}
|