From 3582a974646f96da553775a5afc9f4796005c577 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Tue, 5 Dec 2017 18:16:19 +0000 Subject: [PATCH] ocamlPackages.faraday: init at 0.5.0 Faraday is a library for writing fast and memory-efficient serializers in OCaml. Homepage: https://github.com/inhabitedtype/faraday --- .../ocaml-modules/faraday/default.nix | 34 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 pkgs/development/ocaml-modules/faraday/default.nix diff --git a/pkgs/development/ocaml-modules/faraday/default.nix b/pkgs/development/ocaml-modules/faraday/default.nix new file mode 100644 index 000000000000..8f30ec519777 --- /dev/null +++ b/pkgs/development/ocaml-modules/faraday/default.nix @@ -0,0 +1,34 @@ +{ stdenv, fetchFromGitHub, ocaml, findlib, jbuilder, alcotest }: + +if !stdenv.lib.versionAtLeast ocaml.version "4.02" +then throw "faraday is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + name = "ocaml${ocaml.version}-faraday-${version}"; + version = "0.5.0"; + + src = fetchFromGitHub { + owner = "inhabitedtype"; + repo = "faraday"; + rev = version; + sha256 = "1kql0il1frsbx6rvwqd7ahi4m14ik6la5an6c2w4x7k00ndm4d7n"; + }; + + buildInputs = [ ocaml findlib jbuilder alcotest ]; + + buildPhase = "jbuilder build -p faraday"; + + doCheck = true; + checkPhase = "jbuilder runtest"; + + inherit (jbuilder) installPhase; + + meta = { + description = "Serialization library built for speed and memory efficiency"; + license = stdenv.lib.licenses.bsd3; + maintainers = [ stdenv.lib.maintainers.vbgl ]; + inherit (src.meta) homepage; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 5bc0398e90df..b83e77627efb 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -231,6 +231,8 @@ let faillib = callPackage ../development/ocaml-modules/faillib { }; + faraday = callPackage ../development/ocaml-modules/faraday { }; + fieldslib_p4 = callPackage ../development/ocaml-modules/fieldslib { }; fileutils = callPackage ../development/ocaml-modules/fileutils { };