diff options
author | Frederik Rietdijk <fridh@fridh.nl> | 2016-12-04 09:51:12 +0100 |
---|---|---|
committer | Frederik Rietdijk <fridh@fridh.nl> | 2016-12-05 09:43:44 +0100 |
commit | 31e32b6d9ee2712966e2b09a68d4f783c164ddd3 (patch) | |
tree | 26444beedfc7d12bac87dc473a442de8a76bd125 /pkgs/development/interpreters/python/cpython | |
parent | 8dadb44196a07f6b4ab42b16fdb64f2fcc3fc94c (diff) | |
download | nixlib-31e32b6d9ee2712966e2b09a68d4f783c164ddd3.tar nixlib-31e32b6d9ee2712966e2b09a68d4f783c164ddd3.tar.gz nixlib-31e32b6d9ee2712966e2b09a68d4f783c164ddd3.tar.bz2 nixlib-31e32b6d9ee2712966e2b09a68d4f783c164ddd3.tar.lz nixlib-31e32b6d9ee2712966e2b09a68d4f783c164ddd3.tar.xz nixlib-31e32b6d9ee2712966e2b09a68d4f783c164ddd3.tar.zst nixlib-31e32b6d9ee2712966e2b09a68d4f783c164ddd3.zip |
Python interpreters: add pkgs attribute
A package set is constructed for a specific interpreter. Therefore, we add the possibility to override the package set to the interpreter. This should make it easier to override the interpreter and the package set at the same time.
Diffstat (limited to 'pkgs/development/interpreters/python/cpython')
6 files changed, 43 insertions, 18 deletions
diff --git a/pkgs/development/interpreters/python/cpython/2.6/default.nix b/pkgs/development/interpreters/python/cpython/2.6/default.nix index 64f2b80d09fa..9a4c2d5b3981 100644 --- a/pkgs/development/interpreters/python/cpython/2.6/default.nix +++ b/pkgs/development/interpreters/python/cpython/2.6/default.nix @@ -1,6 +1,8 @@ { stdenv, fetchurl, zlib ? null, zlibSupport ? true, bzip2, includeModules ? false , sqlite, tcl, tk, xlibsWrapper, openssl, readline, db, ncurses, gdbm, self, callPackage -, python26Packages }: +# For the Python package set +, pkgs, packageOverrides ? (self: super: {}) +}: assert zlibSupport -> zlib != null; @@ -100,13 +102,16 @@ let ${ optionalString includeModules "$out/bin/python ./setup.py build_ext"} ''; - passthru = rec { + passthru = let + pythonPackages = callPackage ../../../../../top-level/python-packages.nix {python=self; overrides=packageOverrides;}; + in rec { inherit libPrefix; inherit zlibSupport; isPy2 = true; isPy26 = true; buildEnv = callPackage ../../wrapper.nix { python = self; }; - withPackages = import ../../with-packages.nix { inherit buildEnv; pythonPackages = python26Packages; }; + withPackages = import ../../with-packages.nix { inherit buildEnv pythonPackages;}; + pkgs = pythonPackages; executable = libPrefix; sitePackages = "lib/${libPrefix}/site-packages"; interpreter = "${self}/bin/${executable}"; diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix index a6eeee25be96..4a25382997c3 100644 --- a/pkgs/development/interpreters/python/cpython/2.7/default.nix +++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix @@ -10,12 +10,13 @@ , zlib , callPackage , self -, python27Packages , gettext , db , expat , libffi , CF, configd, coreutils +# For the Python package set +, pkgs, packageOverrides ? (self: super: {}) }: assert x11Support -> tcl != null @@ -180,11 +181,14 @@ in stdenv.mkDerivation { rm "$out"/lib/python*/plat-*/regen # refers to glibc.dev ''; - passthru = rec { + passthru = let + pythonPackages = callPackage ../../../../../top-level/python-packages.nix {python=self; overrides=packageOverrides;}; + in rec { inherit libPrefix sitePackages x11Support hasDistutilsCxxPatch; executable = libPrefix; buildEnv = callPackage ../../wrapper.nix { python = self; }; - withPackages = import ../../with-packages.nix { inherit buildEnv; pythonPackages = python27Packages; }; + withPackages = import ../../with-packages.nix { inherit buildEnv pythonPackages;}; + pkgs = pythonPackages; isPy2 = true; isPy27 = true; interpreter = "${self}/bin/${executable}"; diff --git a/pkgs/development/interpreters/python/cpython/3.3/default.nix b/pkgs/development/interpreters/python/cpython/3.3/default.nix index b25e2ffd0cb1..6a543a8a0ee0 100644 --- a/pkgs/development/interpreters/python/cpython/3.3/default.nix +++ b/pkgs/development/interpreters/python/cpython/3.3/default.nix @@ -10,8 +10,9 @@ , zlib , callPackage , self -, python33Packages , CF, configd +# For the Python package set +, pkgs, packageOverrides ? (self: super: {}) }: assert x11Support -> tcl != null @@ -102,11 +103,14 @@ in stdenv.mkDerivation { ''; - passthru = rec { + passthru = let + pythonPackages = callPackage ../../../../../top-level/python-packages.nix {python=self; overrides=packageOverrides;}; + in rec { inherit libPrefix sitePackages x11Support; executable = "${libPrefix}m"; buildEnv = callPackage ../../wrapper.nix { python = self; }; - withPackages = import ../../with-packages.nix { inherit buildEnv; pythonPackages = python33Packages; }; + withPackages = import ../../with-packages.nix { inherit buildEnv pythonPackages;}; + pkgs = pythonPackages; isPy3 = true; isPy33 = true; is_py3k = true; # deprecated diff --git a/pkgs/development/interpreters/python/cpython/3.4/default.nix b/pkgs/development/interpreters/python/cpython/3.4/default.nix index 43edce8a44c2..623fa5d74f64 100644 --- a/pkgs/development/interpreters/python/cpython/3.4/default.nix +++ b/pkgs/development/interpreters/python/cpython/3.4/default.nix @@ -10,8 +10,9 @@ , zlib , callPackage , self -, python34Packages , CF, configd +# For the Python package set +, pkgs, packageOverrides ? (self: super: {}) }: assert x11Support -> tcl != null @@ -111,11 +112,14 @@ in stdenv.mkDerivation { ''; - passthru = rec { + passthru = let + pythonPackages = callPackage ../../../../../top-level/python-packages.nix {python=self; overrides=packageOverrides;}; + in rec { inherit libPrefix sitePackages x11Support; executable = "${libPrefix}m"; buildEnv = callPackage ../../wrapper.nix { python = self; }; - withPackages = import ../../with-packages.nix { inherit buildEnv; pythonPackages = python34Packages; }; + withPackages = import ../../with-packages.nix { inherit buildEnv pythonPackages;}; + pkgs = pythonPackages; isPy3 = true; isPy34 = true; is_py3k = true; # deprecated diff --git a/pkgs/development/interpreters/python/cpython/3.5/default.nix b/pkgs/development/interpreters/python/cpython/3.5/default.nix index dd2cce707efe..7172e429f236 100644 --- a/pkgs/development/interpreters/python/cpython/3.5/default.nix +++ b/pkgs/development/interpreters/python/cpython/3.5/default.nix @@ -10,8 +10,9 @@ , zlib , callPackage , self -, python35Packages , CF, configd +# For the Python package set +, pkgs, packageOverrides ? (self: super: {}) }: assert x11Support -> tcl != null @@ -110,11 +111,14 @@ in stdenv.mkDerivation { rm $out/lib/python${majorVersion}/__pycache__/_sysconfigdata.cpython* ''; - passthru = rec { + passthru = let + pythonPackages = callPackage ../../../../../top-level/python-packages.nix {python=self; overrides=packageOverrides;}; + in rec { inherit libPrefix sitePackages x11Support; executable = "${libPrefix}m"; buildEnv = callPackage ../../wrapper.nix { python = self; }; - withPackages = import ../../with-packages.nix { inherit buildEnv; pythonPackages = python35Packages; }; + withPackages = import ../../with-packages.nix { inherit buildEnv pythonPackages;}; + pkgs = pythonPackages; isPy3 = true; isPy35 = true; interpreter = "${self}/bin/${executable}"; diff --git a/pkgs/development/interpreters/python/cpython/3.6/default.nix b/pkgs/development/interpreters/python/cpython/3.6/default.nix index d5960ccde99f..f65989f5bb57 100644 --- a/pkgs/development/interpreters/python/cpython/3.6/default.nix +++ b/pkgs/development/interpreters/python/cpython/3.6/default.nix @@ -11,8 +11,9 @@ , zlib , callPackage , self -, python36Packages , CF, configd +# For the Python package set +, pkgs, packageOverrides ? (self: super: {}) }: assert x11Support -> tcl != null @@ -99,11 +100,14 @@ in stdenv.mkDerivation { ln -s "$out/lib/pkgconfig/python3.pc" "$out/lib/pkgconfig/python.pc" ''; - passthru = rec { + passthru = let + pythonPackages = callPackage ../../../../../top-level/python-packages.nix {python=self; overrides=packageOverrides;}; + in rec { inherit libPrefix sitePackages x11Support; executable = "${libPrefix}m"; buildEnv = callPackage ../../wrapper.nix { python = self; }; - withPackages = import ../../with-packages.nix { inherit buildEnv; pythonPackages = python36Packages; }; + withPackages = import ../../with-packages.nix { inherit buildEnv pythonPackages;}; + pkgs = pythonPackages; isPy3 = true; isPy35 = true; is_py3k = true; # deprecated |