buildDunePackage: add a “useDune2” option

This commit is contained in:
Vincent Laporte 2020-03-15 18:14:11 +01:00 committed by Vincent Laporte
parent 3c4c703368
commit 0229936bbe
8 changed files with 25 additions and 15 deletions

View file

@ -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; };

View file

@ -3,6 +3,8 @@
buildDunePackage rec {
pname = "dune-configurator";
useDune2 = true;
inherit (dune_2) src version;
dontAddPrefix = true;

View file

@ -3,6 +3,8 @@
buildDunePackage rec {
pname = "dune-private-libs";
useDune2 = true;
inherit (dune_2) src version;
dontAddPrefix = true;

View file

@ -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;

View file

@ -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";

View file

@ -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 ];

View file

@ -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;

View file

@ -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 { };