diff --git a/pkgs/development/interpreters/python/2.6/default.nix b/pkgs/development/interpreters/python/2.6/default.nix index fc1323234ab..ba60f6057c6 100644 --- a/pkgs/development/interpreters/python/2.6/default.nix +++ b/pkgs/development/interpreters/python/2.6/default.nix @@ -8,10 +8,12 @@ , tcl ? null , libX11 ? null , xproto ? null +, arch ? null }: assert zlibSupport -> zlib != null; assert gdbmSupport -> gdbm != null; +assert stdenv.isDarwin -> arch != null; with stdenv.lib; @@ -30,6 +32,7 @@ let ++ optional (tcl != null) tcl ++ optional (libX11 != null) libX11 ++ optional (xproto != null) xproto + ++ optional (arch != null) arch ; in @@ -50,7 +53,7 @@ stdenv.mkDerivation ( { inherit buildInputs; C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs); LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs); - configureFlags = "--enable-shared --with-wctype-functions"; + configureFlags = ''${if stdenv.isDarwin then "" else " --enable-shared"} --with-wctype-functions''; preConfigure = '' # Purity. @@ -83,4 +86,4 @@ stdenv.mkDerivation ( { # platforms = stdenv.lib.platforms.allBut "i686-darwin"; # Re-enabled for 2.6 to see whether the problem still occurs. }; -} // (if stdenv.system == "i686-darwin" then { NIX_CFLAGS_COMPILE = "-msse2" ; patches = [./search-path.patch ./nolongdouble.patch]; } else {} ) ) +} // (if stdenv.system == "i686-darwin" then { NIX_CFLAGS_COMPILE = "-msse2" ; patches = [./search-path.patch]; } else {} ) ) diff --git a/pkgs/development/interpreters/python/2.6/nolongdouble.patch b/pkgs/development/interpreters/python/2.6/nolongdouble.patch deleted file mode 100644 index 8fb53da3d49..00000000000 --- a/pkgs/development/interpreters/python/2.6/nolongdouble.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -rc Python-2.5.4/configure Python-2.5.4-new/configure -*** Python-2.5.4/configure Sat Dec 13 15:13:52 2008 ---- Python-2.5.4-new/configure Fri Jul 24 16:38:05 2009 -*************** -*** 4534,4540 **** - ;; - # is there any other compiler on Darwin besides gcc? - Darwin*) -! BASECFLAGS="$BASECFLAGS -Wno-long-double -no-cpp-precomp -mno-fused-madd" - if test "${enable_universalsdk}"; then - BASECFLAGS="-arch ppc -arch i386 -isysroot ${UNIVERSALSDK} ${BASECFLAGS}" - fi ---- 4534,4540 ---- - ;; - # is there any other compiler on Darwin besides gcc? - Darwin*) -! BASECFLAGS="$BASECFLAGS -no-cpp-precomp -mno-fused-madd" - if test "${enable_universalsdk}"; then - BASECFLAGS="-arch ppc -arch i386 -isysroot ${UNIVERSALSDK} ${BASECFLAGS}" - fi diff --git a/pkgs/os-specific/darwin/arch/builder.sh b/pkgs/os-specific/darwin/arch/builder.sh new file mode 100755 index 00000000000..1fb8be484ba --- /dev/null +++ b/pkgs/os-specific/darwin/arch/builder.sh @@ -0,0 +1,3 @@ +source $stdenv/setup +mkdir -p "$out/bin" +ln -s /usr/bin/arch "$out/bin/" diff --git a/pkgs/os-specific/darwin/arch/default.nix b/pkgs/os-specific/darwin/arch/default.nix new file mode 100644 index 00000000000..59d00eaf2d1 --- /dev/null +++ b/pkgs/os-specific/darwin/arch/default.nix @@ -0,0 +1,8 @@ +{stdenv}: + +assert stdenv.isDarwin; + +stdenv.mkDerivation { + name = "darwin-arch-utility"; + builder = ./builder.sh; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b32bd089e0f..0ae0e348f0b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -410,6 +410,9 @@ let ### TOOLS + darwinArchUtility = import ../os-specific/darwin/arch { + inherit stdenv; + }; acct = import ../tools/system/acct { inherit fetchurl stdenv; @@ -2408,6 +2411,7 @@ let python26Base = composedArgsAndFun (import ../development/interpreters/python/2.6) { inherit fetchurl stdenv zlib bzip2 gdbm; + arch = if stdenv.isDarwin then darwinArchUtility else null; }; python26Full = python26Base.passthru.function {