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