diff --git a/pkgs/development/ocaml-modules/gitlab/default.nix b/pkgs/development/ocaml-modules/gitlab/default.nix new file mode 100644 index 000000000000..f8bc6224cf70 --- /dev/null +++ b/pkgs/development/ocaml-modules/gitlab/default.nix @@ -0,0 +1,47 @@ +{ + lib, + buildDunePackage, + fetchFromGitHub, + uri, + cohttp-lwt, + atdgen, + yojson, + iso8601, + stringext, +}: + +buildDunePackage rec { + pname = "gitlab"; + version = "0.1.8"; + + src = fetchFromGitHub { + owner = "tmcgilchrist"; + repo = "ocaml-gitlab"; + rev = version; + hash = "sha256-7pUpH1SoP4eW8ild5j+Tcy+aTXq0+eSkhKUOXJ6Z30k="; + }; + + minimalOCamlVersion = "4.08"; + + buildInputs = [ stringext ]; + + nativeBuildInputs = [ atdgen ]; + + propagatedBuildInputs = [ + uri + cohttp-lwt + atdgen + yojson + iso8601 + ]; + + doCheck = true; + + meta = with lib; { + homepage = "https://github.com/tmcgilchrist/ocaml-gitlab"; + description = "Native OCaml bindings to Gitlab REST API v4"; + license = licenses.bsd3; + changelog = "https://github.com/tmcgilchrist/ocaml-gitlab/releases/tag/${version}"; + maintainers = with maintainers; [ zazedd ]; + }; +} diff --git a/pkgs/development/ocaml-modules/gitlab/jsoo.nix b/pkgs/development/ocaml-modules/gitlab/jsoo.nix new file mode 100644 index 000000000000..60929f60b3b2 --- /dev/null +++ b/pkgs/development/ocaml-modules/gitlab/jsoo.nix @@ -0,0 +1,28 @@ +{ + lib, + buildDunePackage, + gitlab, + cohttp, + cohttp-lwt-jsoo, + js_of_ocaml-lwt, +}: + +buildDunePackage { + pname = "gitlab-jsoo"; + inherit (gitlab) version src; + + minimalOCamlVersion = "4.08"; + + propagatedBuildInputs = [ + gitlab + cohttp + cohttp-lwt-jsoo + js_of_ocaml-lwt + ]; + + doCheck = true; + + meta = gitlab.meta // { + description = "Gitlab APIv4 JavaScript library"; + }; +} diff --git a/pkgs/development/ocaml-modules/gitlab/unix.nix b/pkgs/development/ocaml-modules/gitlab/unix.nix new file mode 100644 index 000000000000..b914e67b54c9 --- /dev/null +++ b/pkgs/development/ocaml-modules/gitlab/unix.nix @@ -0,0 +1,44 @@ +{ + lib, + buildDunePackage, + gitlab, + cmdliner, + cohttp, + cohttp-lwt-unix, + tls, + lwt, + stringext, + alcotest, +}: + +buildDunePackage { + pname = "gitlab-unix"; + inherit (gitlab) version src; + + minimalOCamlVersion = "4.08"; + + postPatch = '' + substituteInPlace unix/dune --replace-fail "gitlab bytes" "gitlab" + ''; + + buildInputs = [ + cohttp + tls + stringext + ]; + + propagatedBuildInputs = [ + gitlab + cmdliner + cohttp-lwt-unix + lwt + ]; + + checkInputs = [ alcotest ]; + + doCheck = true; + + meta = gitlab.meta // { + description = "Gitlab APIv4 Unix library"; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index fe284a62718d..e996cb41cf0c 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -610,6 +610,10 @@ let github-jsoo = callPackage ../development/ocaml-modules/github/jsoo.nix { }; github-unix = callPackage ../development/ocaml-modules/github/unix.nix { }; + gitlab = callPackage ../development/ocaml-modules/gitlab { }; + gitlab-jsoo = callPackage ../development/ocaml-modules/gitlab/jsoo.nix { }; + gitlab-unix = callPackage ../development/ocaml-modules/gitlab/unix.nix { }; + gluon = callPackage ../development/ocaml-modules/gluon { }; gluten = callPackage ../development/ocaml-modules/gluten { };