Merge remote-tracking branch 'origin/master' into stdenv-updates
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
(http://pypi.python.org/pypi/setuptools/), which represents a large
|
||||
number of Python packages nowadays. */
|
||||
|
||||
{ python, setuptools, wrapPython, lib, offlineDistutils, setuptoolsSite }:
|
||||
{ python, setuptools, wrapPython, lib, offlineDistutils, recursivePthLoader }:
|
||||
|
||||
{ name, namePrefix ? "python-"
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
''
|
||||
easy_install --always-unzip --prefix="$out" .
|
||||
''
|
||||
|
||||
|
||||
, preConfigure ? "true"
|
||||
|
||||
, buildPhase ? "true"
|
||||
@@ -48,16 +48,14 @@ python.stdenv.mkDerivation (attrs // {
|
||||
|
||||
name = namePrefix + name;
|
||||
|
||||
# checkPhase after installPhase to run tests on installed packages
|
||||
phases = "unpackPhase patchPhase configurePhase buildPhase installPhase checkPhase fixupPhase distPhase";
|
||||
|
||||
buildInputs = [ python wrapPython setuptools ] ++ buildInputs ++ pythonPath;
|
||||
|
||||
# setuptoolsSite is responsible for loading pth files
|
||||
propagatedBuildInputs = propagatedBuildInputs ++ [ setuptoolsSite ];
|
||||
propagatedBuildInputs = propagatedBuildInputs ++ [ recursivePthLoader ];
|
||||
|
||||
buildInputStrings = map toString buildInputs;
|
||||
|
||||
pythonPath = [ setuptools] ++ pythonPath;
|
||||
pythonPath = [ setuptools ] ++ pythonPath;
|
||||
|
||||
preConfigure = ''
|
||||
PYTHONPATH="${offlineDistutils}/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
|
||||
@@ -83,9 +81,7 @@ python.stdenv.mkDerivation (attrs // {
|
||||
# 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.
|
||||
#
|
||||
# leave them until we have a better solution: see #209
|
||||
#rm -f "$out/lib/${python.libPrefix}"/site-packages/site.py*
|
||||
rm -f "$out/lib/${python.libPrefix}"/site-packages/site.py*
|
||||
|
||||
${postInstall}
|
||||
'';
|
||||
|
||||
@@ -51,6 +51,9 @@ createBuildInputsPth() {
|
||||
local inputs="$2"
|
||||
if [ foo"$inputs" != foo ]; then
|
||||
for x in $inputs; do
|
||||
if $(echo -n $x |grep -q python-recursive-pth-loader); then
|
||||
continue
|
||||
fi
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user