Merge branch 'py/pth-create' into python-merge
This commit is contained in:
commit
9a6b4e5621
@ -20,6 +20,20 @@
|
|||||||
, installCommand ?
|
, installCommand ?
|
||||||
''
|
''
|
||||||
easy_install --prefix="$out" .
|
easy_install --prefix="$out" .
|
||||||
|
|
||||||
|
# A pth file might have been generated to load the package from
|
||||||
|
# within its own site-packages, rename this package not to
|
||||||
|
# collide with others.
|
||||||
|
eapth="$out/lib/${python.libPrefix}"/site-packages/easy-install.pth
|
||||||
|
if [ -e "$eapth" ]; then
|
||||||
|
# move colliding easy_install.pth to specifically named one
|
||||||
|
mv "$eapth" $(dirname "$eapth")/${name}.pth
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove any site.py files generated by easy_install as these
|
||||||
|
# cause collisions. If pth files are to be processed a
|
||||||
|
# corresponding site.py needs to be included in the PYTHONPATH.
|
||||||
|
rm -f "$out/lib/${python.libPrefix}"/site-packages/site.py*
|
||||||
''
|
''
|
||||||
|
|
||||||
, buildPhase ? "true"
|
, buildPhase ? "true"
|
||||||
@ -45,6 +59,8 @@ python.stdenv.mkDerivation (attrs // {
|
|||||||
|
|
||||||
buildInputs = [ python wrapPython setuptools ] ++ buildInputs ++ pythonPath;
|
buildInputs = [ python wrapPython setuptools ] ++ buildInputs ++ pythonPath;
|
||||||
|
|
||||||
|
buildInputStrings = map toString buildInputs;
|
||||||
|
|
||||||
pythonPath = [ setuptools] ++ pythonPath;
|
pythonPath = [ setuptools] ++ pythonPath;
|
||||||
|
|
||||||
# XXX: Should we run `easy_install --always-unzip'? It doesn't seem
|
# XXX: Should we run `easy_install --always-unzip'? It doesn't seem
|
||||||
@ -70,5 +86,12 @@ python.stdenv.mkDerivation (attrs // {
|
|||||||
if test -e $out/nix-support/propagated-build-inputs; then
|
if test -e $out/nix-support/propagated-build-inputs; then
|
||||||
ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages
|
ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
createBuildInputsPth build-inputs "$buildInputStrings"
|
||||||
|
for inputsfile in propagated-build-inputs propagated-build-native-inputs; do
|
||||||
|
if test -e $out/nix-support/$inputsfile; then
|
||||||
|
createBuildInputsPth $inputsfile "$(cat $out/nix-support/$inputsfile)"
|
||||||
|
fi
|
||||||
|
done
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
@ -45,3 +45,16 @@ _addToPythonPath() {
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
createBuildInputsPth() {
|
||||||
|
local category="$1"
|
||||||
|
local inputs="$2"
|
||||||
|
if [ foo"$inputs" != foo ]; then
|
||||||
|
for x in $inputs; do
|
||||||
|
if test -d "$x"/lib/@libPrefix@/site-packages; then
|
||||||
|
echo $x/lib/@libPrefix@/site-packages \
|
||||||
|
>> "$out"/lib/@libPrefix@/site-packages/${name}-nix-python-$category.pth
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user