diff options
Diffstat (limited to 'pkgs/development/ocaml-modules')
-rw-r--r-- | pkgs/development/ocaml-modules/hmap/default.nix | 41 | ||||
-rw-r--r-- | pkgs/development/ocaml-modules/opium/default.nix | 30 | ||||
-rw-r--r-- | pkgs/development/ocaml-modules/opium_kernel/default.nix | 42 |
3 files changed, 113 insertions, 0 deletions
diff --git a/pkgs/development/ocaml-modules/hmap/default.nix b/pkgs/development/ocaml-modules/hmap/default.nix new file mode 100644 index 000000000000..563d39909c8c --- /dev/null +++ b/pkgs/development/ocaml-modules/hmap/default.nix @@ -0,0 +1,41 @@ +{ stdenv +, lib +, fetchurl +, findlib +, ocaml +, ocamlbuild +, topkg +}: + +let + minimumSupportedOcamlVersion = "4.02.0"; +in +assert lib.versionOlder minimumSupportedOcamlVersion ocaml.version; + +stdenv.mkDerivation rec { + pname = "hmap"; + version = "0.8.1"; + name = "ocaml${ocaml.version}-${pname}-${version}"; + + src = fetchurl { + url = "http://erratique.ch/software/hmap/releases/${pname}-${version}.tbz"; + sha256 = "10xyjy4ab87z7jnghy0wnla9wrmazgyhdwhr4hdmxxdn28dxn03a"; + }; + + buildInputs = [ ocaml ocamlbuild findlib topkg ]; + + inherit (topkg) installPhase; + + buildPhase = "${topkg.run} build --tests true"; + + doCheck = true; + + checkPhase = "${topkg.run} test"; + + meta = { + description = "Heterogeneous value maps for OCaml"; + homepage = "https://erratique.ch/software/hmap"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.pmahoney ]; + }; +} diff --git a/pkgs/development/ocaml-modules/opium/default.nix b/pkgs/development/ocaml-modules/opium/default.nix new file mode 100644 index 000000000000..06784b445e3b --- /dev/null +++ b/pkgs/development/ocaml-modules/opium/default.nix @@ -0,0 +1,30 @@ +{ buildDunePackage + +, ppx_sexp_conv +, ppx_fields_conv + +, cmdliner +, cohttp-lwt-unix +, logs +, magic-mime +, opium_kernel +, stringext + +, alcotest +}: + +buildDunePackage rec { + pname = "opium"; + inherit (opium_kernel) version src meta minimumOCamlVersion; + + doCheck = true; + + buildInputs = [ + ppx_sexp_conv ppx_fields_conv + alcotest + ]; + + propagatedBuildInputs = [ + opium_kernel cmdliner cohttp-lwt-unix magic-mime logs stringext + ]; +} diff --git a/pkgs/development/ocaml-modules/opium_kernel/default.nix b/pkgs/development/ocaml-modules/opium_kernel/default.nix new file mode 100644 index 000000000000..8388e108feff --- /dev/null +++ b/pkgs/development/ocaml-modules/opium_kernel/default.nix @@ -0,0 +1,42 @@ +{ lib +, buildDunePackage +, fetchFromGitHub + +, ppx_fields_conv +, ppx_sexp_conv + +, cohttp-lwt +, ezjsonm +, hmap +}: + +buildDunePackage rec { + pname = "opium_kernel"; + version = "0.17.1"; + + minimumOCamlVersion = "4.04.1"; + + src = fetchFromGitHub { + owner = "rgrinberg"; + repo = "opium"; + rev = "v${version}"; + sha256 = "03xzh0ik6k3c0yn1w1avph667vdagwclzimwwrlf9qdxnzxvcnp3"; + }; + + doCheck = true; + + buildInputs = [ + ppx_sexp_conv ppx_fields_conv + ]; + + propagatedBuildInputs = [ + hmap cohttp-lwt ezjsonm + ]; + + meta = { + description = "Sinatra like web toolkit for OCaml based on cohttp & lwt"; + homepage = "https://github.com/rgrinberg/opium"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.pmahoney ]; + }; +} |