2020-10-29 17:35:18 +00:00
|
|
|
{ stdenv, buildDunePackage, fetchurl, ocaml
|
2020-05-17 01:16:49 +01:00
|
|
|
, result, alcotest, cohttp-lwt-unix, odoc, curl }:
|
|
|
|
|
|
|
|
buildDunePackage rec {
|
|
|
|
pname = "curly";
|
2020-10-29 17:35:18 +00:00
|
|
|
version = "0.2.0";
|
2020-05-17 01:16:49 +01:00
|
|
|
|
|
|
|
minimumOCamlVersion = "4.02";
|
|
|
|
|
2020-06-25 22:22:21 +01:00
|
|
|
useDune2 = true;
|
|
|
|
|
2020-10-29 17:35:18 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/rgrinberg/curly/releases/download/${version}/curly-${version}.tbz";
|
|
|
|
sha256 = "07vqdrklar0d5i83ip7sjw2c1v18a9m3anw07vmi5ay29pxzal6k";
|
2020-05-17 01:16:49 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ result ];
|
|
|
|
checkInputs = [ alcotest cohttp-lwt-unix ];
|
2020-10-29 17:35:18 +00:00
|
|
|
# test dependencies are only available for >= 4.08
|
|
|
|
doCheck = stdenv.lib.versionAtLeast ocaml.version "4.08"
|
|
|
|
# Some test fails in macOS sandbox
|
|
|
|
# > Fatal error: exception Unix.Unix_error(Unix.EPERM, "bind", "")
|
|
|
|
&& !stdenv.isDarwin;
|
2020-05-17 01:16:49 +01:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/curly.ml \
|
|
|
|
--replace "exe=\"curl\"" "exe=\"${curl}/bin/curl\""
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
|