2021-01-15 22:18:51 +00:00
|
|
|
{ stdenv, lib, buildDunePackage, fetchurl, ocaml
|
2024-07-27 06:49:29 +00:00
|
|
|
, result, alcotest, cohttp-lwt-unix, curl, cacert
|
2021-05-20 23:08:51 +00:00
|
|
|
}:
|
2020-05-29 06:06:01 +00:00
|
|
|
|
|
|
|
buildDunePackage rec {
|
|
|
|
pname = "curly";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.3.0";
|
2020-05-29 06:06:01 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
minimalOCamlVersion = "4.03";
|
2020-05-29 06:06:01 +00:00
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
duneVersion = "3";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/rgrinberg/curly/releases/download/${version}/curly-${version}.tbz";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-Qn/PKBNOcMt3dk2f7uJD8x0yo4RHobXSjTQck7fcXTw=";
|
2020-05-29 06:06:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ result ];
|
2023-02-09 11:40:11 +00:00
|
|
|
nativeCheckInputs = [ cacert ];
|
|
|
|
checkInputs = [ alcotest cohttp-lwt-unix ];
|
2020-11-03 02:18:15 +00:00
|
|
|
# test dependencies are only available for >= 4.08
|
2021-05-20 23:08:51 +00:00
|
|
|
# https://github.com/mirage/ca-certs/issues/16
|
2021-01-15 22:18:51 +00:00
|
|
|
doCheck = lib.versionAtLeast ocaml.version "4.08"
|
2020-11-03 02:18:15 +00:00
|
|
|
# Some test fails in macOS sandbox
|
|
|
|
# > Fatal error: exception Unix.Unix_error(Unix.EPERM, "bind", "")
|
|
|
|
&& !stdenv.isDarwin;
|
2020-05-29 06:06:01 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/curly.ml \
|
|
|
|
--replace "exe=\"curl\"" "exe=\"${curl}/bin/curl\""
|
|
|
|
'';
|
2021-02-05 17:12:51 +00: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-29 06:06:01 +00:00
|
|
|
}
|
|
|
|
|