Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6da245f62adc
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7617b03403ac
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Mar 13, 2021

  1. python39: hardcode path to tzdata

    Python 3.9 has a new module `zoneinfo` which requires tzdata. By default
    it searches TZPATH for folders containing `zoneinfo`.
    
    This commit makes the dependency on tzdata pure.
    FRidh committed Mar 13, 2021
    Copy the full SHA
    7617b03 View commit details
Showing with 10 additions and 3 deletions.
  1. +9 −3 pkgs/development/interpreters/python/cpython/default.nix
  2. +1 −0 pkgs/development/interpreters/python/default.nix
12 changes: 9 additions & 3 deletions pkgs/development/interpreters/python/cpython/default.nix
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
, tcl ? null, tk ? null, tix ? null, libX11 ? null, xorgproto ? null, x11Support ? false
, bluez ? null, bluezSupport ? false
, zlib
, tzdata ? null
, self
, configd
, autoreconfHook
@@ -68,6 +69,8 @@ let
buildPackages = pkgsBuildHost;
inherit (passthru) pythonForBuild;

tzdataSupport = tzdata != null && passthru.pythonAtLeast "3.9";

passthru = passthruFun rec {
inherit self sourceVersion packageOverrides;
implementation = "cpython";
@@ -100,7 +103,8 @@ let
zlib bzip2 expat lzma libffi gdbm sqlite readline ncurses openssl ]
++ optionals x11Support [ tcl tk libX11 xorgproto ]
++ optionals (bluezSupport && stdenv.isLinux) [ bluez ]
++ optionals stdenv.isDarwin [ configd ]);
++ optionals stdenv.isDarwin [ configd ])
++ optionals tzdataSupport [ tzdata ]; # `zoneinfo` module

hasDistutilsCxxPatch = !(stdenv.cc.isGNU or false);

@@ -293,6 +297,8 @@ in with passthru; stdenv.mkDerivation {
# Never even try to use lchmod on linux,
# don't rely on detecting glibc-isms.
"ac_cv_func_lchmod=no"
] ++ optionals tzdataSupport [
"--with-tzpath=${tzdata}/share/zoneinfo"
] ++ optional static "LDFLAGS=-static";

preConfigure = ''
@@ -348,8 +354,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 '{}' +
find $out/lib -name '_sysconfigdata*.py*' -print -exec nuke-refs -e $out '{}' +
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}"} '{}' +
# Make the sysconfigdata module accessible on PYTHONPATH
# This allows build Python to import host Python's sysconfigdata
1 change: 1 addition & 0 deletions pkgs/development/interpreters/python/default.nix
Original file line number Diff line number Diff line change
@@ -199,6 +199,7 @@ in {
gdbm = null;
sqlite = null;
configd = null;
tzdata = null;
stripConfig = true;
stripIdlelib = true;
stripTests = true;