lol
1{ lib, buildDunePackage, fetchurl, makeWrapper, fetchpatch
2, curly, fmt, bos, cmdliner, re, rresult, logs, fpath
3, odoc, opam-format, opam-core, opam-state, yojson, astring
4, opam, git, findlib, mercurial, bzip2, gnutar, coreutils
5, alcotest
6}:
7
8# don't include dune as runtime dep, so user can
9# choose between dune and dune_2
10let runtimeInputs = [ opam findlib git mercurial bzip2 gnutar coreutils ];
11in buildDunePackage rec {
12 pname = "dune-release";
13 version = "2.0.0";
14 duneVersion = "3";
15
16 minimalOCamlVersion = "4.06";
17
18 src = fetchurl {
19 url = "https://github.com/ocamllabs/${pname}/releases/download/${version}/${pname}-${version}.tbz";
20 hash = "sha256-u8TgaoeDaDLenu3s1Km/Kh85WHMtvUy7C7Q+OY588Ss=";
21 };
22
23 nativeBuildInputs = [ makeWrapper ] ++ runtimeInputs;
24 buildInputs = [ curly fmt cmdliner re opam-format opam-state opam-core
25 rresult logs odoc bos yojson astring fpath ];
26 nativeCheckInputs = [ odoc ];
27 checkInputs = [ alcotest ] ++ runtimeInputs;
28 doCheck = true;
29
30 postPatch = ''
31 # remove check for curl in PATH, since curly is patched
32 # to have a fixed path to the binary in nix store
33 sed -i '/must_exist (Cmd\.v "curl"/d' lib/github.ml
34 '';
35
36 preCheck = ''
37 export HOME=$TMPDIR
38 git config --global user.email "nix-builder@nixos.org"
39 git config --global user.name "Nix Builder"
40
41 # it fails when it tries to reference "./make_check_deterministic.exe"
42 rm -r tests/bin/check
43 '';
44
45 # tool specific env vars have been deprecated, use PATH
46 preFixup = ''
47 wrapProgram $out/bin/dune-release \
48 --prefix PATH : "${lib.makeBinPath runtimeInputs}"
49 '';
50
51 meta = with lib; {
52 description = "Release dune packages in opam";
53 homepage = "https://github.com/ocamllabs/dune-release";
54 changelog = "https://github.com/tarides/dune-release/blob/${version}/CHANGES.md";
55 license = licenses.isc;
56 maintainers = with maintainers; [ sternenseemann ];
57 };
58}