summary refs log tree commit diff
path: root/pkgs/development/interpreters/python
diff options
context:
space:
mode:
authorJan Malakhovski <oxij@oxij.org>2015-03-19 00:50:56 +0000
committerJan Malakhovski <oxij@oxij.org>2015-03-29 23:30:39 +0000
commita3e00bf6c4531e169621a7a0deedb3015f3fc0cb (patch)
tree1e5325c13bc51ffec2daa896919d0db0ddee3154 /pkgs/development/interpreters/python
parenteb22e54243cbd7e63f17a56a6bb73526d8112ed2 (diff)
downloadnixlib-a3e00bf6c4531e169621a7a0deedb3015f3fc0cb.tar
nixlib-a3e00bf6c4531e169621a7a0deedb3015f3fc0cb.tar.gz
nixlib-a3e00bf6c4531e169621a7a0deedb3015f3fc0cb.tar.bz2
nixlib-a3e00bf6c4531e169621a7a0deedb3015f3fc0cb.tar.lz
nixlib-a3e00bf6c4531e169621a7a0deedb3015f3fc0cb.tar.xz
nixlib-a3e00bf6c4531e169621a7a0deedb3015f3fc0cb.tar.zst
nixlib-a3e00bf6c4531e169621a7a0deedb3015f3fc0cb.zip
python 2.7: add x11Support option
Diffstat (limited to 'pkgs/development/interpreters/python')
-rw-r--r--pkgs/development/interpreters/python/2.7/default.nix30
1 files changed, 25 insertions, 5 deletions
diff --git a/pkgs/development/interpreters/python/2.7/default.nix b/pkgs/development/interpreters/python/2.7/default.nix
index 0d7490d910c1..8b24fe004631 100644
--- a/pkgs/development/interpreters/python/2.7/default.nix
+++ b/pkgs/development/interpreters/python/2.7/default.nix
@@ -1,7 +1,19 @@
-{ stdenv, fetchurl, zlib ? null, zlibSupport ? true, bzip2, includeModules ? false
-, sqlite, tcl, tk, x11, openssl, readline, db, ncurses, gdbm, libX11, self, callPackage }:
+{ stdenv, fetchurl, self, callPackage
+, bzip2, openssl
+
+, includeModules ? false
+
+, db, gdbm, ncurses, sqlite, readline
+
+, tcl ? null, tk ? null, x11 ? null, libX11 ? null, x11Support ? true
+, zlib ? null, zlibSupport ? true
+}:
 
 assert zlibSupport -> zlib != null;
+assert x11Support -> tcl != null
+                  && tk != null
+                  && x11 != null
+                  && libX11 != null;
 
 with stdenv.lib;
 
@@ -28,7 +40,7 @@ let
       # if DETERMINISTIC_BUILD env var is set
       ./deterministic-build.patch
     ];
-    
+
   preConfigure = ''
       # Purity.
       for i in /usr /sw /opt /pkg; do
@@ -48,7 +60,11 @@ let
 
   buildInputs =
     optional (stdenv ? cc && stdenv.cc.libc != null) stdenv.cc.libc ++
-    [ bzip2 openssl ] ++ optionals includeModules [ db openssl ncurses gdbm libX11 readline x11 tcl tk sqlite ]
+    [ bzip2 openssl ]
+    ++ optionals includeModules (
+        [ db gdbm ncurses sqlite readline
+        ] ++ optionals x11Support [ tcl tk x11 libX11 ]
+    )
     ++ optional zlibSupport zlib;
 
   # Build the basic Python interpreter without modules that have
@@ -87,7 +103,7 @@ let
         ln -s $out/share/man/man1/{python2.7.1.gz,python.1.gz}
 
         paxmark E $out/bin/python${majorVersion}
-        
+
         ${ optionalString includeModules "$out/bin/python ./setup.py build_ext"}
       '';
 
@@ -192,11 +208,15 @@ let
       deps = [ sqlite ];
     };
 
+  } // optionalAttrs x11Support {
+
     tkinter = buildInternalPythonModule {
       moduleName = "tkinter";
       deps = [ tcl tk x11 libX11 ];
     };
 
+  } // {
+
     readline = buildInternalPythonModule {
       moduleName = "readline";
       internalName = "readline";