diff options
author | Frederik Rietdijk <freddyrietdijk@fridh.nl> | 2020-06-04 18:31:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-04 18:31:07 +0200 |
commit | a2be64bf13bf23c69f5e67401bab96408cfd75cb (patch) | |
tree | dd2d29a8b6031c95391fa1bcf440032034dacb2a /pkgs/development/interpreters/python/cpython/2.7/default.nix | |
parent | d2d070015b6daefc7dd5428b88cbfdca5de8d562 (diff) | |
parent | 480c8d199166b2f8cd20e6e245d8a019329ec466 (diff) |
Merge pull request #84072 from gnprice/python-build
cpython: Use optimizations, for a 25% speedup.
Diffstat (limited to 'pkgs/development/interpreters/python/cpython/2.7/default.nix')
-rw-r--r-- | pkgs/development/interpreters/python/cpython/2.7/default.nix | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix index 696be2136ecce..0e9a790237fe8 100644 --- a/pkgs/development/interpreters/python/cpython/2.7/default.nix +++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix @@ -12,6 +12,7 @@ , zlib , self , configd, coreutils +, autoreconfHook , python-setup-hook # Some proprietary libs assume UCS2 unicode, especially on darwin :( , ucsEncoding ? 4 @@ -85,6 +86,9 @@ let # backported in debian since 2013. # https://bugs.python.org/issue13146 ./atomic_pyc.patch + + # Backport from CPython 3.8 of a good list of tests to run for PGO. + ./profile-task.patch ] ++ optionals (x11Support && stdenv.isDarwin) [ ./use-correct-tcl-tk-on-darwin.patch ] ++ optionals stdenv.isLinux [ @@ -96,6 +100,13 @@ let # libuuid, slowing down program startup a lot). ./no-ldconfig.patch + # Optimize symbol tables for the sake of dynamic linking. + # Significant for Python because of extension modules. + (fetchpatch { + url = "https://salsa.debian.org/cpython-team/python3/-/raw/27103a32e/debian/patches/link-opt.diff"; + sha256 = "0vp36276ndbrwr7882vg7vjd61c8mv7bqgal6bbh2fimp6zlkdhv"; + }) + ] ++ optionals stdenv.hostPlatform.isCygwin [ ./2.5.2-ctypes-util-find_library.patch ./2.5.2-tkinter-x11.patch @@ -135,6 +146,7 @@ let ''; configureFlags = [ + "--enable-optimizations" "--enable-shared" "--with-threads" "--enable-unicode=ucs${toString ucsEncoding}" @@ -182,8 +194,9 @@ let ++ optionals x11Support [ tcl tk xlibsWrapper libX11 ] ++ optional (stdenv.isDarwin && configd != null) configd; nativeBuildInputs = - optionals (stdenv.hostPlatform != stdenv.buildPlatform) - [ buildPackages.stdenv.cc buildPackages.python ]; + [ autoreconfHook ] + ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) + [ buildPackages.stdenv.cc buildPackages.python ]; mkPaths = paths: { C_INCLUDE_PATH = makeSearchPathOutput "dev" "include" paths; |