diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix index db86b67835e3..62aae7b22129 100644 --- a/pkgs/development/interpreters/python/cpython/2.7/default.nix +++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix @@ -23,6 +23,7 @@ , sha256 , passthruFun , static ? false +, enableOptimizations ? (!stdenv.isDarwin) }: assert x11Support -> tcl != null @@ -138,8 +139,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}" diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index ee77185cde65..694f661a9669 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -31,7 +31,9 @@ , stripBytecode ? false , includeSiteCustomize ? true , static ? false -, enableOptimizations ? true +# Not using optimizations on Darwin +# configure: error: llvm-profdata is required for a --enable-optimizations build but could not be found. +, enableOptimizations ? (!stdenv.isDarwin) }: assert x11Support -> tcl != null @@ -54,8 +56,9 @@ let version = with sourceVersion; "${major}.${minor}.${patch}${suffix}"; - nativeBuildInputs = [ + nativeBuildInputs = optionals (!stdenv.isDarwin) [ autoreconfHook + ] ++ [ nukeReferences ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ buildPackages.stdenv.cc