Skip to content

Commit

Permalink
python3: express references to keep as a nix list
Browse files Browse the repository at this point in the history
  • Loading branch information
FRidh committed Mar 14, 2021
1 parent 5b1abe5 commit 738746a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pkgs/development/interpreters/python/cpython/default.nix
Expand Up @@ -327,7 +327,13 @@ in with passthru; stdenv.mkDerivation {

setupHook = python-setup-hook sitePackages;

postInstall = ''
postInstall = let
# References *not* to nuke from (sys)config files
keep-references = concatMapStringsSep " " (val: "-e ${val}") ([
] ++ optionals tzdataSupport [
tzdata
]);
in ''
# needed for some packages, especially packages that backport functionality
# to 2.x from 3.x
for item in $out/lib/${libPrefix}/test/*; do
Expand Down Expand Up @@ -363,8 +369,8 @@ in with passthru; stdenv.mkDerivation {
done
# Further get rid of references. https://github.com/NixOS/nixpkgs/issues/51668
find $out/lib/python*/config-* -type f -print -exec nuke-refs -e $out ${optionalString tzdataSupport "-e ${tzdata}"} '{}' +
find $out/lib -name '_sysconfigdata*.py*' -print -exec nuke-refs -e $out ${optionalString tzdataSupport "-e ${tzdata}"} '{}' +
find $out/lib/python*/config-* -type f -print -exec nuke-refs ${keep-references} '{}' +
find $out/lib -name '_sysconfigdata*.py*' -print -exec nuke-refs ${keep-references} '{}' +
# Make the sysconfigdata module accessible on PYTHONPATH
# This allows build Python to import host Python's sysconfigdata
Expand Down

1 comment on commit 738746a

@SuperSandro2000
Copy link
Member

Choose a reason for hiding this comment

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

This commit does not eval for me:

error: anonymous function at /home/hotpi/.cache/nixpkgs-review/pr-116347/nixpkgs/pkgs/build-support/fetchurl/boot.nix:5:1 called with unexpected argument 'meta', at /home/hotpi/.cache/nixpkgs-review/pr-116347/nixpkgs/pkgs/build-support/fetchzip/default.nix:17:2

Please sign in to comment.