From f2eeeb83f23a6de883fb376f3bd75497feff659c Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 6 Apr 2020 08:39:01 +0200 Subject: [PATCH] =?UTF-8?q?coqPackages.dpdgraph:=20fix=20build=20with=20OC?= =?UTF-8?q?aml=20=E2=89=A5=204.08?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/development/coq-modules/dpdgraph/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/development/coq-modules/dpdgraph/default.nix b/pkgs/development/coq-modules/dpdgraph/default.nix index 9e63e7766f0..689745003df 100644 --- a/pkgs/development/coq-modules/dpdgraph/default.nix +++ b/pkgs/development/coq-modules/dpdgraph/default.nix @@ -36,6 +36,8 @@ let params = { param = params.${coq.coq-version}; in +let hasWarning = stdenv.lib.versionAtLeast coq.ocamlPackages.ocaml.version "4.08"; in + stdenv.mkDerivation { name = "coq${coq.coq-version}-dpdgraph-${param.version}"; src = fetchFromGitHub { @@ -49,6 +51,14 @@ stdenv.mkDerivation { buildInputs = [ coq ] ++ (with coq.ocamlPackages; [ ocaml camlp5 findlib ocamlgraph ]); + # dpd_compute.ml uses deprecated Pervasives.compare + # Versions prior to 0.6.5 do not have the WARN_ERR build flag + preConfigure = stdenv.lib.optionalString hasWarning '' + substituteInPlace Makefile.in --replace "-warn-error +a " "" + ''; + + buildFlags = stdenv.lib.optional hasWarning "WARN_ERR="; + preInstall = '' mkdir -p $out/bin '';