Author: ludo
Date: Thu Apr 12 15:30:02 2012
New Revision: 33763
URL: https://nixos.org/websvn/nix/?rev=33763&sc=1

Log:
Coccinelle: Make sure Python modules are looked up in the right place.

Modified:
   nixpkgs/trunk/pkgs/development/tools/misc/coccinelle/default.nix

Modified: nixpkgs/trunk/pkgs/development/tools/misc/coccinelle/default.nix
==============================================================================
--- nixpkgs/trunk/pkgs/development/tools/misc/coccinelle/default.nix    Thu Apr 
12 14:16:23 2012        (r33762)
+++ nixpkgs/trunk/pkgs/development/tools/misc/coccinelle/default.nix    Thu Apr 
12 15:30:02 2012        (r33763)
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, python, ncurses, ocamlPackages }:
+{ fetchurl, stdenv, python, ncurses, ocamlPackages, makeWrapper }:
 
 let
 
@@ -16,11 +16,21 @@
   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";
 
_______________________________________________
nix-commits mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-commits

Reply via email to