From 331186b9ac7edc9e9aea1fc692da8880a549e33f Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sun, 3 Jan 2021 10:14:22 +0100 Subject: ocamlPackages.bitstring: 3.1.1 → 4.0.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ocamlPackages.ppx_bitsring: init at 4.0.1 --- pkgs/development/ocaml-modules/bap/default.nix | 7 ++++++- pkgs/development/ocaml-modules/bitstring/default.nix | 13 +++++++------ pkgs/development/ocaml-modules/bitstring/ppx.nix | 18 ++++++++++++++++++ 3 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 pkgs/development/ocaml-modules/bitstring/ppx.nix (limited to 'pkgs/development/ocaml-modules') diff --git a/pkgs/development/ocaml-modules/bap/default.nix b/pkgs/development/ocaml-modules/bap/default.nix index 66b1dd67a9f2..e860ad13d405 100644 --- a/pkgs/development/ocaml-modules/bap/default.nix +++ b/pkgs/development/ocaml-modules/bap/default.nix @@ -2,6 +2,7 @@ , ocaml, findlib, ocamlbuild, ocaml_oasis, bitstring, camlzip, cmdliner, core_kernel, ezjsonm, fileutils, ocaml_lwt, ocamlgraph, ocurl, re, uri, zarith, piqi, piqi-ocaml, uuidm, llvm, frontc, ounit, ppx_jane, parsexp, utop, libxml2, + ppx_bitstring, ppx_tools_versioned, which, makeWrapper, writeText , z3 @@ -40,7 +41,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ which makeWrapper ]; buildInputs = [ ocaml findlib ocamlbuild ocaml_oasis - llvm ppx_tools_versioned + llvm ppx_bitstring ppx_tools_versioned z3 utop libxml2 ]; @@ -63,6 +64,10 @@ stdenv.mkDerivation rec { patches = [ ./dont-add-curses.patch ]; + preConfigure = '' + substituteInPlace oasis/elf --replace bitstring.ppx ppx_bitstring + ''; + configureFlags = [ "--enable-everything ${disableIda}" "--with-llvm-config=${llvm}/bin/llvm-config" ]; BAPBUILDFLAGS = "-j $(NIX_BUILD_CORES)"; diff --git a/pkgs/development/ocaml-modules/bitstring/default.nix b/pkgs/development/ocaml-modules/bitstring/default.nix index 386503039e05..583017d9ddec 100644 --- a/pkgs/development/ocaml-modules/bitstring/default.nix +++ b/pkgs/development/ocaml-modules/bitstring/default.nix @@ -1,20 +1,21 @@ -{ stdenv, fetchFromGitHub, buildDunePackage, ppx_tools_versioned, ounit }: +{ lib, fetchFromGitHub, buildDunePackage, stdlib-shims }: buildDunePackage rec { pname = "bitstring"; - version = "3.1.1"; + version = "4.0.1"; + + useDune2 = true; src = fetchFromGitHub { owner = "xguerin"; repo = pname; rev = "v${version}"; - sha256 = "1ys8xx174jf8v5sm0lbxvzhdlcs5p0fhy1gvf58gad2g4gvgpvxc"; + sha256 = "1z7jmgljvp52lvn3ml2cp6gssxqp4sikwyjf6ym97cycbcw0fjjm"; }; - buildInputs = [ ppx_tools_versioned ounit ]; - doCheck = true; + propagatedBuildInputs = [ stdlib-shims ]; - meta = with stdenv.lib; { + meta = with 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"; license = licenses.lgpl21Plus; diff --git a/pkgs/development/ocaml-modules/bitstring/ppx.nix b/pkgs/development/ocaml-modules/bitstring/ppx.nix new file mode 100644 index 000000000000..ee0a8c51f732 --- /dev/null +++ b/pkgs/development/ocaml-modules/bitstring/ppx.nix @@ -0,0 +1,18 @@ +{ lib, buildDunePackage, ocaml +, bitstring, ppxlib +, ounit +}: + +buildDunePackage rec { + pname = "ppx_bitstring"; + inherit (bitstring) version useDune2 src; + + buildInputs = [ bitstring ppxlib ]; + + doCheck = lib.versionAtLeast ocaml.version "4.08"; + checkInputs = [ ounit ]; + + meta = bitstring.meta // { + description = "Bitstrings and bitstring matching for OCaml - PPX extension"; + }; +} -- cgit 1.4.1