From 6131989a7d606c5a33a9a6a91ea55ac37cf0c95f Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sun, 13 May 2018 17:28:22 +0200 Subject: [PATCH] ocamlPackages.bitstring: 2.1.1 -> 3.0.0 (#40034) --- .../ocaml-modules/bitstring/camlp4-git.patch | 44 ------------------- .../ocaml-modules/bitstring/default.nix | 31 +++++++------ .../ocaml-modules/bitstring/srcdir.patch | 11 ----- 3 files changed, 18 insertions(+), 68 deletions(-) delete mode 100644 pkgs/development/ocaml-modules/bitstring/camlp4-git.patch delete mode 100644 pkgs/development/ocaml-modules/bitstring/srcdir.patch diff --git a/pkgs/development/ocaml-modules/bitstring/camlp4-git.patch b/pkgs/development/ocaml-modules/bitstring/camlp4-git.patch deleted file mode 100644 index 24d2e362dfac..000000000000 --- a/pkgs/development/ocaml-modules/bitstring/camlp4-git.patch +++ /dev/null @@ -1,44 +0,0 @@ -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/default.nix b/pkgs/development/ocaml-modules/bitstring/default.nix index b13eda071f62..13424272bcf8 100644 --- a/pkgs/development/ocaml-modules/bitstring/default.nix +++ b/pkgs/development/ocaml-modules/bitstring/default.nix @@ -1,26 +1,31 @@ -{ stdenv, fetchurl, buildOcaml, time, autoconf, automake }: +{ stdenv, fetchFromGitHub, ocaml, findlib, jbuilder +, ppx_tools_versioned +, ounit +}: -buildOcaml rec { - name = "bitstring"; - version = "2.1.1"; - src = fetchurl { - url = http://github.com/xguerin/bitstring/archive/v2.1.1.tar.gz; - sha256 = "0vy8ibrxccii1jbsk5q6yh1kxjigqvi7lhhcmizvd5gfhf7mfyc8"; +stdenv.mkDerivation rec { + name = "ocaml${ocaml.version}-bitstring-${version}"; + version = "3.0.0"; + src = fetchFromGitHub { + owner = "xguerin"; + repo = "bitstring"; + rev = "v${version}"; + sha256 = "0r49qax7as48jgknzaq6p9rbpmrvnmlic713wzz5bj60j5h0396f"; }; - patches = [ ./camlp4-git.patch ./srcdir.patch ]; + buildInputs = [ ocaml findlib jbuilder ppx_tools_versioned ounit ]; + + buildPhase = "jbuilder build"; - buildInputs = [time autoconf automake]; doCheck = true; + checkPhase = "jbuilder runtest"; - createFindlibDestdir = true; - hasSharedObjects = true; - - preConfigure = "./bootstrap"; + inherit (jbuilder) installPhase; meta = with stdenv.lib; { description = "This library adds Erlang-style bitstrings and matching over bitstrings as a syntax extension and library for OCaml"; homepage = https://github.com/xguerin/bitstring; + inherit (ocaml.meta) platforms; license = licenses.lgpl21Plus; maintainers = [ maintainers.maurer ]; }; diff --git a/pkgs/development/ocaml-modules/bitstring/srcdir.patch b/pkgs/development/ocaml-modules/bitstring/srcdir.patch deleted file mode 100644 index d53760f1d6f6..000000000000 --- a/pkgs/development/ocaml-modules/bitstring/srcdir.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/Makefile.in 2015-09-01 06:32:15.111441188 +0200 -+++ b/Makefile.in 2015-09-01 06:32:56.001084480 +0200 -@@ -125,7 +125,7 @@ - - byteswap.h: byteswap.in.h - { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ -- cat $(srcdir)/byteswap.in.h; \ -+ cat $(top_srcdir)/byteswap.in.h; \ - } > $@-t - mv -f $@-t $@ -