about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2009-11-05 13:44:30 +0000
committerPeter Simons <simons@cryp.to>2009-11-05 13:44:30 +0000
commit4d675a283ef162ccfcb5c27ccce78d49edb1a916 (patch)
tree1b21082e1259bb3051dd472c7779a8b11fac068a /pkgs
parent1981322cc5befc49495b82e18abd62a4e33adcf5 (diff)
downloadnixlib-4d675a283ef162ccfcb5c27ccce78d49edb1a916.tar
nixlib-4d675a283ef162ccfcb5c27ccce78d49edb1a916.tar.gz
nixlib-4d675a283ef162ccfcb5c27ccce78d49edb1a916.tar.bz2
nixlib-4d675a283ef162ccfcb5c27ccce78d49edb1a916.tar.lz
nixlib-4d675a283ef162ccfcb5c27ccce78d49edb1a916.tar.xz
nixlib-4d675a283ef162ccfcb5c27ccce78d49edb1a916.tar.zst
nixlib-4d675a283ef162ccfcb5c27ccce78d49edb1a916.zip
pkgs/development/interpreters/python/2.6/default.nix: fixed build on Darwin
svn path=/nixpkgs/trunk/; revision=18136
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/interpreters/python/2.6/default.nix10
-rwxr-xr-xpkgs/os-specific/darwin/sw_vers/builder.sh3
-rw-r--r--pkgs/os-specific/darwin/sw_vers/default.nix8
-rw-r--r--pkgs/top-level/all-packages.nix5
4 files changed, 21 insertions, 5 deletions
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 {