1{ stdenv, lib, buildDunePackage, fetchurl, ocaml
2, result, alcotest, cohttp-lwt-unix, odoc, curl, cacert
3}:
4
5buildDunePackage rec {
6 pname = "curly";
7 version = "0.2.0";
8
9 minimalOCamlVersion = "4.02";
10
11 duneVersion = "3";
12
13 src = fetchurl {
14 url = "https://github.com/rgrinberg/curly/releases/download/${version}/curly-${version}.tbz";
15 hash = "sha256-01D1+03CqxLrPoBbNWpSKOzABJf63DhQLA1kRWdueB8=";
16 };
17
18 propagatedBuildInputs = [ result ];
19 nativeCheckInputs = [ cacert ];
20 checkInputs = [ alcotest cohttp-lwt-unix ];
21 # test dependencies are only available for >= 4.08
22 # https://github.com/mirage/ca-certs/issues/16
23 doCheck = lib.versionAtLeast ocaml.version "4.08"
24 # Some test fails in macOS sandbox
25 # > Fatal error: exception Unix.Unix_error(Unix.EPERM, "bind", "")
26 && !stdenv.isDarwin;
27
28 postPatch = ''
29 substituteInPlace src/curly.ml \
30 --replace "exe=\"curl\"" "exe=\"${curl}/bin/curl\""
31 '';
32
33 meta = with lib; {
34 description = "Curly is a brain dead wrapper around the curl command line utility";
35 homepage = "https://github.com/rgrinberg/curly";
36 license = licenses.isc;
37 maintainers = [ maintainers.sternenseemann ];
38 };
39}
40