diff options
author | Martin Weinelt <mweinelt@users.noreply.github.com> | 2023-02-26 23:39:27 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-26 23:39:27 +0000 |
commit | 6e78ac978595c4cf4cd2715f54571e178b0f9d6d (patch) | |
tree | a768b670b40e3bf6834c66602b4d9c0ea5847977 | |
parent | 582a3fdb1eddbc0fac19b2d6af10ab1036683762 (diff) | |
parent | e4dd2b8ca0269c0d283f4f74ccfe9bec082b3563 (diff) |
Merge pull request #217558 from winterqt/pypy3-fix-site-packages
pypy3{8,9}: fix sitePackages
-rw-r--r-- | pkgs/development/interpreters/python/pypy/default.nix | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pkgs/development/interpreters/python/pypy/default.nix b/pkgs/development/interpreters/python/pypy/default.nix index eb16bddf16fc..84af77bade9e 100644 --- a/pkgs/development/interpreters/python/pypy/default.nix +++ b/pkgs/development/interpreters/python/pypy/default.nix @@ -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 ''; |