From 42161470ae3840ad183a1f0fc783f9f1bac90484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 28 Jun 2009 21:00:36 +0000 Subject: [PATCH] buildPythonPackage: Wrap binaries with an appropriate $PATH. svn path=/nixpkgs/trunk/; revision=16081 --- .../python-modules/generic/default.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/generic/default.nix b/pkgs/development/python-modules/generic/default.nix index 96b2e25d6f99..33569fef29c3 100644 --- a/pkgs/development/python-modules/generic/default.nix +++ b/pkgs/development/python-modules/generic/default.nix @@ -62,13 +62,27 @@ python.stdenv.mkDerivation ( if head -n1 "$i" | grep -q "${python}" then echo "wrapping \`$i'..." + + # Compute a $PATH prefix for the program. + program_PATH="" + ${lib.concatStrings + (map (path: + ''if [ -d "${path}/bin" ] + then + program_PATH="${path}/bin'' + "\$" + ''{program_PATH:+:}$program_PATH" + fi + '') + (lib.concatMap recursiveBuildInputs propagatedBuildInputs))} + wrapProgram "$i" \ --prefix PYTHONPATH ":" \ ${lib.concatStringsSep ":" ([ "$out/lib/${python.libPrefix}/site-packages" ] ++ (map (path: path + "/lib/${python.libPrefix}/site-packages") (lib.concatMap recursiveBuildInputs - propagatedBuildInputs)))} + propagatedBuildInputs)))} \ + --prefix PATH ":" "$program_PATH" + fi done