diff options
-rw-r--r-- | pkgs/development/tools/misc/coccinelle/default.nix | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/pkgs/development/tools/misc/coccinelle/default.nix b/pkgs/development/tools/misc/coccinelle/default.nix index 1d1db3b87ad..0b5fa4b8d61 100644 --- a/pkgs/development/tools/misc/coccinelle/default.nix +++ b/pkgs/development/tools/misc/coccinelle/default.nix @@ -1,4 +1,4 @@ -{ fetchurl, stdenv, python, ncurses, ocamlPackages }: +{ fetchurl, stdenv, python, ncurses, ocamlPackages, makeWrapper }: let @@ -16,11 +16,21 @@ in stdenv.mkDerivation { buildInputs = with ocamlPackages; [ ocaml findlib menhir ocaml_pcre ocaml_sexplib pycaml - python ncurses + python ncurses makeWrapper ]; configureFlagsArray = [ "--enable-release" ]; + 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 + ''; + meta = { description = "Coccinelle, a program to apply C code semantic patches"; |