nixpkgs/pkgs/development/tools/ocaml/dune-release/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.7 KiB
Nix
Raw Normal View History

{ lib, buildDunePackage, fetchurl, makeWrapper, fetchpatch
, curly, fmt, bos, cmdliner, re, rresult, logs, fpath
, odoc, opam-format, opam-core, opam-state, yojson, astring
2020-05-20 21:51:37 +00:00
, opam, git, findlib, mercurial, bzip2, gnutar, coreutils
, alcotest
2020-05-20 21:51:37 +00:00
}:
# 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.6.2";
2023-01-09 09:34:08 +00:00
duneVersion = "3";
2020-05-20 21:51:37 +00:00
minimalOCamlVersion = "4.06";
2020-05-20 21:51:37 +00:00
src = fetchurl {
url = "https://github.com/ocamllabs/${pname}/releases/download/${version}/${pname}-${version}.tbz";
sha256 = "sha256-oJ5SL7qNM5izoEpr+nTjbT+YmmNIoy7QgSNse3wNIA4=";
2020-05-20 21:51:37 +00:00
};
nativeBuildInputs = [ makeWrapper ] ++ runtimeInputs;
2020-05-20 21:51:37 +00:00
buildInputs = [ curly fmt cmdliner re opam-format opam-state opam-core
rresult logs odoc bos yojson astring fpath ];
nativeCheckInputs = [ odoc ];
checkInputs = [ alcotest ] ++ runtimeInputs;
2020-05-20 21:51:37 +00:00
doCheck = true;
postPatch = ''
2020-07-15 08:33:27 +00:00
# remove check for curl in PATH, since curly is patched
# to have a fixed path to the binary in nix store
2020-05-20 21:51:37 +00:00
sed -i '/must_exist (Cmd\.v "curl"/d' lib/github.ml
'';
preCheck = ''
# it fails when it tries to reference "./make_check_deterministic.exe"
2021-08-02 07:32:30 +00:00
rm -r tests/bin/check
'';
2020-05-20 21:51:37 +00:00
# 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 ];
};
}