python: 3.4.1 -> 3.4.2

This commit is contained in:
Domen Kožar 2014-10-08 13:43:36 +02:00
parent 0723adfa26
commit 9aeb10fa12
2 changed files with 2 additions and 90 deletions

View File

@ -18,7 +18,7 @@ with stdenv.lib;
let
majorVersion = "3.4";
version = "${majorVersion}.1";
version = "${majorVersion}.2";
fullVersion = "${version}";
buildInputs = filter (p: p != null) [
@ -31,13 +31,11 @@ stdenv.mkDerivation {
src = fetchurl {
url = "http://www.python.org/ftp/python/${version}/Python-${fullVersion}.tar.xz";
sha256 = "1i7dgbzyvj24i6gfhb5q2zwr9nn1ni6w1ig1rcgh96a321is35f5";
sha256 = "1vrd9gqdqw7rw0kiiprqvng7ywnfc2hbyys7gr9mdh25s619cv8w";
};
NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s";
patches = [ ./issue21121-3.patch ];
preConfigure = ''
for i in /usr /sw /opt /pkg; do # improve purity
substituteInPlace ./setup.py --replace $i /no-such-path

View File

@ -1,86 +0,0 @@
diff --git a/Makefile.pre.in b/Makefile.pre.in
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -71,12 +71,17 @@
BASECFLAGS= @BASECFLAGS@
BASECPPFLAGS= @BASECPPFLAGS@
CONFIGURE_CFLAGS= @CFLAGS@
+# CFLAGS_NODIST is used for building the interpreter and stdlib C extensions.
+# Use it when a compiler flag should _not_ be part of the distutils CFLAGS
+# once Python is installed (Issue #21121).
+CONFIGURE_CFLAGS_NODIST=@CFLAGS_NODIST@
CONFIGURE_CPPFLAGS= @CPPFLAGS@
CONFIGURE_LDFLAGS= @LDFLAGS@
# Avoid assigning CFLAGS, LDFLAGS, etc. so users can use them on the
# command line to append to these values without stomping the pre-set
# values.
PY_CFLAGS= $(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
+PY_CFLAGS_NODIST=$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST)
# Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to
# be able to build extension modules using the directories specified in the
# environment variables
@@ -91,7 +96,7 @@
# Extra C flags added for building the interpreter object files.
CFLAGSFORSHARED=@CFLAGSFORSHARED@
# C flags used for building the interpreter object files
-PY_CORE_CFLAGS= $(PY_CFLAGS) $(PY_CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
+PY_CORE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
# Machine-dependent subdirectories
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -662,6 +662,7 @@
LIBTOOL_CRUFT
OTHER_LIBTOOL_OPT
UNIVERSAL_ARCH_FLAGS
+CFLAGS_NODIST
BASECFLAGS
OPT
ABIFLAGS
@@ -6504,7 +6505,7 @@
if test $ac_cv_declaration_after_statement_warning = yes
then
- BASECFLAGS="$BASECFLAGS -Werror=declaration-after-statement"
+ CFLAGS_NODIST="$CFLAGS_NODIST -Werror=declaration-after-statement"
fi
# if using gcc on alpha, use -mieee to get (near) full IEEE 754
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1147,6 +1147,7 @@
fi
AC_SUBST(BASECFLAGS)
+AC_SUBST(CFLAGS_NODIST)
# The -arch flags for universal builds on OSX
UNIVERSAL_ARCH_FLAGS=
@@ -1231,7 +1232,7 @@
if test $ac_cv_declaration_after_statement_warning = yes
then
- BASECFLAGS="$BASECFLAGS -Werror=declaration-after-statement"
+ CFLAGS_NODIST="$CFLAGS_NODIST -Werror=declaration-after-statement"
fi
# if using gcc on alpha, use -mieee to get (near) full IEEE 754
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -19,6 +19,12 @@
cross_compiling = "_PYTHON_HOST_PLATFORM" in os.environ
+# Add special CFLAGS reserved for building the interpreter and the stdlib
+# modules (Issue #21121).
+cflags = sysconfig.get_config_var('CFLAGS')
+py_cflags_nodist = sysconfig.get_config_var('PY_CFLAGS_NODIST')
+sysconfig.get_config_vars()['CFLAGS'] = cflags + ' ' + py_cflags_nodist
+
def get_platform():
# cross build
if "_PYTHON_HOST_PLATFORM" in os.environ: