git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #8291 from maurer/misc-ocaml

Add miscellaneous OCaml Packages

commit742824bd78cce63870ce89d2cf4b3f8b018c4052 authorvbgl <vbgl@users.noreply.github.com> dateSat 27 Jun 2015, 18:52 (11 years ago) parente4d16dc9c0f1ee
12 files changed+335
lib/maintainers.nix+1 pkgs/development/ocaml-modules/bitstring/2.0.4.nix+25 pkgs/development/ocaml-modules/bitstring/camlp4-git.patch+44 pkgs/development/ocaml-modules/bitstring/camlp4.patch+84 pkgs/development/ocaml-modules/bitstring/default.nix+28 pkgs/development/ocaml-modules/bitstring/meta.patch+15 pkgs/development/ocaml-modules/faillib/default.nix+24 pkgs/development/ocaml-modules/piqi-ocaml/default.nix+24 pkgs/development/ocaml-modules/piqi/default.nix+30 pkgs/development/ocaml-modules/piqi/no-ocamlpath-override.patch+17 pkgs/development/ocaml-modules/uuidm/default.nix+28 pkgs/top-level/all-packages.nix+15
lib/maintainers.nix+1
@@ -145,6 +145,7 @@
145145 malyn = "Michael Alyn Miller <malyn@strangeGizmo.com>";
146146 manveru = "Michael Fellinger <m.fellinger@gmail.com>";
147147 marcweber = "Marc Weber <marco-oweber@gmx.de>";
148+ maurer = "Matthew Maurer <matthew.r.maurer+nix@gmail.com>";
148149 matejc = "Matej Cotman <cotman.matej@gmail.com>";
149150 matthiasbeyer = "Matthias Beyer <mail@beyermatthias.de>";
150151 mbakke = "Marius Bakke <ymse@tuta.io>";
pkgs/development/ocaml-modules/bitstring/2.0.4.nixnew file+25
@@ -0,0 +1,25 @@
1+{stdenv, fetchurl, buildOcaml, time}:
2+
3+buildOcaml rec {
4+ name = "bitstring";
5+ version = "2.0.4";
6+ src = fetchurl {
7+ url = "http://bitstring.googlecode.com/files/ocaml-bitstring-${version}.tar.gz";
8+ sha256 = "0mapzn2ls5qcrzjm1az50lqjj76ldkmz4fbv2phc9w6smab50qy5";
9+ };
10+
11+ patches = [ ./camlp4.patch ./meta.patch ];
12+
13+ buildInputs = [time];
14+ doCheck = true;
15+
16+ createFindlibDestdir = true;
17+ hasSharedObjects = true;
18+
19+ meta = with stdenv.lib; {
20+ description = "This library adds Erlang-style bitstrings and matching over bitstrings as a syntax extension and library for OCaml.";
21+ homepage = http://code.google.com/p/bitstring/;
22+ license = licenses.lgpl21Plus;
23+ maintainers = [ maintainers.maurer ];
24+ };
25+}
pkgs/development/ocaml-modules/bitstring/camlp4-git.patchnew file+44
@@ -0,0 +1,44 @@
1+diff --git a/Makefile.in b/Makefile.in
2+index d040f4c..cc1a8f5 100644
3+--- a/Makefile.in
4++++ b/Makefile.in
5+@@ -40,7 +40,7 @@ pkg_extlib = @OCAML_PKG_extlib@
6+ enable_coverage = @enable_coverage@
7+
8+ OCAMLCFLAGS = -g
9+-OCAMLCPACKAGES =
10++OCAMLCPACKAGES = -package camlp4
11+ OCAMLCLIBS = -linkpkg
12+ OCAMLOPTFLAGS = $(OCAMLCFLAGS)
13+ OCAMLOPTPACKAGES = $(OCAMLCPACKAGES)
14+@@ -110,12 +110,13 @@ bitstring_persistent.cmi: bitstring_persistent.mli
15+ -I +camlp4 -pp camlp4of -c $<
16+
17+ pa_bitstring.cmo: pa_bitstring.ml bitstring.cma bitstring_persistent.cma
18+- $(OCAMLFIND) ocamlc bitstring.cma -I +camlp4 dynlink.cma camlp4lib.cma \
19++ $(OCAMLFIND) ocamlc $(OCAMLCPACKAGES) \
20++ bitstring.cma -I +camlp4 dynlink.cma camlp4lib.cma \
21+ -pp camlp4of -c $< -o $@
22+
23+ bitstring-objinfo: bitstring_objinfo.cmo bitstring.cma bitstring_persistent.cma
24+ $(OCAMLFIND) ocamlc -I +camlp4 unix.cma dynlink.cma camlp4lib.cma \
25+- $(OCAMLCFLAGS) $(OCAMLCLIBS) \
26++ $(OCAMLCFLAGS) $(OCAMLCLIBS) $(OCAMLCPACKAGES) \
27+ bitstring.cma bitstring_persistent.cma \
28+ $< -o $@
29+
30+@@ -158,12 +159,13 @@ tests/test.bmpp: create_test_pattern
31+
32+ create_test_pattern: create_test_pattern.cmo
33+ $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -pp camlp4of \
34+- unix.cma -I +camlp4 dynlink.cma camlp4lib.cma \
35++ unix.cma -I `ocamlfind query camlp4` dynlink.cma camlp4lib.cma \
36+ $(OCAMLCLIBS) \
37+ -I . bitstring.cma bitstring_persistent.cma $< -o $@
38+
39+ create_test_pattern.cmo: create_test_pattern.ml
40+ $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -pp camlp4of \
41++ $(OCAMLCPACKAGES) \
42+ unix.cma -I +camlp4 \
43+ -I . -c $< -o $@
44+
pkgs/development/ocaml-modules/bitstring/camlp4.patchnew file+84
@@ -0,0 +1,84 @@
1+diff -rupN ocaml-bitstring-2.0.4.orig/camlp4.patch ocaml-bitstring-2.0.4/camlp4.patch
2+--- ocaml-bitstring-2.0.4.orig/camlp4.patch 1970-01-01 00:00:00.000000000 +0000
3++++ ocaml-bitstring-2.0.4/camlp4.patch 2015-06-10 18:06:54.016000000 +0000
4+@@ -0,0 +1,31 @@
5++--- Makefile.in 2015-06-10 20:05:26.603000000 +0200
6+++++ ../bs-old/Makefile.in 2013-05-14 17:42:32.000000000 +0200
7++@@ -40,10 +40,10 @@
8++ enable_coverage = @enable_coverage@
9++
10++ OCAMLCFLAGS = -g
11++-OCAMLCPACKAGES = -package camlp4
12+++OCAMLCPACKAGES =
13++ OCAMLCLIBS = -linkpkg
14++ OCAMLOPTFLAGS =
15++-OCAMLOPTPACKAGES = -package camlp4
16+++OCAMLOPTPACKAGES =
17++ OCAMLOPTLIBS = -linkpkg
18++
19++ ifneq ($(enable_coverage),no)
20++@@ -110,13 +110,12 @@
21++ -I +camlp4 -pp camlp4of -c $<
22++
23++ pa_bitstring.cmo: pa_bitstring.ml bitstring.cma bitstring_persistent.cma
24++- $(OCAMLFIND) ocamlc $(OCAMLCPACKAGES) \
25++- bitstring.cma -I +camlp4 dynlink.cma camlp4lib.cma \
26+++ $(OCAMLFIND) ocamlc bitstring.cma -I +camlp4 dynlink.cma camlp4lib.cma \
27++ -pp camlp4of -c $< -o $@
28++
29++ bitstring-objinfo: bitstring_objinfo.cmo bitstring.cma bitstring_persistent.cma
30++ $(OCAMLFIND) ocamlc -I +camlp4 unix.cma dynlink.cma camlp4lib.cma \
31++- $(OCAMLCPACKAGES) $(OCAMLCLIBS) \
32+++ $(OCAMLCLIBS) \
33++ bitstring.cma bitstring_persistent.cma \
34++ $< -o $@
35++
36+diff -rupN ocaml-bitstring-2.0.4.orig/Makefile.in ocaml-bitstring-2.0.4/Makefile.in
37+--- ocaml-bitstring-2.0.4.orig/Makefile.in 2013-05-14 15:42:32.000000000 +0000
38++++ ocaml-bitstring-2.0.4/Makefile.in 2015-06-25 20:05:52.759000000 +0000
39+@@ -40,10 +40,10 @@ pkg_extlib = @OCAML_PKG_extlib@
40+ enable_coverage = @enable_coverage@
41+
42+ OCAMLCFLAGS = -g
43+-OCAMLCPACKAGES =
44++OCAMLCPACKAGES = -package camlp4
45+ OCAMLCLIBS = -linkpkg
46+ OCAMLOPTFLAGS =
47+-OCAMLOPTPACKAGES =
48++OCAMLOPTPACKAGES = -package camlp4
49+ OCAMLOPTLIBS = -linkpkg
50+
51+ ifneq ($(enable_coverage),no)
52+@@ -110,12 +110,13 @@ bitstring_persistent.cmi: bitstring_pers
53+ -I +camlp4 -pp camlp4of -c $<
54+
55+ pa_bitstring.cmo: pa_bitstring.ml bitstring.cma bitstring_persistent.cma
56+- $(OCAMLFIND) ocamlc bitstring.cma -I +camlp4 dynlink.cma camlp4lib.cma \
57++ $(OCAMLFIND) ocamlc $(OCAMLCPACKAGES) \
58++ bitstring.cma -I +camlp4 dynlink.cma camlp4lib.cma \
59+ -pp camlp4of -c $< -o $@
60+
61+ bitstring-objinfo: bitstring_objinfo.cmo bitstring.cma bitstring_persistent.cma
62+ $(OCAMLFIND) ocamlc -I +camlp4 unix.cma dynlink.cma camlp4lib.cma \
63+- $(OCAMLCLIBS) \
64++ $(OCAMLCPACKAGES) $(OCAMLCLIBS) \
65+ bitstring.cma bitstring_persistent.cma \
66+ $< -o $@
67+
68+@@ -158,13 +159,13 @@ tests/test.bmpp: create_test_pattern
69+
70+ create_test_pattern: create_test_pattern.cmo
71+ $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -pp camlp4of \
72+- unix.cma -I +camlp4 dynlink.cma camlp4lib.cma \
73+- $(OCAMLCLIBS) \
74++ unix.cma -I `$(OCAMLFIND) query camlp4` dynlink.cma camlp4lib.cma \
75++ $(OCAMLCLIBS) $(OCAMLCPACKAGES) \
76+ -I . bitstring.cma bitstring_persistent.cma $< -o $@
77+
78+ create_test_pattern.cmo: create_test_pattern.ml
79+ $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -pp camlp4of \
80+- unix.cma -I +camlp4 \
81++ unix.cma -I `$(OCAMLFIND) query camlp4` $(OCAMLCPACKAGES) \
82+ -I . -c $< -o $@
83+
84+ # Coverage of tests.
pkgs/development/ocaml-modules/bitstring/default.nixnew file+28
@@ -0,0 +1,28 @@
1+{stdenv, fetchgit, buildOcaml, time, autoconf, automake}:
2+
3+buildOcaml rec {
4+ name = "bitstring";
5+ version = "f1673f8";
6+ src = fetchgit {
7+ url = "https://code.google.com/p/bitstring/";
8+ rev = "f1673f8";
9+ sha256 = "1lh97qf1b7mq64pxkphr2w91ri5hfwg58cpjb2xd8a453c9jylw4";
10+ };
11+
12+ patches = [ ./camlp4-git.patch ./meta.patch ];
13+
14+ buildInputs = [time autoconf automake];
15+ doCheck = true;
16+
17+ createFindlibDestdir = true;
18+ hasSharedObjects = true;
19+
20+ preConfigure = "./bootstrap; echo breakhash";
21+
22+ meta = with stdenv.lib; {
23+ description = "This library adds Erlang-style bitstrings and matching over bitstrings as a syntax extension and library for OCaml.";
24+ homepage = http://code.google.com/p/bitstring/;
25+ license = licenses.lgpl21Plus;
26+ maintainers = [ maintainers.maurer ];
27+ };
28+}
pkgs/development/ocaml-modules/bitstring/meta.patchnew file+15
@@ -0,0 +1,15 @@
1+diff -rupN ocaml-bitstring-2.0.4/META.in ocaml-bitstring-2.0.4.new/META.in
2+--- ocaml-bitstring-2.0.4/META.in 2013-05-14 17:42:32.000000000 +0200
3++++ ocaml-bitstring-2.0.4.new/META.in 2015-06-11 17:26:11.674000000 +0200
4+@@ -15,8 +15,8 @@ package "persistent" (
5+
6+ package "syntax" (
7+ version = "@PACKAGE_VERSION@"
8+- requires = "camlp4"
9++ requires = "camlp4, bitstring.persistent, bitstring"
10+ description = "Syntax extension: bitstring operators"
11+- archive(syntax,preprocessor) = "-parser o -parser op -printer p unix.cma bitstring.cma bitstring_persistent.cma pa_bitstring.cmo"
12+- archive(syntax,toploop) = "unix.cma bitstring.cma bitstring_persistent.cma pa_bitstring.cmo"
13++ archive(syntax,preprocessor) = "-parser o -parser op -printer p pa_bitstring.cmo"
14++ archive(syntax,toploop) = "pa_bitstring.cmo"
15+ )
pkgs/development/ocaml-modules/faillib/default.nixnew file+24
@@ -0,0 +1,24 @@
1+{stdenv, buildOcaml, fetchurl, herelib, camlp4}:
2+
3+buildOcaml rec {
4+ minimumSupportedOcamlVersion = "4.00";
5+ name = "faillib";
6+ version = "111.17.00";
7+
8+ src = fetchurl {
9+ url = "https://github.com/janestreet/faillib/archive/${version}.tar.gz";
10+ sha256 = "12dvaxkmgf7yzzvbadcyk1n17llgh6p8qr33867d21npaljy7l9v";
11+ };
12+
13+ propagatedBuildInputs = [ camlp4 herelib ];
14+
15+ doCheck = true;
16+ checkPhase = "make test";
17+
18+ meta = with stdenv.lib; {
19+ homepage = https://ocaml.janestreet.com/;
20+ description = "Library for dealing with failure in OCaml";
21+ license = licenses.asl20;
22+ maintainers = [ maintainers.maurer ];
23+ };
24+}
pkgs/development/ocaml-modules/piqi-ocaml/default.nixnew file+24
@@ -0,0 +1,24 @@
1+{stdenv, fetchurl, ocaml, findlib, piqi, ulex, easy-format, xmlm, base64, camlp4}:
2+
3+stdenv.mkDerivation rec {
4+ version = "0.7.4";
5+ name = "piqi-ocaml-${version}";
6+
7+ src = fetchurl {
8+ url = "https://github.com/alavrik/piqi-ocaml/archive/v${version}.tar.gz";
9+ sha256 = "064c74f031l847q6s1vilj77n7h7i84jn8c83yid9nha3dssaf7m";
10+ };
11+
12+ buildInputs = [ocaml findlib piqi base64 camlp4];
13+
14+ createFindlibDestdir = true;
15+
16+ installPhase = "DESTDIR=$out make install";
17+
18+ meta = with stdenv.lib; {
19+ homepage = http://piqi.org;
20+ description = "Universal schema language and a collection of tools built around it. These are the ocaml bindings.";
21+ license = licenses.asl20;
22+ maintainers = [ maintainers.maurer ];
23+ };
24+}
pkgs/development/ocaml-modules/piqi/default.nixnew file+30
@@ -0,0 +1,30 @@
1+{stdenv, fetchurl, ocaml, findlib, camlp4, which, ulex, easy-format, ocaml_optcomp, xmlm, base64}:
2+
3+stdenv.mkDerivation rec {
4+ version = "0.6.12";
5+ name = "piqi-${version}";
6+
7+ src = fetchurl {
8+ url = "https://github.com/alavrik/piqi/archive/v${version}.tar.gz";
9+ sha256 = "1ifnawnblvibf5rgp6gr4f20266dckfrlryikg1iiq3dx2wfl7f8";
10+ };
11+
12+ buildInputs = [ocaml findlib camlp4 which ocaml_optcomp base64];
13+ propagatedBuildInputs = [ulex xmlm easy-format];
14+
15+ patches = [ ./no-ocamlpath-override.patch ];
16+
17+ createFindlibDestdir = true;
18+
19+ installPhase = ''
20+ make install;
21+ make ocaml-install;
22+ '';
23+
24+ meta = with stdenv.lib; {
25+ homepage = http://piqi.org;
26+ description = "Universal schema language and a collection of tools built around it.";
27+ license = licenses.asl20;
28+ maintainers = [ maintainers.maurer ];
29+ };
30+}
pkgs/development/ocaml-modules/piqi/no-ocamlpath-override.patchnew file+17
@@ -0,0 +1,17 @@
1+diff -rupN piqi-0.6.12.orig/make/Makefile.ocaml piqi-0.6.12/make/Makefile.ocaml
2+--- piqi-0.6.12.orig/make/Makefile.ocaml 2015-03-13 13:35:19.000000000 +0100
3++++ piqi-0.6.12/make/Makefile.ocaml 2015-06-10 21:19:57.231000000 +0200
4+@@ -1,13 +1,5 @@
5+ OCAMLMAKEFILE := $(PIQI_ROOT)/make/OCamlMakefile
6+
7+-
8+-OCAMLPATH := $(PIQI_BUILD)/lib/ocaml
9+-ifeq ($(SYSTEM),$(filter $(SYSTEM),mingw mingw64))
10+-OCAMLPATH := $(shell cygpath -w $(OCAMLPATH))
11+-endif
12+-export OCAMLPATH
13+-
14+-
15+ # make sure camlp4o produces pretty-printed text instead of AST
16+ export CAMLP4_O = $(CAMLP4)o -printer o
17+
pkgs/development/ocaml-modules/uuidm/default.nixnew file+28
@@ -0,0 +1,28 @@
1+{stdenv, fetchurl, ocaml, findlib}:
2+
3+stdenv.mkDerivation rec {
4+ version = "0.9.5";
5+ name = "uuidm-${version}";
6+ src = fetchurl {
7+ url = "http://erratique.ch/software/uuidm/releases/uuidm-${version}.tbz";
8+ sha256 = "03bgxs119bphv9ggg97nsl5m61s43ixgby05hhggv16iadx9zndm";
9+ };
10+
11+ unpackCmd = "tar -xf $curSrc";
12+
13+ buildInputs = [ocaml findlib];
14+
15+ configurePhase = "ocaml setup.ml -configure --prefix $prefix";
16+ buildPhase = "ocaml setup.ml -build";
17+ installPhase = "ocaml setup.ml -install";
18+
19+ createFindlibDestdir = true;
20+
21+ meta = with stdenv.lib; {
22+ description = "An OCaml module implementing 128 bits universally unique identifiers version 3, 5 (name based with MD5, SHA-1 hashing) and 4 (random based) according to RFC 4122.";
23+ homepage = http://erratique.ch/software/uuidm;
24+ license = licenses.bsd3;
25+ platforms = ocaml.meta.platforms;
26+ maintainers = [ maintainers.maurer ];
27+ };
28+}
pkgs/top-level/all-packages.nix+15
@@ -4213,6 +4213,14 @@ let
42134213
42144214 bolt = callPackage ../development/ocaml-modules/bolt { };
42154215
4216+ bitstring_2_0_4 = callPackage ../development/ocaml-modules/bitstring/2.0.4.nix { };
4217+ bitstring_git = callPackage ../development/ocaml-modules/bitstring { };
4218+
4219+ bitstring =
4220+ if lib.versionOlder "4.02" ocaml_version
4221+ then bitstring_git
4222+ else bitstring_2_0_4;
4223+
42164224 camlidl = callPackage ../development/tools/ocaml/camlidl { };
42174225
42184226 camlp4 =
@@ -4318,6 +4326,8 @@ let
43184326 lwt = ocaml_lwt;
43194327 };
43204328
4329+ faillib = callPackage ../development/ocaml-modules/faillib { };
4330+
43214331 fieldslib = callPackage ../development/ocaml-modules/fieldslib { };
43224332
43234333 fileutils = callPackage ../development/ocaml-modules/fileutils { };
@@ -4470,6 +4480,9 @@ let
44704480
44714481 ounit = callPackage ../development/ocaml-modules/ounit { };
44724482
4483+ piqi = callPackage ../development/ocaml-modules/piqi { };
4484+ piqi-ocaml = callPackage ../development/ocaml-modules/piqi-ocaml { };
4485+
44734486 re2 = callPackage ../development/ocaml-modules/re2 { };
44744487
44754488 tyxml = callPackage ../development/ocaml-modules/tyxml { };
@@ -4544,6 +4557,8 @@ let
45444557
45454558 utop = callPackage ../development/tools/ocaml/utop { };
45464559
4560+ uuidm = callPackage ../development/ocaml-modules/uuidm { };
4561+
45474562 sawja = callPackage ../development/ocaml-modules/sawja { };
45484563
45494564 uucd = callPackage ../development/ocaml-modules/uucd { };