From e481df83b1c1df52b6c5d4df7808cd8b9286f239 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Wed, 14 Nov 2018 07:25:54 +0000 Subject: [PATCH] ocamlPackages.camlp5: 7.06 -> 7.07 Keeping the legacy (7.06) version around, needed by hol_light --- .../tools/ocaml/camlp5/default.nix | 24 ++++++++++++------- pkgs/top-level/ocaml-packages.nix | 4 +++- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/pkgs/development/tools/ocaml/camlp5/default.nix b/pkgs/development/tools/ocaml/camlp5/default.nix index da88a09d771..ca053138d80 100644 --- a/pkgs/development/tools/ocaml/camlp5/default.nix +++ b/pkgs/development/tools/ocaml/camlp5/default.nix @@ -1,21 +1,29 @@ -{ stdenv, fetchzip, ocaml, transitional ? false }: +{ stdenv, fetchzip, ocaml, legacy ? false }: -let +let params = + if legacy then { + minor-version = "06"; + sha256 = "02zg6qjkzx58zmp79364s5jyqhh56nclcz1jzhh53hk37g9f96qf"; + } else { + minor-version = "07"; + sha256 = "1c8v45553ccbqha2ypfranqlgw06rr5wjr2hlnrx5bf9jfq0h0dn"; + }; metafile = ./META; + opt = stdenv.lib.optionalString legacy; in stdenv.mkDerivation { - name = "camlp5${if transitional then "_transitional" else ""}-7.06"; + name = "camlp5-7.${params.minor-version}"; src = fetchzip { - url = https://github.com/camlp5/camlp5/archive/rel706.tar.gz; - sha256 = "02zg6qjkzx58zmp79364s5jyqhh56nclcz1jzhh53hk37g9f96qf"; + url = "https://github.com/camlp5/camlp5/archive/rel7${params.minor-version}.tar.gz"; + inherit (params) sha256; }; buildInputs = [ ocaml ]; - postPatch = '' + postPatch = opt '' for p in compile/compile.sh config/Makefile.tpl test/Makefile test/check_ocaml_versions.sh do substituteInPlace $p --replace '/bin/rm' rm @@ -24,12 +32,12 @@ stdenv.mkDerivation { prefixKey = "-prefix "; - preConfigure = "configureFlagsArray=(" + (if transitional then "--transitional" else "--strict") + + preConfigure = "configureFlagsArray=(--strict" + " --libdir $out/lib/ocaml/${ocaml.version}/site-lib)"; buildFlags = "world.opt"; - postInstall = "cp ${metafile} $out/lib/ocaml/${ocaml.version}/site-lib/camlp5/META"; + postInstall = opt "cp ${metafile} $out/lib/ocaml/${ocaml.version}/site-lib/camlp5/META"; dontStrip = true; diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 1d0c1491436..cf06b52c5ba 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -1039,7 +1039,9 @@ let enableX11 = config.unison.enableX11 or true; }; - hol_light = callPackage ../applications/science/logic/hol_light { }; + hol_light = callPackage ../applications/science/logic/hol_light { + camlp5 = callPackage ../development/tools/ocaml/camlp5 { legacy = true; }; + }; }; in (ocamlPackages.janeStreet // ocamlPackages);