python: add python.withPackages function

Fixes #15801
wip/yesman
Benno Fünfstück 8 years ago
parent 41fa133548
commit c3ed3914bb
  1. 4
      pkgs/development/interpreters/python/2.6/default.nix
  2. 3
      pkgs/development/interpreters/python/2.7/default.nix
  3. 2
      pkgs/development/interpreters/python/3.3/default.nix
  4. 2
      pkgs/development/interpreters/python/3.4/default.nix
  5. 2
      pkgs/development/interpreters/python/3.5/default.nix
  6. 3
      pkgs/development/interpreters/python/with-packages.nix

@ -1,5 +1,6 @@
{ stdenv, fetchurl, zlib ? null, zlibSupport ? true, bzip2, includeModules ? false
, sqlite, tcl, tk, xlibsWrapper, openssl, readline, db, ncurses, gdbm, self, callPackage }:
, sqlite, tcl, tk, xlibsWrapper, openssl, readline, db, ncurses, gdbm, self, callPackage
, python26Packages }:
assert zlibSupport -> zlib != null;
@ -97,6 +98,7 @@ let
isPy2 = true;
isPy26 = true;
buildEnv = callPackage ../wrapper.nix { python = self; };
withPackages = import ../with-packages.nix { inherit buildEnv; pythonPackages = python26Packages; };
libPrefix = "python${majorVersion}";
executable = libPrefix;
sitePackages = "lib/${libPrefix}/site-packages";

@ -1,4 +1,4 @@
{ stdenv, fetchurl, self, callPackage
{ stdenv, fetchurl, self, callPackage, python27Packages
, bzip2, openssl, gettext
, includeModules ? false
@ -151,6 +151,7 @@ let
isPy2 = true;
isPy27 = true;
buildEnv = callPackage ../wrapper.nix { python = self; };
withPackages = import ../with-packages.nix { inherit buildEnv; pythonPackages = python27Packages; };
libPrefix = "python${majorVersion}";
executable = libPrefix;
sitePackages = "lib/${libPrefix}/site-packages";

@ -12,6 +12,7 @@
, zlib
, callPackage
, self
, python33Packages
}:
assert readline != null -> ncurses != null;
@ -81,6 +82,7 @@ stdenv.mkDerivation {
libPrefix = "python${majorVersion}";
executable = "python3.3m";
buildEnv = callPackage ../wrapper.nix { python = self; };
withPackages = import ../with-packages.nix { inherit buildEnv; pythonPackages = python33Packages; };
isPy3 = true;
isPy33 = true;
is_py3k = true; # deprecated

@ -12,6 +12,7 @@
, zlib
, callPackage
, self
, python34Packages
, CF, configd
}:
@ -104,6 +105,7 @@ stdenv.mkDerivation {
libPrefix = "python${majorVersion}";
executable = "python3.4m";
buildEnv = callPackage ../wrapper.nix { python = self; };
withPackages = import ../with-packages.nix { inherit buildEnv; pythonPackages = python34Packages; };
isPy3 = true;
isPy34 = true;
is_py3k = true; # deprecated

@ -12,6 +12,7 @@
, zlib
, callPackage
, self
, python35Packages
, CF, configd
}:
@ -104,6 +105,7 @@ stdenv.mkDerivation {
libPrefix = "python${majorVersion}";
executable = "python${majorVersion}m";
buildEnv = callPackage ../wrapper.nix { python = self; };
withPackages = import ../with-packages.nix { inherit buildEnv; pythonPackages = python35Packages; };
isPy3 = true;
isPy35 = true;
is_py3k = true; # deprecated

@ -0,0 +1,3 @@
{ buildEnv, pythonPackages }:
f: let packages = f pythonPackages; in buildEnv.override { extraLibs = packages; }
Loading…
Cancel
Save