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