From a7028d3d07dade2305b7a94d39bec208d605617c Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 12 May 2015 17:34:43 +0200 Subject: [PATCH] python2: Pass configureFlags to modules as well. Fixes regression from 086e801d5132bcf9a4e4cac56c361651b7b22ac0. The switch tu UCS-4 only happened for the main Python interpreter and libraries, but the extension modules were using the same source but without any configureFlags, so the extensions still referred to UCS-2 symbols. Tested module builds of Python 2.7 and all modules except crypto fail. Also tested against sqlite3 module of Python 2.6, although for other modules there still seems to be an unrelated build failure with Tcl/Tk libraries, so we might need to fix that later. Signed-off-by: aszlig --- pkgs/development/interpreters/python/2.6/default.nix | 9 +++++---- pkgs/development/interpreters/python/2.7/default.nix | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/pkgs/development/interpreters/python/2.6/default.nix b/pkgs/development/interpreters/python/2.6/default.nix index 10c52e958d8..4e322faf66f 100644 --- a/pkgs/development/interpreters/python/2.6/default.nix +++ b/pkgs/development/interpreters/python/2.6/default.nix @@ -46,6 +46,8 @@ let touch $out/include/python${majorVersion}/pyconfig.h ''; + configureFlags = "--enable-shared --with-threads --enable-unicode=ucs4"; + buildInputs = optional (stdenv ? cc && stdenv.cc.libc != null) stdenv.cc.libc ++ [ bzip2 openssl ]++ optionals includeModules [ db openssl ncurses gdbm readline x11 tcl tk sqlite ] @@ -58,13 +60,12 @@ let name = "python${if includeModules then "" else "-minimal"}-${version}"; pythonVersion = majorVersion; - inherit majorVersion version src patches buildInputs preConfigure; + inherit majorVersion version src patches buildInputs preConfigure + configureFlags; C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs); LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs); - configureFlags = "--enable-shared --with-threads --enable-unicode=ucs4"; - NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin "-msse2"; setupHook = ./setup-hook.sh; @@ -131,7 +132,7 @@ let if includeModules then null else stdenv.mkDerivation rec { name = "python-${moduleName}-${python.version}"; - inherit src patches preConfigure; + inherit src patches preConfigure configureFlags; buildInputs = [ python ] ++ deps; diff --git a/pkgs/development/interpreters/python/2.7/default.nix b/pkgs/development/interpreters/python/2.7/default.nix index e9d9dc6824d..ac9b9d63709 100644 --- a/pkgs/development/interpreters/python/2.7/default.nix +++ b/pkgs/development/interpreters/python/2.7/default.nix @@ -58,6 +58,8 @@ let touch $out/include/python${majorVersion}/pyconfig.h ''; + configureFlags = "--enable-shared --with-threads --enable-unicode=ucs4"; + buildInputs = optional (stdenv ? cc && stdenv.cc.libc != null) stdenv.cc.libc ++ [ bzip2 openssl ] @@ -73,14 +75,13 @@ let name = "python-${version}"; pythonVersion = majorVersion; - inherit majorVersion version src patches buildInputs preConfigure; + inherit majorVersion version src patches buildInputs preConfigure + configureFlags; LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s"; C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs); LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs); - configureFlags = "--enable-shared --with-threads --enable-unicode=ucs4"; - NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin "-msse2"; DETERMINISTIC_BUILD = 1; @@ -149,7 +150,7 @@ let if includeModules then null else stdenv.mkDerivation rec { name = "python-${moduleName}-${python.version}"; - inherit src patches preConfigure; + inherit src patches preConfigure configureFlags; buildInputs = [ python ] ++ deps;