summary refs log tree commit diff
path: root/pkgs/development/tools/misc/coccinelle/default.nix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-04-12 15:30:02 +0000
committerLudovic Courtès <ludo@gnu.org>2012-04-12 15:30:02 +0000
commiteb7575138ae5ca5fe767f6782d300cee4e570d6f (patch)
treece697eba45b110450bb7704be085d669cb083316 /pkgs/development/tools/misc/coccinelle/default.nix
parent205dbbd991003903a2da21c5e57c6b86657efb0d (diff)
downloadnixpkgs-eb7575138ae5ca5fe767f6782d300cee4e570d6f.tar
nixpkgs-eb7575138ae5ca5fe767f6782d300cee4e570d6f.tar.gz
nixpkgs-eb7575138ae5ca5fe767f6782d300cee4e570d6f.tar.bz2
nixpkgs-eb7575138ae5ca5fe767f6782d300cee4e570d6f.tar.lz
nixpkgs-eb7575138ae5ca5fe767f6782d300cee4e570d6f.tar.xz
nixpkgs-eb7575138ae5ca5fe767f6782d300cee4e570d6f.tar.zst
nixpkgs-eb7575138ae5ca5fe767f6782d300cee4e570d6f.zip
Coccinelle: Make sure Python modules are looked up in the right place.
svn path=/nixpkgs/trunk/; revision=33763
Diffstat (limited to 'pkgs/development/tools/misc/coccinelle/default.nix')
-rw-r--r--pkgs/development/tools/misc/coccinelle/default.nix14
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";