Skip to content

Commit

Permalink
Revert "ocaml-bitstring: git -> 2.0.4 (#17002)"
Browse files Browse the repository at this point in the history
This reverts commit a6e3a53.

See #17002.
  • Loading branch information
fpletz committed Jul 19, 2016
1 parent 9a8e0d1 commit afa69e1
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 1 deletion.
44 changes: 44 additions & 0 deletions pkgs/development/ocaml-modules/bitstring/camlp4-git.patch
Original file line number Diff line number Diff line change
@@ -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 $@

28 changes: 28 additions & 0 deletions pkgs/development/ocaml-modules/bitstring/default.nix
Original file line number Diff line number Diff line change
@@ -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 ./srcdir.patch ];

buildInputs = [time autoconf automake];
doCheck = true;

createFindlibDestdir = true;
hasSharedObjects = true;

preConfigure = "./bootstrap";

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 ];
};
}
8 changes: 7 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4976,7 +4976,13 @@ in

bolt = callPackage ../development/ocaml-modules/bolt { };

bitstring = callPackage ../development/ocaml-modules/bitstring/2.0.4.nix { };
bitstring_2_0_4 = callPackage ../development/ocaml-modules/bitstring/2.0.4.nix { };
bitstring_git = callPackage ../development/ocaml-modules/bitstring { };

bitstring =
if lib.versionOlder "4.02" ocaml_version
then bitstring_git
else bitstring_2_0_4;

camlidl = callPackage ../development/tools/ocaml/camlidl { };

Expand Down

0 comments on commit afa69e1

Please sign in to comment.