aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/interpreters/python/cpython/2.7/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/interpreters/python/cpython/2.7/default.nix')
-rw-r--r--nixpkgs/pkgs/development/interpreters/python/cpython/2.7/default.nix17
1 files changed, 14 insertions, 3 deletions
diff --git a/nixpkgs/pkgs/development/interpreters/python/cpython/2.7/default.nix b/nixpkgs/pkgs/development/interpreters/python/cpython/2.7/default.nix
index 696be2136ec..2cfaa69a4c8 100644
--- a/nixpkgs/pkgs/development/interpreters/python/cpython/2.7/default.nix
+++ b/nixpkgs/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
@@ -22,6 +23,7 @@
, sha256
, passthruFun
, static ? false
+, enableOptimizations ? (!stdenv.isDarwin)
}:
assert x11Support -> tcl != null
@@ -85,6 +87,12 @@ 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
+
+ # Patch is likely to go away in the next release (if there is any)
+ ./CVE-2019-20907.patch
] ++ optionals (x11Support && stdenv.isDarwin) [
./use-correct-tcl-tk-on-darwin.patch
] ++ optionals stdenv.isLinux [
@@ -134,7 +142,9 @@ let
--replace 'os.popen(comm)' 'os.popen("${coreutils}/bin/nproc")'
'';
- configureFlags = [
+ configureFlags = optionals enableOptimizations [
+ "--enable-optimizations"
+ ] ++ [
"--enable-shared"
"--with-threads"
"--enable-unicode=ucs${toString ucsEncoding}"
@@ -182,8 +192,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;