From c4ca9ba10d66ca5479d816f60c251b5593536d97 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Wed, 20 May 2020 23:51:37 +0200 Subject: [PATCH] dune-release: init at 1.3.3 --- .../tools/ocaml/dune-release/default.nix | 48 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 +- pkgs/top-level/ocaml-packages.nix | 4 ++ 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/tools/ocaml/dune-release/default.nix diff --git a/pkgs/development/tools/ocaml/dune-release/default.nix b/pkgs/development/tools/ocaml/dune-release/default.nix new file mode 100644 index 000000000000..ba8fa4bba6fc --- /dev/null +++ b/pkgs/development/tools/ocaml/dune-release/default.nix @@ -0,0 +1,48 @@ +{ lib, buildDunePackage, fetchurl, makeWrapper +, curly, fmt, bos, cmdliner, re, rresult, logs +, odoc, opam-format, opam-core, opam-state +, opam, git, findlib, mercurial, bzip2, gnutar, coreutils +, alcotest, mdx +}: + +# don't include dune as runtime dep, so user can +# choose between dune and dune_2 +let runtimeInputs = [ opam findlib git mercurial bzip2 gnutar coreutils ]; +in buildDunePackage rec { + pname = "dune-release"; + version = "1.3.3"; + + minimumOCamlVersion = "4.06"; + + src = fetchurl { + url = "https://github.com/ocamllabs/${pname}/releases/download/${version}/${pname}-${version}.tbz"; + sha256 = "04qmgvjh1233ri878wi5kifdd1070w5pbfkd8yk3nnqnslz35zlb"; + }; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ curly fmt cmdliner re opam-format opam-state opam-core + rresult logs odoc bos ]; + checkInputs = [ alcotest mdx ]; + doCheck = true; + + useDune2 = true; + + # remove check for curl in PATH, since curly is patched + # to have a fixed path to the binary in nix store + postPatch = '' + sed -i '/must_exist (Cmd\.v "curl"/d' lib/github.ml + ''; + + # tool specific env vars have been deprecated, use PATH + preFixup = '' + wrapProgram $out/bin/dune-release \ + --prefix PATH : "${lib.makeBinPath runtimeInputs}" + ''; + + meta = with lib; { + description = "Release dune packages in opam"; + homepage = "https://github.com/ocamllabs/dune-release"; + license = licenses.isc; + maintainers = with maintainers; [ sternenseemann ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bfb93600a993..14bc46ccb9d1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1739,7 +1739,7 @@ in dua = callPackage ../tools/misc/dua { }; - inherit (ocamlPackages) dune dune_2; + inherit (ocamlPackages) dune dune_2 dune-release; duperemove = callPackage ../tools/filesystems/duperemove { }; diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 12441f44e6e1..ab14c4876a6a 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -228,6 +228,10 @@ let dune-private-libs = callPackage ../development/ocaml-modules/dune-private-libs { }; + dune-release = callPackage ../development/tools/ocaml/dune-release { + inherit (pkgs) opam git mercurial coreutils gnutar bzip2; + }; + duration = callPackage ../development/ocaml-modules/duration { }; earley = callPackage ../development/ocaml-modules/earley { };