1diff -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+
36diff -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.