2021-01-11 13:49:15 +01:00
|
|
|
{ stdenv, lib, buildDunePackage, fetchurl, ocaml
|
2021-05-11 06:54:15 +02:00
|
|
|
, result, alcotest, cohttp-lwt-unix, odoc, curl, cacert
|
|
|
|
}:
|
2020-05-17 02:16:49 +02:00
|
|
|
|
|
|
|
buildDunePackage rec {
|
|
|
|
pname = "curly";
|
2020-10-29 18:35:18 +01:00
|
|
|
version = "0.2.0";
|
2020-05-17 02:16:49 +02:00
|
|
|
|
|
|
|
minimumOCamlVersion = "4.02";
|
|
|
|
|
2020-06-25 23:22:21 +02:00
|
|
|
useDune2 = true;
|
|
|
|
|
2020-10-29 18:35:18 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/rgrinberg/curly/releases/download/${version}/curly-${version}.tbz";
|
|
|
|
sha256 = "07vqdrklar0d5i83ip7sjw2c1v18a9m3anw07vmi5ay29pxzal6k";
|
2020-05-17 02:16:49 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ result ];
|
2021-05-11 06:54:15 +02:00
|
|
|
checkInputs = [ alcotest cohttp-lwt-unix cacert ];
|
2020-10-29 18:35:18 +01:00
|
|
|
# test dependencies are only available for >= 4.08
|
2021-05-11 06:54:15 +02:00
|
|
|
# https://github.com/mirage/ca-certs/issues/16
|
2021-01-11 13:49:15 +01:00
|
|
|
doCheck = lib.versionAtLeast ocaml.version "4.08"
|
2020-10-29 18:35:18 +01:00
|
|
|
# Some test fails in macOS sandbox
|
|
|
|
# > Fatal error: exception Unix.Unix_error(Unix.EPERM, "bind", "")
|
|
|
|
&& !stdenv.isDarwin;
|
2020-05-17 02:16:49 +02:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/curly.ml \
|
|
|
|
--replace "exe=\"curl\"" "exe=\"${curl}/bin/curl\""
|
|
|
|
'';
|
2021-01-20 17:28:59 +01:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Curly is a brain dead wrapper around the curl command line utility";
|
|
|
|
homepage = "https://github.com/rgrinberg/curly";
|
|
|
|
license = licenses.isc;
|
|
|
|
maintainers = [ maintainers.sternenseemann ];
|
|
|
|
};
|
2020-05-17 02:16:49 +02:00
|
|
|
}
|
|
|
|
|