From 9614ebf1372149b77edabde2d6318aaf8d35c31d Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Fri, 3 Mar 2017 15:27:23 -0600 Subject: [PATCH] coccinelle: 1.0.0-r23 -> 1.0.6 * Remove camlp4 dependency, no longer needed * Keep pycaml to use ours over bundled version * Enable tests for sanity (broken on darwin) * no longer need to force specific ocaml version * don't create python wrappers, they don't seem to be needed * remove deprecated configure flag. * fix spgen by removing bytecode version. --- .../tools/misc/coccinelle/default.nix | 39 ++++++++++--------- pkgs/top-level/all-packages.nix | 4 +- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/pkgs/development/tools/misc/coccinelle/default.nix b/pkgs/development/tools/misc/coccinelle/default.nix index f21808d28f7c..4040eda141fd 100644 --- a/pkgs/development/tools/misc/coccinelle/default.nix +++ b/pkgs/development/tools/misc/coccinelle/default.nix @@ -1,36 +1,37 @@ -{ fetchurl, stdenv, python, ncurses, ocamlPackages, pkgconfig, makeWrapper }: +{ fetchurl, stdenv, python, ncurses, ocamlPackages, pkgconfig }: stdenv.mkDerivation rec { name = "coccinelle-${version}"; - version = "1.0.0-rc23"; + version = "1.0.6"; src = fetchurl { url = "http://coccinelle.lip6.fr/distrib/${name}.tgz"; - sha256 = "1qrd4kr3wc0hm4l60fwn19iwzwqcjsx85mm3k4gm3cdhljjma82p"; + sha256 = "02g9hmwkvfl838zz690yra5jzrqjg6y6ffxkrfcsx790bhkfsll4"; }; buildInputs = with ocamlPackages; [ - ocaml findlib menhir ocamlPackages.camlp4 + ocaml findlib menhir ocaml_pcre pycaml python ncurses pkgconfig - makeWrapper ]; - # TODO: is the generation of this wrapper truly/still needed? - # I don't have a non-NixOS system, so I cannot verify this, but shouldn't - # libpython know where to find its modules? (the path is for example in - # its Sys-module). - postInstall = - # On non-NixOS systems, Coccinelle would end up looking up Python modules - # in the wrong directory. - '' for p in "$out/bin/"* - do - wrapProgram "$p" \ - --prefix "PYTHONPATH" ":" "${python}/lib/python${python.majorVersion}" - done - ''; + doCheck = !stdenv.isDarwin; - configureFlags = "--enable-release"; + # The build system builds two versions of spgen: + # 'spgen' with ocamlc -custom (bytecode specially linked) + # and 'spgen.opt' using ocamlopt. + # I'm not sure of the intentions here, but the way + # the 'spgen' binary is produced results in an + # invalid/incorrect interpreter path (/lib/ld-linux*). + # We could patch it, but without knowing why it's + # finding the wrong path it seems safer to use + # the .opt version that is built correctly. + # All that said, our fix here is simple: remove 'spgen'. + # The bin/spgen entrypoint is really a bash script + # and will use spgen.opt if 'spgen' doesn't exist. + postInstall = '' + rm $out/lib/coccinelle/spgen/spgen + ''; meta = { description = "Program to apply semantic patches to C code"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2a280fad2e87..55596ec6efa0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6315,9 +6315,7 @@ with pkgs; # Does not actually depend on Qt 5 inherit (kdeFrameworks) extra-cmake-modules kapidox kdoctools; - coccinelle = callPackage ../development/tools/misc/coccinelle { - ocamlPackages = ocamlPackages_4_01_0; - }; + coccinelle = callPackage ../development/tools/misc/coccinelle { }; cpptest = callPackage ../development/libraries/cpptest { };