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: { pname, version, buildInputs ? [], ... }@args:
let Dune = if args.useDune2 or false then dune_2 else dune; in
if args ? minimumOCamlVersion && if args ? minimumOCamlVersion &&
! stdenv.lib.versionAtLeast ocaml.version args.minimumOCamlVersion ! stdenv.lib.versionAtLeast ocaml.version args.minimumOCamlVersion
then throw "${pname}-${version} is not available for OCaml ${ocaml.version}" then throw "${pname}-${version} is not available for OCaml ${ocaml.version}"
@ -29,7 +31,7 @@ stdenv.mkDerivation ({
name = "ocaml${ocaml.version}-${pname}-${version}"; 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; }; meta = (args.meta or {}) // { platforms = args.meta.platforms or ocaml.meta.platforms; };

View File

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

View File

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

View File

@ -1,9 +1,11 @@
{ stdenv, buildDune2Package, fetchFromGitHub, ctypes, libcxx }: { stdenv, buildDunePackage, fetchFromGitHub, ctypes, libcxx }:
buildDune2Package rec { buildDunePackage rec {
pname = "eigen"; pname = "eigen";
version = "0.2.0"; version = "0.2.0";
useDune2 = true;
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "owlbarn"; owner = "owlbarn";
repo = pname; 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"; pname = "owl-base";
version = "0.8.0"; version = "0.8.0";
useDune2 = true;
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "owlbarn"; owner = "owlbarn";
repo = "owl"; repo = "owl";

View File

@ -1,5 +1,5 @@
{ stdenv { stdenv
, buildDune2Package , buildDunePackage
, dune-configurator , dune-configurator
, fetchFromGitHub , fetchFromGitHub
, alcotest , alcotest
@ -11,10 +11,10 @@
, npy , npy
}: }:
buildDune2Package rec { buildDunePackage rec {
pname = "owl"; pname = "owl";
inherit (owl-base) version src meta; inherit (owl-base) version src meta useDune2;
checkInputs = [ alcotest ]; checkInputs = [ alcotest ];
buildInputs = [ dune-configurator ]; 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 }: , alcotest, biocaml, gnuplot, lacaml, menhir, owl }:
buildDune2Package rec { buildDunePackage rec {
pname = "phylogenetics"; pname = "phylogenetics";
version = "unstable-2019-11-15"; version = "unstable-2019-11-15";
useDune2 = true;
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "biocaml"; owner = "biocaml";
repo = pname; repo = pname;

View File

@ -16,8 +16,6 @@ let
buildDunePackage = callPackage ../build-support/ocaml/dune.nix {}; buildDunePackage = callPackage ../build-support/ocaml/dune.nix {};
buildDune2Package = buildDunePackage.override { dune = dune_2; };
alcotest = callPackage ../development/ocaml-modules/alcotest {}; alcotest = callPackage ../development/ocaml-modules/alcotest {};
alcotest-lwt = callPackage ../development/ocaml-modules/alcotest/lwt.nix {}; alcotest-lwt = callPackage ../development/ocaml-modules/alcotest/lwt.nix {};
@ -232,9 +230,9 @@ let
dune_2 = callPackage ../development/tools/ocaml/dune/2.nix { }; 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 { }; earley = callPackage ../development/ocaml-modules/earley { };