python: add isPy2 attribute to passthru
Some packages relied on it. For consistency, also introduce isPy3 (which is the same as isPy3k).
This commit is contained in:
parent
29ee864e93
commit
63bcd07888
|
@ -27,7 +27,9 @@ with pkgs;
|
||||||
isPy35 = pythonVersion == "3.5";
|
isPy35 = pythonVersion == "3.5";
|
||||||
isPy36 = pythonVersion == "3.6";
|
isPy36 = pythonVersion == "3.6";
|
||||||
isPy37 = pythonVersion == "3.7";
|
isPy37 = pythonVersion == "3.7";
|
||||||
isPy3k = lib.strings.substring 0 1 pythonVersion == "3";
|
isPy2 = lib.strings.substring 0 1 pythonVersion == "2";
|
||||||
|
isPy3 = lib.strings.substring 0 1 pythonVersion == "3";
|
||||||
|
isPy3k = isPy3;
|
||||||
isPyPy = interpreter == "pypy";
|
isPyPy = interpreter == "pypy";
|
||||||
|
|
||||||
buildEnv = callPackage ./wrapper.nix { python = self; inherit (pythonPackages) requiredPythonModules; };
|
buildEnv = callPackage ./wrapper.nix { python = self; inherit (pythonPackages) requiredPythonModules; };
|
||||||
|
|
|
@ -45,7 +45,7 @@ buildPythonPackage rec {
|
||||||
++ stdenv.lib.optionals enableGtk3 [ cairo pycairo gtk3 gobject-introspection pygobject3 ]
|
++ stdenv.lib.optionals enableGtk3 [ cairo pycairo gtk3 gobject-introspection pygobject3 ]
|
||||||
++ stdenv.lib.optionals enableTk [ tcl tk tkinter libX11 ]
|
++ stdenv.lib.optionals enableTk [ tcl tk tkinter libX11 ]
|
||||||
++ stdenv.lib.optionals enableQt [ pyqt4 ]
|
++ stdenv.lib.optionals enableQt [ pyqt4 ]
|
||||||
++ stdenv.lib.optionals (builtins.hasAttr "isPy2" python) [ functools32 subprocess32 ];
|
++ stdenv.lib.optionals python.isPy2 [ functools32 subprocess32 ];
|
||||||
|
|
||||||
patches =
|
patches =
|
||||||
[ ./basedirlist.patch ] ++
|
[ ./basedirlist.patch ] ++
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
, ruby, php-embed, mysql
|
, ruby, php-embed, mysql
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let pythonPlugin = pkg : lib.nameValuePair "python${if pkg ? isPy2 then "2" else "3"}" {
|
let pythonPlugin = pkg : lib.nameValuePair "python${if pkg.isPy2 then "2" else "3"}" {
|
||||||
interpreter = pkg.interpreter;
|
interpreter = pkg.interpreter;
|
||||||
path = "plugins/python";
|
path = "plugins/python";
|
||||||
inputs = [ pkg ncurses ];
|
inputs = [ pkg ncurses ];
|
||||||
|
|
Loading…
Reference in a new issue