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.
This commit is contained in:
parent
8dadb44196
commit
31e32b6d9e
@ -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}";
|
||||
|
@ -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}";
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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}";
|
||||
|
@ -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
|
||||
|
@ -1,6 +1,9 @@
|
||||
{ stdenv, fetchurl, zlib ? null, zlibSupport ? true, bzip2, pkgconfig, libffi
|
||||
, sqlite, openssl, ncurses, python, expat, tcl, tk, xlibsWrapper, libX11
|
||||
, makeWrapper, callPackage, self, pypyPackages, gdbm, db }:
|
||||
, makeWrapper, callPackage, self, gdbm, db
|
||||
# For the Python package set
|
||||
, pkgs, packageOverrides ? (self: super: {})
|
||||
}:
|
||||
|
||||
assert zlibSupport -> zlib != null;
|
||||
|
||||
@ -120,14 +123,17 @@ let
|
||||
echo "manylinux1_compatible=False" >> $out/lib/${libPrefix}/_manylinux.py
|
||||
'';
|
||||
|
||||
passthru = rec {
|
||||
passthru = let
|
||||
pythonPackages = callPackage ../../../../../top-level/python-packages.nix {python=self; overrides=packageOverrides;};
|
||||
in rec {
|
||||
inherit zlibSupport libPrefix;
|
||||
executable = "pypy";
|
||||
isPypy = true;
|
||||
buildEnv = callPackage ../../wrapper.nix { python = self; };
|
||||
interpreter = "${self}/bin/${executable}";
|
||||
sitePackages = "site-packages";
|
||||
withPackages = import ../../with-packages.nix { inherit buildEnv; pythonPackages = pypyPackages; };
|
||||
withPackages = import ../../with-packages.nix { inherit buildEnv pythonPackages;};
|
||||
pkgs = pythonPackages;
|
||||
};
|
||||
|
||||
enableParallelBuilding = true; # almost no parallelization without STM
|
||||
|
@ -9895,33 +9895,19 @@ in
|
||||
# Therefore we do not recurse into attributes here, in contrast to
|
||||
# python27Packages. `nix-env -iA python26Packages.nose` works
|
||||
# regardless.
|
||||
python26Packages = callPackage ./python-packages.nix {
|
||||
python = python26;
|
||||
};
|
||||
python26Packages = python26.pkgs;
|
||||
|
||||
python27Packages = lib.hiPrioSet (recurseIntoAttrs (callPackage ./python-packages.nix {
|
||||
python = python27;
|
||||
}));
|
||||
python27Packages = lib.hiPrioSet (recurseIntoAttrs python27.pkgs);
|
||||
|
||||
python33Packages = callPackage ./python-packages.nix {
|
||||
python = python33;
|
||||
};
|
||||
python33Packages = python33.pkgs;
|
||||
|
||||
python34Packages = callPackage ./python-packages.nix {
|
||||
python = python34;
|
||||
};
|
||||
python34Packages = python34.pkgs;
|
||||
|
||||
python35Packages = recurseIntoAttrs (callPackage ./python-packages.nix {
|
||||
python = python35;
|
||||
});
|
||||
python35Packages = recurseIntoAttrs python35.pkgs;
|
||||
|
||||
python36Packages = (callPackage ./python-packages.nix {
|
||||
python = python36;
|
||||
});
|
||||
python36Packages = python36.pkgs;
|
||||
|
||||
pypyPackages = callPackage ./python-packages.nix {
|
||||
python = pypy;
|
||||
};
|
||||
pypyPackages = pypy.pkgs;
|
||||
|
||||
### DEVELOPMENT / R MODULES
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user