Merge pull request #217558 from winterqt/pypy3-fix-site-packages
pypy3{8,9}: fix sitePackages
This commit is contained in:
@@ -21,13 +21,14 @@ assert zlibSupport -> zlib != null;
|
||||
|
||||
let
|
||||
isPy3k = (lib.versions.major pythonVersion) == "3";
|
||||
isPy38OrNewer = lib.versionAtLeast pythonVersion "3.8";
|
||||
isPy39OrNewer = lib.versionAtLeast pythonVersion "3.9";
|
||||
passthru = passthruFun {
|
||||
passthru = passthruFun rec {
|
||||
inherit self sourceVersion pythonVersion packageOverrides;
|
||||
implementation = "pypy";
|
||||
libPrefix = "pypy${pythonVersion}";
|
||||
executable = "pypy${if isPy39OrNewer then lib.versions.majorMinor pythonVersion else lib.optionalString isPy3k "3"}";
|
||||
sitePackages = "site-packages";
|
||||
sitePackages = "${lib.optionalString isPy38OrNewer "lib/${libPrefix}/"}site-packages";
|
||||
hasDistutilsCxxPatch = false;
|
||||
inherit pythonAttr;
|
||||
|
||||
@@ -122,7 +123,7 @@ in with passthru; stdenv.mkDerivation rec {
|
||||
ln -s $out/${executable}-c/lib-python/${if isPy3k then "3" else pythonVersion} $out/lib/${libPrefix}
|
||||
|
||||
# Include a sitecustomize.py file
|
||||
cp ${../sitecustomize.py} $out/lib/${libPrefix}/${sitePackages}/sitecustomize.py
|
||||
cp ${../sitecustomize.py} $out/${if isPy38OrNewer then sitePackages else "lib/${libPrefix}/${sitePackages}"}/sitecustomize.py
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user