From 3892ca21ff9c6d508e32c40f9f5ac894accbf556 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Wed, 22 May 2024 21:46:27 +0200 Subject: [PATCH] =?UTF-8?q?hol=5Flight:=202023-11-03=20=E2=86=92=202024-05?= =?UTF-8?q?-10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../science/logic/hol_light/default.nix | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/science/logic/hol_light/default.nix b/pkgs/applications/science/logic/hol_light/default.nix index 813397ba01f9..0e3dee4b0c0a 100644 --- a/pkgs/applications/science/logic/hol_light/default.nix +++ b/pkgs/applications/science/logic/hol_light/default.nix @@ -1,8 +1,12 @@ -{ lib, stdenv, runtimeShell, fetchFromGitHub, fetchpatch, ocaml, findlib, num, camlp5, camlp-streams }: +{ lib, stdenv, runtimeShell, fetchFromGitHub, fetchpatch, ocaml, findlib, num, zarith, camlp5, camlp-streams }: let + use_zarith = lib.versionAtLeast ocaml.version "4.14"; load_num = - lib.optionalString (num != null) '' + if use_zarith then '' + -I ${zarith}/lib/ocaml/${ocaml.version}/site-lib/zarith \ + -I ${zarith}/lib/ocaml/${ocaml.version}/site-lib/stublibs \ + '' else lib.optionalString (num != null) '' -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 \ @@ -22,18 +26,15 @@ let ''; in -lib.throwIf (lib.versionAtLeast ocaml.version "5.0") - "hol_light is not available for OCaml ${ocaml.version}" - stdenv.mkDerivation { pname = "hol_light"; - version = "unstable-2023-11-03"; + version = "unstable-2024-05-10"; src = fetchFromGitHub { owner = "jrh13"; repo = "hol-light"; - rev = "dcd765c6032f52a0c0bf21fce5da4794a823e880"; - hash = "sha256-k2RBNDo4tc3eobKB84Y2xr0UQJvef0hv6jyFCaDCQFM="; + rev = "d8366986e22555c4e4c8ff49667d646d15c35f14"; + hash = "sha256-dN9X7yQlFof759I5lxxL4DxDe8V3XAhCRaryO9NabY4="; }; patches = [ @@ -46,7 +47,10 @@ stdenv.mkDerivation { strictDeps = true; nativeBuildInputs = [ ocaml findlib camlp5 ]; - propagatedBuildInputs = [ camlp-streams num ]; + propagatedBuildInputs = [ + camlp-streams + (if use_zarith then zarith else num) + ]; installPhase = '' mkdir -p "$out/lib/hol_light" "$out/bin"