diff --git a/pkgs/development/ocaml-modules/curl/default.nix b/pkgs/development/ocaml-modules/curl/default.nix new file mode 100644 index 000000000000..4750685328b7 --- /dev/null +++ b/pkgs/development/ocaml-modules/curl/default.nix @@ -0,0 +1,34 @@ +{ + buildDunePackage, + pkg-config, + dune-configurator, + fetchurl, + lib, + curl, +}: + +buildDunePackage (finalAttrs: { + pname = "curl"; + version = "0.10.0"; + minimalOCamlVersion = "4.11"; + src = fetchurl { + url = "https://github.com/ygrek/ocurl/releases/download/${finalAttrs.version}/curl-${finalAttrs.version}.tbz"; + hash = "sha256-wU4hX9p/lCkqdY2a6Q97y8IVZMkZGQBkAR/M3PehKRQ="; + }; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ + curl + ]; + + checkInputs = [ ]; + doCheck = true; + + meta = { + description = "Bindings to libcurl"; + homepage = "https://ygrek.org/p/ocurl/"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vog ]; + }; +}) diff --git a/pkgs/development/ocaml-modules/curl/lwt.nix b/pkgs/development/ocaml-modules/curl/lwt.nix new file mode 100644 index 000000000000..2bed9772d809 --- /dev/null +++ b/pkgs/development/ocaml-modules/curl/lwt.nix @@ -0,0 +1,23 @@ +{ + buildDunePackage, + curl, + lib, + lwt, +}: + +buildDunePackage (finalAttrs: { + pname = "curl_lwt"; + inherit (curl) version src; + + propagatedBuildInputs = [ + curl + lwt + ]; + + checkInputs = [ ]; + doCheck = true; + + meta = curl.meta // { + description = "Bindings to libcurl (lwt variant)"; + }; +}) diff --git a/pkgs/development/ocaml-modules/ocurl/default.nix b/pkgs/development/ocaml-modules/ocurl/default.nix index 625e59ff5bb5..aed74a0360bf 100644 --- a/pkgs/development/ocaml-modules/ocurl/default.nix +++ b/pkgs/development/ocaml-modules/ocurl/default.nix @@ -34,7 +34,7 @@ stdenv.mkDerivation rec { createFindlibDestdir = true; meta = { - description = "OCaml bindings to libcurl"; + description = "OCaml bindings to libcurl (deprecated)"; license = lib.licenses.mit; homepage = "http://ygrek.org.ua/p/ocurl/"; maintainers = with lib.maintainers; [ diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index b751fbaebd43..ccf100efe82a 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -358,6 +358,9 @@ let cudf = callPackage ../development/ocaml-modules/cudf { }; + curl = callPackage ../development/ocaml-modules/curl { inherit (pkgs) curl; }; + curl_lwt = callPackage ../development/ocaml-modules/curl/lwt.nix { }; + curly = callPackage ../development/ocaml-modules/curly { inherit (pkgs) curl; }; @@ -1606,7 +1609,7 @@ let octavius = callPackage ../development/ocaml-modules/octavius { }; - ocurl = callPackage ../development/ocaml-modules/ocurl { }; + ocurl = callPackage ../development/ocaml-modules/ocurl { inherit (pkgs) curl; }; odate = callPackage ../development/ocaml-modules/odate { };