From 0229936bbe241f4686747d22919af0aac0dbb078 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sun, 15 Mar 2020 18:14:11 +0100 Subject: [PATCH] =?UTF-8?q?buildDunePackage:=20add=20a=20=E2=80=9CuseDune2?= =?UTF-8?q?=E2=80=9D=20option?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/build-support/ocaml/dune.nix | 6 ++++-- .../development/ocaml-modules/dune-configurator/default.nix | 2 ++ .../development/ocaml-modules/dune-private-libs/default.nix | 2 ++ pkgs/development/ocaml-modules/eigen/default.nix | 6 ++++-- pkgs/development/ocaml-modules/owl-base/default.nix | 6 ++++-- pkgs/development/ocaml-modules/owl/default.nix | 6 +++--- pkgs/development/ocaml-modules/phylogenetics/default.nix | 6 ++++-- pkgs/top-level/ocaml-packages.nix | 6 ++---- 8 files changed, 25 insertions(+), 15 deletions(-) diff --git a/pkgs/build-support/ocaml/dune.nix b/pkgs/build-support/ocaml/dune.nix index a0aac1447969..435bbe89c1c4 100644 --- a/pkgs/build-support/ocaml/dune.nix +++ b/pkgs/build-support/ocaml/dune.nix @@ -1,7 +1,9 @@ -{ stdenv, ocaml, findlib, dune, opaline }: +{ stdenv, ocaml, findlib, dune, dune_2, opaline }: { pname, version, buildInputs ? [], ... }@args: +let Dune = if args.useDune2 or false then dune_2 else dune; in + if args ? minimumOCamlVersion && ! stdenv.lib.versionAtLeast ocaml.version args.minimumOCamlVersion then throw "${pname}-${version} is not available for OCaml ${ocaml.version}" @@ -29,7 +31,7 @@ stdenv.mkDerivation ({ name = "ocaml${ocaml.version}-${pname}-${version}"; - buildInputs = [ ocaml dune findlib ] ++ buildInputs; + buildInputs = [ ocaml Dune findlib ] ++ buildInputs; meta = (args.meta or {}) // { platforms = args.meta.platforms or ocaml.meta.platforms; }; diff --git a/pkgs/development/ocaml-modules/dune-configurator/default.nix b/pkgs/development/ocaml-modules/dune-configurator/default.nix index d84c21565db8..aa12ebc8d796 100644 --- a/pkgs/development/ocaml-modules/dune-configurator/default.nix +++ b/pkgs/development/ocaml-modules/dune-configurator/default.nix @@ -3,6 +3,8 @@ buildDunePackage rec { pname = "dune-configurator"; + useDune2 = true; + inherit (dune_2) src version; dontAddPrefix = true; diff --git a/pkgs/development/ocaml-modules/dune-private-libs/default.nix b/pkgs/development/ocaml-modules/dune-private-libs/default.nix index 1c3503f11a15..14059070c9a0 100644 --- a/pkgs/development/ocaml-modules/dune-private-libs/default.nix +++ b/pkgs/development/ocaml-modules/dune-private-libs/default.nix @@ -3,6 +3,8 @@ buildDunePackage rec { pname = "dune-private-libs"; + useDune2 = true; + inherit (dune_2) src version; dontAddPrefix = true; diff --git a/pkgs/development/ocaml-modules/eigen/default.nix b/pkgs/development/ocaml-modules/eigen/default.nix index 3922b5cfec75..dacd3a758623 100644 --- a/pkgs/development/ocaml-modules/eigen/default.nix +++ b/pkgs/development/ocaml-modules/eigen/default.nix @@ -1,9 +1,11 @@ -{ stdenv, buildDune2Package, fetchFromGitHub, ctypes, libcxx }: +{ stdenv, buildDunePackage, fetchFromGitHub, ctypes, libcxx }: -buildDune2Package rec { +buildDunePackage rec { pname = "eigen"; version = "0.2.0"; + useDune2 = true; + src = fetchFromGitHub { owner = "owlbarn"; repo = pname; diff --git a/pkgs/development/ocaml-modules/owl-base/default.nix b/pkgs/development/ocaml-modules/owl-base/default.nix index ce6ee124466c..9d2bf74a3ace 100644 --- a/pkgs/development/ocaml-modules/owl-base/default.nix +++ b/pkgs/development/ocaml-modules/owl-base/default.nix @@ -1,9 +1,11 @@ -{ stdenv, buildDune2Package, fetchFromGitHub, stdlib-shims }: +{ stdenv, buildDunePackage, fetchFromGitHub, stdlib-shims }: -buildDune2Package rec { +buildDunePackage rec { pname = "owl-base"; version = "0.8.0"; + useDune2 = true; + src = fetchFromGitHub { owner = "owlbarn"; repo = "owl"; diff --git a/pkgs/development/ocaml-modules/owl/default.nix b/pkgs/development/ocaml-modules/owl/default.nix index c6eaf69b704b..7fa912d808db 100644 --- a/pkgs/development/ocaml-modules/owl/default.nix +++ b/pkgs/development/ocaml-modules/owl/default.nix @@ -1,5 +1,5 @@ { stdenv -, buildDune2Package +, buildDunePackage , dune-configurator , fetchFromGitHub , alcotest @@ -11,10 +11,10 @@ , npy }: -buildDune2Package rec { +buildDunePackage rec { pname = "owl"; - inherit (owl-base) version src meta; + inherit (owl-base) version src meta useDune2; checkInputs = [ alcotest ]; buildInputs = [ dune-configurator ]; diff --git a/pkgs/development/ocaml-modules/phylogenetics/default.nix b/pkgs/development/ocaml-modules/phylogenetics/default.nix index 049a9a97c8e2..87e88cbf496e 100644 --- a/pkgs/development/ocaml-modules/phylogenetics/default.nix +++ b/pkgs/development/ocaml-modules/phylogenetics/default.nix @@ -1,10 +1,12 @@ -{ stdenv, buildDune2Package, fetchFromGitHub, ppx_deriving +{ stdenv, buildDunePackage, fetchFromGitHub, ppx_deriving , alcotest, biocaml, gnuplot, lacaml, menhir, owl }: -buildDune2Package rec { +buildDunePackage rec { pname = "phylogenetics"; version = "unstable-2019-11-15"; + useDune2 = true; + src = fetchFromGitHub { owner = "biocaml"; repo = pname; diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index e8a6bc21035b..485dfa7d807e 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -16,8 +16,6 @@ let buildDunePackage = callPackage ../build-support/ocaml/dune.nix {}; - buildDune2Package = buildDunePackage.override { dune = dune_2; }; - alcotest = callPackage ../development/ocaml-modules/alcotest {}; alcotest-lwt = callPackage ../development/ocaml-modules/alcotest/lwt.nix {}; @@ -232,9 +230,9 @@ let dune_2 = callPackage ../development/tools/ocaml/dune/2.nix { }; - dune-configurator = callPackage ../development/ocaml-modules/dune-configurator { buildDunePackage = buildDune2Package; }; + dune-configurator = callPackage ../development/ocaml-modules/dune-configurator { }; - dune-private-libs = callPackage ../development/ocaml-modules/dune-private-libs { buildDunePackage = buildDune2Package; }; + dune-private-libs = callPackage ../development/ocaml-modules/dune-private-libs { }; earley = callPackage ../development/ocaml-modules/earley { };