about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/bitstring
diff options
context:
space:
mode:
authorMatthew Maurer <maurer@matthewmaurer.org>2015-06-10 18:05:23 +0200
committerMatthew Maurer <maurer@matthewmaurer.org>2015-06-27 16:54:10 +0000
commit90a4de0f1b70db2e8f9a47d04a11919fc798e652 (patch)
tree34be4808b1a1b5051df858075d46d614dc1c66bd /pkgs/development/ocaml-modules/bitstring
parentda4266afb617e3167d459ad6dbf69179934d936e (diff)
ocaml-bitstring: init at 2.0.4 and f1673f8
Diffstat (limited to 'pkgs/development/ocaml-modules/bitstring')
-rw-r--r--pkgs/development/ocaml-modules/bitstring/2.0.4.nix25
-rw-r--r--pkgs/development/ocaml-modules/bitstring/camlp4-git.patch44
-rw-r--r--pkgs/development/ocaml-modules/bitstring/camlp4.patch84
-rw-r--r--pkgs/development/ocaml-modules/bitstring/default.nix28
-rw-r--r--pkgs/development/ocaml-modules/bitstring/meta.patch15
5 files changed, 196 insertions, 0 deletions
diff --git a/pkgs/development/ocaml-modules/bitstring/2.0.4.nix b/pkgs/development/ocaml-modules/bitstring/2.0.4.nix
new file mode 100644
index 0000000000000..da4bcdcb527a0
--- /dev/null
+++ b/pkgs/development/ocaml-modules/bitstring/2.0.4.nix
@@ -0,0 +1,25 @@
+{stdenv, fetchurl, buildOcaml, time}:
+
+buildOcaml rec {
+  name = "bitstring";
+  version = "2.0.4"; 
+  src = fetchurl {
+    url = "http://bitstring.googlecode.com/files/ocaml-bitstring-${version}.tar.gz";
+    sha256 = "0mapzn2ls5qcrzjm1az50lqjj76ldkmz4fbv2phc9w6smab50qy5";
+  };
+
+  patches = [ ./camlp4.patch ./meta.patch ];
+
+  buildInputs = [time];
+  doCheck = true;
+
+  createFindlibDestdir = true;
+  hasSharedObjects = true;
+
+  meta = with stdenv.lib; {
+    description = "This library adds Erlang-style bitstrings and matching over bitstrings as a syntax extension and library for OCaml.";
+    homepage = http://code.google.com/p/bitstring/;
+    license = licenses.lgpl21Plus;
+    maintainers = [ maintainers.maurer ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/bitstring/camlp4-git.patch b/pkgs/development/ocaml-modules/bitstring/camlp4-git.patch
new file mode 100644
index 0000000000000..24d2e362dfac9
--- /dev/null
+++ b/pkgs/development/ocaml-modules/bitstring/camlp4-git.patch
@@ -0,0 +1,44 @@
+diff --git a/Makefile.in b/Makefile.in
+index d040f4c..cc1a8f5 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -40,7 +40,7 @@ pkg_extlib	= @OCAML_PKG_extlib@
+ enable_coverage = @enable_coverage@
+ 
+ OCAMLCFLAGS	= -g
+-OCAMLCPACKAGES	=
++OCAMLCPACKAGES	= -package camlp4
+ OCAMLCLIBS	= -linkpkg
+ OCAMLOPTFLAGS	= $(OCAMLCFLAGS)
+ OCAMLOPTPACKAGES = $(OCAMLCPACKAGES)
+@@ -110,12 +110,13 @@ bitstring_persistent.cmi: bitstring_persistent.mli
+ 	  -I +camlp4 -pp camlp4of -c $<
+ 
+ pa_bitstring.cmo: pa_bitstring.ml bitstring.cma bitstring_persistent.cma
+-	$(OCAMLFIND) ocamlc bitstring.cma -I +camlp4 dynlink.cma camlp4lib.cma \
++	$(OCAMLFIND) ocamlc $(OCAMLCPACKAGES) \
++          bitstring.cma -I +camlp4 dynlink.cma camlp4lib.cma \
+ 	  -pp camlp4of -c $< -o $@
+ 
+ bitstring-objinfo: bitstring_objinfo.cmo bitstring.cma bitstring_persistent.cma
+ 	$(OCAMLFIND) ocamlc -I +camlp4 unix.cma dynlink.cma camlp4lib.cma \
+-	  $(OCAMLCFLAGS) $(OCAMLCLIBS) \
++	  $(OCAMLCFLAGS) $(OCAMLCLIBS) $(OCAMLCPACKAGES) \
+ 	  bitstring.cma bitstring_persistent.cma \
+ 	  $< -o $@
+ 
+@@ -158,12 +159,13 @@ tests/test.bmpp: create_test_pattern
+ 
+ create_test_pattern: create_test_pattern.cmo
+ 	$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -pp camlp4of \
+-	  unix.cma -I +camlp4 dynlink.cma camlp4lib.cma \
++	  unix.cma -I `ocamlfind query camlp4` dynlink.cma camlp4lib.cma \
+ 	  $(OCAMLCLIBS) \
+ 	  -I . bitstring.cma bitstring_persistent.cma $< -o $@
+ 
+ create_test_pattern.cmo: create_test_pattern.ml
+ 	$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -pp camlp4of \
++	  $(OCAMLCPACKAGES) \
+ 	  unix.cma -I +camlp4 \
+ 	  -I . -c $< -o $@
+ 
diff --git a/pkgs/development/ocaml-modules/bitstring/camlp4.patch b/pkgs/development/ocaml-modules/bitstring/camlp4.patch
new file mode 100644
index 0000000000000..920c78007bb03
--- /dev/null
+++ b/pkgs/development/ocaml-modules/bitstring/camlp4.patch
@@ -0,0 +1,84 @@
+diff -rupN ocaml-bitstring-2.0.4.orig/camlp4.patch ocaml-bitstring-2.0.4/camlp4.patch
+--- ocaml-bitstring-2.0.4.orig/camlp4.patch	1970-01-01 00:00:00.000000000 +0000
++++ ocaml-bitstring-2.0.4/camlp4.patch	2015-06-10 18:06:54.016000000 +0000
+@@ -0,0 +1,31 @@
++--- Makefile.in	2015-06-10 20:05:26.603000000 +0200
+++++ ../bs-old/Makefile.in	2013-05-14 17:42:32.000000000 +0200
++@@ -40,10 +40,10 @@
++ enable_coverage = @enable_coverage@
++ 
++ OCAMLCFLAGS	= -g
++-OCAMLCPACKAGES	= -package camlp4
+++OCAMLCPACKAGES	=
++ OCAMLCLIBS	= -linkpkg
++ OCAMLOPTFLAGS	=
++-OCAMLOPTPACKAGES = -package camlp4
+++OCAMLOPTPACKAGES =
++ OCAMLOPTLIBS	= -linkpkg
++ 
++ ifneq ($(enable_coverage),no)
++@@ -110,13 +110,12 @@
++ 	  -I +camlp4 -pp camlp4of -c $<
++ 
++ pa_bitstring.cmo: pa_bitstring.ml bitstring.cma bitstring_persistent.cma
++-	$(OCAMLFIND) ocamlc $(OCAMLCPACKAGES) \
++-	  bitstring.cma -I +camlp4 dynlink.cma camlp4lib.cma \
+++	$(OCAMLFIND) ocamlc bitstring.cma -I +camlp4 dynlink.cma camlp4lib.cma \
++ 	  -pp camlp4of -c $< -o $@
++ 
++ bitstring-objinfo: bitstring_objinfo.cmo bitstring.cma bitstring_persistent.cma
++ 	$(OCAMLFIND) ocamlc -I +camlp4 unix.cma dynlink.cma camlp4lib.cma \
++-	  $(OCAMLCPACKAGES) $(OCAMLCLIBS) \
+++	  $(OCAMLCLIBS) \
++ 	  bitstring.cma bitstring_persistent.cma \
++ 	  $< -o $@
++ 
+diff -rupN ocaml-bitstring-2.0.4.orig/Makefile.in ocaml-bitstring-2.0.4/Makefile.in
+--- ocaml-bitstring-2.0.4.orig/Makefile.in	2013-05-14 15:42:32.000000000 +0000
++++ ocaml-bitstring-2.0.4/Makefile.in	2015-06-25 20:05:52.759000000 +0000
+@@ -40,10 +40,10 @@ pkg_extlib	= @OCAML_PKG_extlib@
+ enable_coverage = @enable_coverage@
+ 
+ OCAMLCFLAGS	= -g
+-OCAMLCPACKAGES	=
++OCAMLCPACKAGES	= -package camlp4
+ OCAMLCLIBS	= -linkpkg
+ OCAMLOPTFLAGS	=
+-OCAMLOPTPACKAGES =
++OCAMLOPTPACKAGES = -package camlp4
+ OCAMLOPTLIBS	= -linkpkg
+ 
+ ifneq ($(enable_coverage),no)
+@@ -110,12 +110,13 @@ bitstring_persistent.cmi: bitstring_pers
+ 	  -I +camlp4 -pp camlp4of -c $<
+ 
+ pa_bitstring.cmo: pa_bitstring.ml bitstring.cma bitstring_persistent.cma
+-	$(OCAMLFIND) ocamlc bitstring.cma -I +camlp4 dynlink.cma camlp4lib.cma \
++	$(OCAMLFIND) ocamlc $(OCAMLCPACKAGES) \
++	  bitstring.cma -I +camlp4 dynlink.cma camlp4lib.cma \
+ 	  -pp camlp4of -c $< -o $@
+ 
+ bitstring-objinfo: bitstring_objinfo.cmo bitstring.cma bitstring_persistent.cma
+ 	$(OCAMLFIND) ocamlc -I +camlp4 unix.cma dynlink.cma camlp4lib.cma \
+-	  $(OCAMLCLIBS) \
++	  $(OCAMLCPACKAGES) $(OCAMLCLIBS) \
+ 	  bitstring.cma bitstring_persistent.cma \
+ 	  $< -o $@
+ 
+@@ -158,13 +159,13 @@ tests/test.bmpp: create_test_pattern
+ 
+ create_test_pattern: create_test_pattern.cmo
+ 	$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -pp camlp4of \
+-	  unix.cma -I +camlp4 dynlink.cma camlp4lib.cma \
+-	  $(OCAMLCLIBS) \
++	  unix.cma -I `$(OCAMLFIND) query camlp4` dynlink.cma camlp4lib.cma \
++	  $(OCAMLCLIBS) $(OCAMLCPACKAGES) \
+ 	  -I . bitstring.cma bitstring_persistent.cma $< -o $@
+ 
+ create_test_pattern.cmo: create_test_pattern.ml
+ 	$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -pp camlp4of \
+-	  unix.cma -I +camlp4 \
++	  unix.cma -I `$(OCAMLFIND) query camlp4` $(OCAMLCPACKAGES) \
+ 	  -I . -c $< -o $@
+ 
+ # Coverage of tests.
diff --git a/pkgs/development/ocaml-modules/bitstring/default.nix b/pkgs/development/ocaml-modules/bitstring/default.nix
new file mode 100644
index 0000000000000..b612ec1c0bdb3
--- /dev/null
+++ b/pkgs/development/ocaml-modules/bitstring/default.nix
@@ -0,0 +1,28 @@
+{stdenv, fetchgit, buildOcaml, time, autoconf, automake}:
+
+buildOcaml rec {
+  name = "bitstring";
+  version = "f1673f8"; 
+  src = fetchgit {
+    url = "https://code.google.com/p/bitstring/";
+    rev = "f1673f8";
+    sha256 = "1lh97qf1b7mq64pxkphr2w91ri5hfwg58cpjb2xd8a453c9jylw4";
+  };
+
+  patches = [ ./camlp4-git.patch ./meta.patch ];
+
+  buildInputs = [time autoconf automake];
+  doCheck = true;
+
+  createFindlibDestdir = true;
+  hasSharedObjects = true;
+
+  preConfigure = "./bootstrap; echo breakhash";
+
+  meta = with stdenv.lib; {
+    description = "This library adds Erlang-style bitstrings and matching over bitstrings as a syntax extension and library for OCaml.";
+    homepage = http://code.google.com/p/bitstring/;
+    license = licenses.lgpl21Plus;
+    maintainers = [ maintainers.maurer ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/bitstring/meta.patch b/pkgs/development/ocaml-modules/bitstring/meta.patch
new file mode 100644
index 0000000000000..78f44cbe15f5d
--- /dev/null
+++ b/pkgs/development/ocaml-modules/bitstring/meta.patch
@@ -0,0 +1,15 @@
+diff -rupN ocaml-bitstring-2.0.4/META.in ocaml-bitstring-2.0.4.new/META.in
+--- ocaml-bitstring-2.0.4/META.in	2013-05-14 17:42:32.000000000 +0200
++++ ocaml-bitstring-2.0.4.new/META.in	2015-06-11 17:26:11.674000000 +0200
+@@ -15,8 +15,8 @@ package "persistent" (
+ 
+ package "syntax" (
+   version = "@PACKAGE_VERSION@"
+-  requires = "camlp4"
++  requires = "camlp4, bitstring.persistent, bitstring"
+   description = "Syntax extension: bitstring operators"
+-  archive(syntax,preprocessor) = "-parser o -parser op -printer p unix.cma bitstring.cma bitstring_persistent.cma pa_bitstring.cmo"
+-  archive(syntax,toploop) = "unix.cma bitstring.cma bitstring_persistent.cma pa_bitstring.cmo"
++  archive(syntax,preprocessor) = "-parser o -parser op -printer p pa_bitstring.cmo"
++  archive(syntax,toploop) = "pa_bitstring.cmo"
+ )