From 1b1f9584e587978d005ce7f170d381a04778419c Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Wed, 18 Dec 2019 04:24:00 -0500 Subject: [PATCH] dune_2: init at 2.1.0 Changelog: - https://github.com/ocaml/dune/releases/tag/2.0.0 - https://github.com/ocaml/dune/releases/tag/2.0.1 - https://github.com/ocaml/dune/releases/tag/2.1.0 --- pkgs/development/tools/ocaml/dune/2.nix | 31 +++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 +- pkgs/top-level/ocaml-packages.nix | 4 ++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/tools/ocaml/dune/2.nix diff --git a/pkgs/development/tools/ocaml/dune/2.nix b/pkgs/development/tools/ocaml/dune/2.nix new file mode 100644 index 00000000000..3260068edcd --- /dev/null +++ b/pkgs/development/tools/ocaml/dune/2.nix @@ -0,0 +1,31 @@ +{ stdenv, fetchurl, ocaml, findlib }: + +if stdenv.lib.versionOlder ocaml.version "4.07" +then throw "dune is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "dune"; + version = "2.1.0"; + + src = fetchurl { + url = "https://github.com/ocaml/dune/releases/download/${version}/dune-${version}.tbz"; + sha256 = "1hf8c0djx2v1jpjba0z096gw6qdr0igsljrf0qh0ggphg9valsmj"; + }; + + buildInputs = [ ocaml findlib ]; + + buildFlags = "release"; + + dontAddPrefix = true; + + installFlags = [ "PREFIX=${placeholder "out"}" "LIBDIR=$(OCAMLFIND_DESTDIR)" ]; + + meta = { + homepage = "https://dune.build/"; + description = "A composable build system"; + maintainers = [ stdenv.lib.maintainers.vbgl stdenv.lib.maintainers.marsam ]; + license = stdenv.lib.licenses.mit; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d71a039199c..508cd842291 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1614,7 +1614,7 @@ in dua = callPackage ../tools/misc/dua { }; - inherit (ocamlPackages) dune; + inherit (ocamlPackages) dune dune_2; duperemove = callPackage ../tools/filesystems/duperemove { }; diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index f46d953fb48..570caccc0b8 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -16,6 +16,8 @@ let buildDunePackage = callPackage ../build-support/ocaml/dune.nix {}; + buildDune2Package = buildDunePackage.override { dune = dune_2; }; + alcotest = callPackage ../development/ocaml-modules/alcotest {}; angstrom = callPackage ../development/ocaml-modules/angstrom { }; @@ -237,6 +239,8 @@ let dune = callPackage ../development/tools/ocaml/dune { }; + dune_2 = callPackage ../development/tools/ocaml/dune/2.nix { }; + earley = callPackage ../development/ocaml-modules/earley { }; earlybird = callPackage ../development/ocaml-modules/earlybird { };