From fd0b06056033fd45dd40edd71173afdd082fc692 Mon Sep 17 00:00:00 2001 From: "Aaron L. Zeng" Date: Mon, 28 Mar 2022 02:02:57 -0400 Subject: [PATCH] ocamlPackages.gen_js_api: init at 1.0.9 I chose 1.0.9 instead of the latest 1.1.0, to avoid having to upgrade js_of_ocaml first. --- .../ocaml-modules/gen_js_api/default.nix | 41 +++++++++++++++++++ .../ocaml-modules/gen_js_api/ojs.nix | 21 ++++++++++ pkgs/top-level/ocaml-packages.nix | 4 ++ 3 files changed, 66 insertions(+) create mode 100644 pkgs/development/ocaml-modules/gen_js_api/default.nix create mode 100644 pkgs/development/ocaml-modules/gen_js_api/ojs.nix diff --git a/pkgs/development/ocaml-modules/gen_js_api/default.nix b/pkgs/development/ocaml-modules/gen_js_api/default.nix new file mode 100644 index 00000000000..e0474cdac6a --- /dev/null +++ b/pkgs/development/ocaml-modules/gen_js_api/default.nix @@ -0,0 +1,41 @@ +{ buildDunePackage +, lib +, ppxlib +, fetchFromGitHub +, ojs +, js_of_ocaml-compiler +, nodejs +}: + +buildDunePackage rec { + pname = "gen_js_api"; + version = "1.0.9"; + + src = fetchFromGitHub { + owner = "LexiFi"; + repo = pname; + rev = "v${version}"; + sha256 = "1qx6if1avr484bl9x1h0cksdc6gqw5i4pwzdr27h46hppnnvi8y8"; + }; + + minimalOCamlVersion = "4.08"; + + propagatedBuildInputs = [ ojs ppxlib ]; + checkInputs = [ js_of_ocaml-compiler nodejs ]; + doCheck = true; + + meta = { + homepage = "https://github.com/LexiFi/gen_js_api"; + description = "Easy OCaml bindings for JavaScript libraries"; + longDescription = '' + gen_js_api aims at simplifying the creation of OCaml bindings for + JavaScript libraries. Authors of bindings write OCaml signatures for + JavaScript libraries and the tool generates the actual binding code with a + combination of implicit conventions and explicit annotations. + + gen_js_api is to be used with the js_of_ocaml compiler. + ''; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.bcc32 ]; + }; +} diff --git a/pkgs/development/ocaml-modules/gen_js_api/ojs.nix b/pkgs/development/ocaml-modules/gen_js_api/ojs.nix new file mode 100644 index 00000000000..722f9fa7f6e --- /dev/null +++ b/pkgs/development/ocaml-modules/gen_js_api/ojs.nix @@ -0,0 +1,21 @@ +{ buildDunePackage +, gen_js_api +}: + +buildDunePackage rec { + pname = "ojs"; + + inherit (gen_js_api) version src; + + doCheck = false; # checks depend on gen_js_api, which is a cycle + + minimalOCamlVersion = "4.08"; + + meta = { + inherit (gen_js_api.meta) homepage license maintainers; + description = "Runtime Library for gen_js_api generated libraries"; + longDescription = '' + To be used in conjunction with gen_js_api + ''; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index d031542ff86..9f3b728ce6e 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -510,6 +510,8 @@ let gapi_ocaml = callPackage ../development/ocaml-modules/gapi-ocaml { }; + gen_js_api = callPackage ../development/ocaml-modules/gen_js_api { }; + gg = callPackage ../development/ocaml-modules/gg { }; git = callPackage ../development/ocaml-modules/git { @@ -1000,6 +1002,8 @@ let odoc-parser = callPackage ../development/ocaml-modules/odoc-parser { }; + ojs = callPackage ../development/ocaml-modules/gen_js_api/ojs.nix { }; + omd = callPackage ../development/ocaml-modules/omd { }; opam-core = callPackage ../development/ocaml-modules/opam-core {