Files
nixpkgs/pkgs/development/ocaml-modules/curly/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

53 lines
1.2 KiB
Nix

{
stdenv,
lib,
buildDunePackage,
fetchurl,
ocaml,
result,
alcotest,
cohttp-lwt-unix,
curl,
cacert,
}:
buildDunePackage rec {
pname = "curly";
version = "0.3.0";
minimalOCamlVersion = "4.03";
duneVersion = "3";
src = fetchurl {
url = "https://github.com/rgrinberg/curly/releases/download/${version}/curly-${version}.tbz";
hash = "sha256-Qn/PKBNOcMt3dk2f7uJD8x0yo4RHobXSjTQck7fcXTw=";
};
propagatedBuildInputs = [ result ];
nativeCheckInputs = [ cacert ];
checkInputs = [
alcotest
cohttp-lwt-unix
];
# test dependencies are only available for >= 4.08
# https://github.com/mirage/ca-certs/issues/16
doCheck =
lib.versionAtLeast ocaml.version "4.08"
# Some test fails in macOS sandbox
# > Fatal error: exception Unix.Unix_error(Unix.EPERM, "bind", "")
&& !stdenv.hostPlatform.isDarwin;
postPatch = ''
substituteInPlace src/curly.ml \
--replace "exe=\"curl\"" "exe=\"${curl}/bin/curl\""
'';
meta = {
description = "Curly is a brain dead wrapper around the curl command line utility";
homepage = "https://github.com/rgrinberg/curly";
license = lib.licenses.isc;
maintainers = [ lib.maintainers.sternenseemann ];
};
}