about summary refs log tree commit diff
path: root/pkgs/development/interpreters/python/3.4
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2014-09-08 18:24:58 +0200
committerVladimír Čunát <vcunat@gmail.com>2014-09-08 18:24:58 +0200
commit82797f98f2917e164db8691b516ed7f354b40ff4 (patch)
tree4f901da1992cb81e6dd1a259c3c1087afe710699 /pkgs/development/interpreters/python/3.4
parent1e389c976cc5326b08bd166785e643364bb2d8b4 (diff)
parent152ae27aac2a78acee996eb035ef2b40e58bbf9d (diff)
downloadnixlib-82797f98f2917e164db8691b516ed7f354b40ff4.tar
nixlib-82797f98f2917e164db8691b516ed7f354b40ff4.tar.gz
nixlib-82797f98f2917e164db8691b516ed7f354b40ff4.tar.bz2
nixlib-82797f98f2917e164db8691b516ed7f354b40ff4.tar.lz
nixlib-82797f98f2917e164db8691b516ed7f354b40ff4.tar.xz
nixlib-82797f98f2917e164db8691b516ed7f354b40ff4.tar.zst
nixlib-82797f98f2917e164db8691b516ed7f354b40ff4.zip
Merge branch 'staging' into modular-stdenv
Conflicts:
	pkgs/development/interpreters/perl/5.10/setup-hook.sh
	pkgs/development/interpreters/perl/5.8/setup-hook.sh
	pkgs/stdenv/linux/default.nix
Diffstat (limited to 'pkgs/development/interpreters/python/3.4')
-rw-r--r--pkgs/development/interpreters/python/3.4/default.nix2
-rw-r--r--pkgs/development/interpreters/python/3.4/issue21121-3.patch86
2 files changed, 88 insertions, 0 deletions
diff --git a/pkgs/development/interpreters/python/3.4/default.nix b/pkgs/development/interpreters/python/3.4/default.nix
index 3477cedf4b74..312bf247de7c 100644
--- a/pkgs/development/interpreters/python/3.4/default.nix
+++ b/pkgs/development/interpreters/python/3.4/default.nix
@@ -36,6 +36,8 @@ stdenv.mkDerivation {
 
   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
diff --git a/pkgs/development/interpreters/python/3.4/issue21121-3.patch b/pkgs/development/interpreters/python/3.4/issue21121-3.patch
new file mode 100644
index 000000000000..506d9ea9b3d9
--- /dev/null
+++ b/pkgs/development/interpreters/python/3.4/issue21121-3.patch
@@ -0,0 +1,86 @@
+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: