Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pkgs/development/interpreters/python/pypy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this if .... maybe be moved into the passthru.sitePackages?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that's possible in this context/how sitePackages is used throughout the tree?


runHook postInstall
'';
Expand Down