From 4d675a283ef162ccfcb5c27ccce78d49edb1a916 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Thu, 5 Nov 2009 13:44:30 +0000 Subject: [PATCH] pkgs/development/interpreters/python/2.6/default.nix: fixed build on Darwin svn path=/nixpkgs/trunk/; revision=18136 --- pkgs/development/interpreters/python/2.6/default.nix | 10 +++++----- pkgs/os-specific/darwin/sw_vers/builder.sh | 3 +++ pkgs/os-specific/darwin/sw_vers/default.nix | 8 ++++++++ pkgs/top-level/all-packages.nix | 5 +++++ 4 files changed, 21 insertions(+), 5 deletions(-) create mode 100755 pkgs/os-specific/darwin/sw_vers/builder.sh create mode 100644 pkgs/os-specific/darwin/sw_vers/default.nix diff --git a/pkgs/development/interpreters/python/2.6/default.nix b/pkgs/development/interpreters/python/2.6/default.nix index 7867ccc8cf19..139d4c429da5 100644 --- a/pkgs/development/interpreters/python/2.6/default.nix +++ b/pkgs/development/interpreters/python/2.6/default.nix @@ -9,11 +9,13 @@ , libX11 ? null , xproto ? null , arch ? null +, sw_vers ? null }: assert zlibSupport -> zlib != null; assert gdbmSupport -> gdbm != null; assert stdenv.isDarwin -> arch != null; +assert stdenv.isDarwin -> sw_vers != null; with stdenv.lib; @@ -36,6 +38,7 @@ let ++ optional (libX11 != null) libX11 ++ optional (xproto != null) xproto ++ optional (arch != null) arch + ++ optional (sw_vers != null) sw_vers ; in @@ -56,7 +59,7 @@ stdenv.mkDerivation ( { inherit buildInputs; C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs); LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs); - configureFlags = ''${if stdenv.isDarwin then "" else " --enable-shared"} --with-threads --enable-unicode --with-wctype-functions''; + configureFlags = "--enable-shared --with-threads --enable-unicode --with-wctype-functions"; preConfigure = '' # Purity. @@ -84,9 +87,6 @@ stdenv.mkDerivation ( { }; meta = { - # List of supported platforms. - # - On Darwin, `python.exe' fails with "Bus Error". - # platforms = stdenv.lib.platforms.allBut "i686-darwin"; - # Re-enabled for 2.6 to see whether the problem still occurs. + platforms = stdenv.lib.platforms; }; } // (if stdenv.system == "i686-darwin" then { NIX_CFLAGS_COMPILE = "-msse2" ; patches = [./search-path.patch]; } else {} ) ) diff --git a/pkgs/os-specific/darwin/sw_vers/builder.sh b/pkgs/os-specific/darwin/sw_vers/builder.sh new file mode 100755 index 000000000000..51e34e79aea3 --- /dev/null +++ b/pkgs/os-specific/darwin/sw_vers/builder.sh @@ -0,0 +1,3 @@ +source $stdenv/setup +mkdir -p "$out/bin" +ln -s /usr/bin/sw_vers "$out/bin/" diff --git a/pkgs/os-specific/darwin/sw_vers/default.nix b/pkgs/os-specific/darwin/sw_vers/default.nix new file mode 100644 index 000000000000..bf99c01686a7 --- /dev/null +++ b/pkgs/os-specific/darwin/sw_vers/default.nix @@ -0,0 +1,8 @@ +{stdenv}: + +assert stdenv.isDarwin; + +stdenv.mkDerivation { + name = "darwin-sw-vers-utility"; + builder = ./builder.sh; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bec7169b6648..ce15d38bb24f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -415,6 +415,10 @@ let inherit stdenv; }; + darwinSwVersUtility = import ../os-specific/darwin/sw_vers { + inherit stdenv; + }; + acct = import ../tools/system/acct { inherit fetchurl stdenv; }; @@ -2428,6 +2432,7 @@ let python26Base = composedArgsAndFun (import ../development/interpreters/python/2.6) { inherit fetchurl stdenv zlib bzip2 gdbm; arch = if stdenv.isDarwin then darwinArchUtility else null; + sw_vers = if stdenv.isDarwin then darwinSwVersUtility else null; }; python26Full = python26Base.passthru.function {