mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-04 03:25:02 +00:00
15c96da276
* Added a setup hook for Python that adds Python packages in buildInputs to $PYTHONPATH. svn path=/nixpkgs/trunk/; revision=7338
19 lines
388 B
Bash
19 lines
388 B
Bash
addPythonPath() {
|
|
local p=$1/lib/python2.4/site-packages
|
|
if test -d $p; then
|
|
export PYTHONPATH="${PYTHONPATH}${PYTHONPATH:+:}$p"
|
|
fi
|
|
}
|
|
|
|
toPythonPath() {
|
|
local paths="$1"
|
|
local result=
|
|
for i in $paths; do
|
|
p="$i/lib/python2.4/site-packages"
|
|
result="${result}${result:+:}$p"
|
|
done
|
|
echo $result
|
|
}
|
|
|
|
envHooks=(${envHooks[@]} addPythonPath)
|