git.iko.soy/typeable/nixpkgs
on master help sign in
ocaml-bitstring: init at 2.0.4 and f1673f8
commit90a4de0f1b70db2e8f9a47d04a11919fc798e652 authorMatthew Maurer <maurer@matthewmaurer.org> dateWed 10 Jun 2015, 18:05 (11 years ago) parentda4266a
7 files changed+205
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/top-level/all-packages.nix+8
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/top-level/all-packages.nix+8
@@ -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 =