Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python: further migrate packages from 2 to 3 #131719

Merged
merged 47 commits into from
Jul 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
d39767e
blastem: stay with python2
FRidh Jul 27, 2021
1079157
appleseed: use python3
FRidh Jul 27, 2021
e029eba
cassandra: stay with python2
FRidh Jul 27, 2021
250544f
clasp: use python3
FRidh Jul 27, 2021
6882ab1
dtc: python is only used when called from python-packages.nix
FRidh Jul 27, 2021
3bb6cb2
osl: use python3
FRidh Jul 27, 2021
95cdecf
seexpr: stay with python2
FRidh Jul 27, 2021
8fab49c
gdcm: python is only used when called from python-packages.nix
FRidh Jul 27, 2021
03e4fa0
fastnlo_toolkit: python is only used when called from python-packages…
FRidh Jul 27, 2021
f887fbc
boost: python is only used when called from python-packages.nix
FRidh Jul 27, 2021
edd356d
ja2-stracciatella: change to python3
FRidh Jul 27, 2021
9b2b860
gem-config: stay with python2
FRidh Jul 27, 2021
ce7b1fc
hammer: clean up dependencies
FRidh Jul 27, 2021
cf4f947
coccinelle: change to python3
FRidh Jul 27, 2021
41faf39
em-modules: stay with python2
FRidh Jul 27, 2021
9070c34
k3d: stay with python2
FRidh Jul 27, 2021
b793742
libsigrok-0-3-0 -> libsigrok_0_3
FRidh Jul 27, 2021
9695d86
libsigrok: python bindings need additional work so remove python
FRidh Jul 27, 2021
f969760
libsystemtap: python2 is needed
FRidh Jul 27, 2021
4e8d1a8
subunit: use python3
FRidh Jul 27, 2021
4735ed6
linphone: remove unused python parameter
FRidh Jul 27, 2021
af5e969
libtorrent-rasterbar-{1_1_x,1_2_x}: stay with python2
FRidh Jul 27, 2021
857aba2
libtensorflow: refer to python3
FRidh Jul 27, 2021
48d060a
lkl: use python3
FRidh Jul 27, 2021
a313d4c
lvtk: stay with python2
FRidh Jul 27, 2021
fce33c3
lyx: use python3
FRidh Jul 27, 2021
e95ca01
llvmPackages_rocm: use python3
FRidh Jul 27, 2021
53d4f53
mapnik: use python3 for tools
FRidh Jul 27, 2021
c8dc922
matrix-appservice-discord: use python3
FRidh Jul 27, 2021
196d3b8
openjfx11: stay with python2
FRidh Jul 27, 2021
8f6b07c
maxima: use strictDeps and python3
FRidh Jul 27, 2021
6103f78
me_cleaner: stay with python2
FRidh Jul 27, 2021
405307c
menumaker: stay with python2
FRidh Jul 27, 2021
a6284f7
mergerfs-tools: use python3 version of xattr
FRidh Jul 27, 2021
4c61dc3
mididings: stay with python2
FRidh Jul 27, 2021
32ab276
mimms: stay with python2
FRidh Jul 27, 2021
dc04d77
mirtk: use python3
FRidh Jul 27, 2021
afa9c4a
mlt: requires python3
FRidh Jul 27, 2021
9c9f7fd
moosefs: use strictDeps and python3
FRidh Jul 27, 2021
a949d53
python3Packages.subunit: use postPatch
FRidh Jul 27, 2021
6331114
munin: stay with python2
FRidh Jul 27, 2021
56a031d
mygpoclient: use python3 version
FRidh Jul 27, 2021
c7d0306
neard: stay with python2
FRidh Jul 27, 2021
80abab6
nano-wallet: use python3
FRidh Jul 27, 2021
f16520b
opencv4: use python3
FRidh Jul 27, 2021
b3b3107
python interpreters: use correct python when
FRidh Jul 27, 2021
238fa78
mininet: use python3
FRidh Jul 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkgs/applications/audio/mimms/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ fetchurl, lib, pythonPackages, libmms }:
{ fetchurl, lib, python2Packages, libmms }:

pythonPackages.buildPythonApplication rec {
python2Packages.buildPythonApplication rec {
pname = "mimms";
version = "3.2";

Expand Down
6 changes: 4 additions & 2 deletions pkgs/applications/blockchains/nano-wallet/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, wrapQtAppsHook, boost, libGL
, qtbase, python }:
, qtbase, python3 }:

stdenv.mkDerivation rec {

Expand All @@ -16,7 +16,7 @@ stdenv.mkDerivation rec {

cmakeFlags = let
options = {
PYTHON_EXECUTABLE = "${python}/bin/python";
PYTHON_EXECUTABLE = "${python3.interpreter}";
NANO_SHARED_BOOST = "ON";
BOOST_ROOT = boost;
RAIBLOCKS_GUI = "ON";
Expand All @@ -32,6 +32,8 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook ];
buildInputs = [ boost libGL qtbase ];

strictDeps = true;

buildPhase = ''
runHook preBuild
make nano_wallet
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/graphics/k3d/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ lib, stdenv, fetchFromGitHub, fetchpatch, ftgl, glew, asciidoc
, cmake, ninja, libGLU, libGL, zlib, python, expat, libxml2, libsigcxx, libuuid, freetype
, cmake, ninja, libGLU, libGL, zlib, python2, expat, libxml2, libsigcxx, libuuid, freetype
, libpng, boost, doxygen, cairomm, pkg-config, libjpeg, libtiff
, gettext, intltool, perl, gtkmm2, glibmm, gtkglext, libXmu }:

Expand Down Expand Up @@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ninja gettext intltool doxygen pkg-config perl asciidoc ];

buildInputs = [
libGLU libGL zlib python expat libxml2 libsigcxx libuuid freetype libpng
libGLU libGL zlib python2 expat libxml2 libsigcxx libuuid freetype libpng
boost cairomm libjpeg libtiff
ftgl glew gtkmm2 glibmm gtkglext libXmu
];
Expand Down
6 changes: 3 additions & 3 deletions pkgs/applications/misc/lyx/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ fetchurl, lib, mkDerivation, pkg-config, python, file, bc
{ fetchurl, lib, mkDerivation, pkg-config, python3, file, bc
, qtbase, qtsvg, hunspell, makeWrapper #, mythes, boost
}:

Expand All @@ -14,7 +14,7 @@ mkDerivation rec {
# LaTeX is used from $PATH, as people often want to have it with extra pkgs
nativeBuildInputs = [ pkg-config ];
buildInputs = [
qtbase qtsvg python file/*for libmagic*/ bc
qtbase qtsvg python3 file/*for libmagic*/ bc
hunspell makeWrapper # enchant
];

Expand All @@ -31,7 +31,7 @@ mkDerivation rec {

# python is run during runtime to do various tasks
qtWrapperArgs = [
" --prefix PATH : ${python}/bin"
" --prefix PATH : ${python3}/bin"
];

meta = with lib; {
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/misc/menumaker/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ lib, fetchurl, pythonPackages }:
{ lib, fetchurl, python2Packages }:

pythonPackages.buildPythonApplication rec {
python2Packages.buildPythonApplication rec {
pname = "menumaker";
version = "0.99.12";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
, ortp
, pango
, pkg-config
, python
, qtbase
, qtgraphicaleffects
, qtquickcontrols2
Expand Down
21 changes: 15 additions & 6 deletions pkgs/applications/science/math/maxima/default.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{ lib, stdenv, fetchurl, fetchpatch, sbcl, texinfo, perl, python, makeWrapper, autoreconfHook
{ lib, stdenv, fetchurl, fetchpatch, sbcl, texinfo, perl, python3, makeWrapper, autoreconfHook
, rlwrap ? null, tk ? null, gnuplot ? null, ecl ? null, ecl-fasl ? false
}:

let
name = "maxima";
version = "5.44.0";

lisp-compiler = if ecl-fasl then ecl else sbcl;

searchPath =
lib.makeBinPath
(lib.filter (x: x != null) [ sbcl ecl rlwrap tk gnuplot ]);
(lib.filter (x: x != null) [ lisp-compiler rlwrap tk gnuplot ]);
in
stdenv.mkDerivation ({
inherit version;
Expand All @@ -19,11 +21,18 @@ stdenv.mkDerivation ({
sha256 = "1v6jr5s6hhj6r18gfk6hgxk2qd6z1dxkrjq9ss2z1y6sqi45wgyr";
};

nativeBuildInputs = [ autoreconfHook ];
nativeBuildInputs = [
autoreconfHook
lisp-compiler
makeWrapper
python3
texinfo
];

strictDeps = true;

buildInputs = lib.filter (x: x != null) [
sbcl ecl texinfo perl python makeWrapper
gnuplot # required in the test suite
checkInputs = [
gnuplot
];

postPatch = ''
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/virtualization/lkl/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, bc, python, bison, flex, fuse, libarchive
{ lib, stdenv, fetchFromGitHub, bc, python3, bison, flex, fuse, libarchive
, buildPackages }:

stdenv.mkDerivation rec {
Expand All @@ -8,7 +8,7 @@ stdenv.mkDerivation rec {

outputs = [ "dev" "lib" "out" ];

nativeBuildInputs = [ bc bison flex python ];
nativeBuildInputs = [ bc bison flex python3 ];

buildInputs = [ fuse libarchive ];

Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/clasp/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ lib, stdenv, fetchFromGitHub, fetchFromGitLab
, llvmPackages
, cmake, boehmgc, gmp, zlib, ncurses, boost, libelf
, python, git, sbcl
, python3, git, sbcl
, wafHook
}:
let
Expand Down Expand Up @@ -67,7 +67,7 @@ stdenv.mkDerivation rec {
fetchSubmodules = true;
};

nativeBuildInputs = [ cmake python git sbcl wafHook ] ++
nativeBuildInputs = [ cmake python3 git sbcl wafHook ] ++
(with llvmPackages; [ llvm clang ]);

buildInputs = with llvmPackages;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/dtc/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ stdenv, lib, fetchgit, flex, bison, pkg-config, which
, pythonSupport ? false, python, swig, libyaml
, pythonSupport ? false, python ? null, swig, libyaml
}:

stdenv.mkDerivation rec {
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/llvm/rocm/clang.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ lib, stdenv
, fetchFromGitHub
, cmake
, python
, python3
, llvm
, clang-tools-extra_src ? null
, lld
Expand All @@ -15,7 +15,7 @@ stdenv.mkDerivation rec {

pname = "clang";

nativeBuildInputs = [ cmake python ];
nativeBuildInputs = [ cmake python3 ];

buildInputs = [ llvm ];

Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/openjdk/openjfx/11.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ stdenv, lib, fetchurl, writeText, gradleGen, pkg-config, perl, cmake
, gperf, gtk2, gtk3, libXtst, libXxf86vm, glib, alsa-lib, ffmpeg, python, ruby
, gperf, gtk2, gtk3, libXtst, libXxf86vm, glib, alsa-lib, ffmpeg, python2, ruby
, openjdk11-bootstrap }:

let
Expand All @@ -20,7 +20,7 @@ let
};

buildInputs = [ gtk2 gtk3 libXtst libXxf86vm glib alsa-lib ffmpeg ];
nativeBuildInputs = [ gradle_ perl pkg-config cmake gperf python ruby ];
nativeBuildInputs = [ gradle_ perl pkg-config cmake gperf python2 ruby ];

dontUseCmakeConfigure = true;

Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/osl/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ clangStdenv, lib, fetchFromGitHub, cmake, zlib, openexr,
openimageio, llvm, boost165, flex, bison, partio, pugixml,
util-linux, python
util-linux, python3
}:

let boost_static = boost165.override { enableStatic = true; };
Expand All @@ -26,7 +26,7 @@ in clangStdenv.mkDerivation rec {
zlib openexr openimageio llvm
partio pugixml
util-linux # needed just for hexdump
python # CMake doesn't check this?
python3 # CMake doesn't check this?
];
# TODO: How important is partio? CMake doesn't seem to find it
meta = with lib; {
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/seexpr/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ lib, stdenv, fetchFromGitHub, cmake, libpng, zlib, qt4,
bison, flex, libGLU, pythonPackages
bison, flex, libGLU, python2Packages
}:

stdenv.mkDerivation {
Expand All @@ -13,7 +13,7 @@ stdenv.mkDerivation {
};

nativeBuildInputs = [ cmake ];
buildInputs = [ libGLU libpng zlib qt4 pythonPackages.pyqt4 bison flex ];
buildInputs = [ libGLU libpng zlib qt4 python2Packages.pyqt4 bison flex ];
meta = with lib; {
description = "Embeddable expression evaluation engine from Disney Animation";
homepage = "https://www.disneyanimation.com/technology/seexpr.html";
Expand Down
6 changes: 3 additions & 3 deletions pkgs/development/em-modules/generic/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, lib, emscripten, python }:
{ pkgs, lib, emscripten, python2 }:

{ buildInputs ? [], nativeBuildInputs ? []

Expand All @@ -12,8 +12,8 @@ pkgs.stdenv.mkDerivation (

pname = "emscripten-${lib.getName args}";
version = lib.getVersion args;
buildInputs = [ emscripten python ] ++ buildInputs;
nativeBuildInputs = [ emscripten python ] ++ nativeBuildInputs;
buildInputs = [ emscripten python2 ] ++ buildInputs;
nativeBuildInputs = [ emscripten python2 ] ++ nativeBuildInputs;

# fake conftest results with emscripten's python magic
EMCONFIGURE_JS=2;
Expand Down
1 change: 1 addition & 0 deletions pkgs/development/interpreters/python/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ with pkgs;
(lib.extends (lib.composeExtensions aliases extensions) pythonPackagesFun))
{
overrides = packageOverrides;
python = self;
};
in rec {
isPy27 = pythonVersion == "2.7";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/libraries/audio/lvtk/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, boost, gtkmm2, lv2, pkg-config, python, wafHook }:
{ lib, stdenv, fetchurl, boost, gtkmm2, lv2, pkg-config, python2, wafHook }:

stdenv.mkDerivation rec {
pname = "lvtk";
Expand All @@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
sha256 = "03nbj2cqcklqwh50zj2gwm07crh5iwqbpxbpzwbg5hvgl4k4rnjd";
};

nativeBuildInputs = [ pkg-config python wafHook ];
nativeBuildInputs = [ pkg-config python2 wafHook ];
buildInputs = [ boost gtkmm2 lv2 ];

enableParallelBuilding = true;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/boost/generic.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, icu, expat, zlib, bzip2, python, fixDarwinDylibNames, libiconv
{ lib, stdenv, icu, expat, zlib, bzip2, python ? null, fixDarwinDylibNames, libiconv
, fetchpatch
, which
, buildPackages
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/gdcm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
, ApplicationServices
, Cocoa
, enablePython ? false
, python
, python ? null
, swig
}:

Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/libraries/libsystemtap/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{lib, stdenv, fetchgit, gettext, python, elfutils}:
{lib, stdenv, fetchgit, gettext, python2, elfutils}:

stdenv.mkDerivation {
pname = "libsystemtap";
Expand All @@ -13,7 +13,7 @@ stdenv.mkDerivation {

dontBuild = true;

nativeBuildInputs = [ gettext python elfutils ];
nativeBuildInputs = [ gettext python2 elfutils ];

installPhase = ''
mkdir -p $out/include
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/libraries/mapnik/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ lib, stdenv, fetchzip
, boost, cairo, freetype, gdal, harfbuzz, icu, libjpeg, libpng, libtiff
, libwebp, libxml2, proj, python, sqlite, zlib
, libwebp, libxml2, proj, python3, python ? python3, sqlite, zlib
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
, libwebp, libxml2, proj, python3, python ? python3, sqlite, zlib
, libwebp, libxml2, proj, python3, sqlite, zlib

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to separate the python used as build tool from that for which the binding is created.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, maybe we should add a comment for this. I am probably not the last one who stumbles upon this.


# supply a postgresql package to enable the PostGIS input plugin
, postgresql ? null
Expand All @@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
# a distinct dev output makes python-mapnik fail
outputs = [ "out" ];

nativeBuildInputs = [ python ];
nativeBuildInputs = [ python3 ];

buildInputs =
[ boost cairo freetype gdal harfbuzz icu libjpeg libpng libtiff
Expand Down
6 changes: 4 additions & 2 deletions pkgs/development/libraries/mlt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
, libvorbis, libxml2, movit, pkg-config, sox, fftw, opencv4, SDL2
, gtk2, genericUpdater, common-updater-scripts, libebur128
, jack2, ladspa-sdk, swig, which, ncurses
, enablePython ? false, python
, enablePython ? false, python3
}:

stdenv.mkDerivation rec {
Expand All @@ -24,7 +24,9 @@ stdenv.mkDerivation rec {
] ++ lib.optional enablePython ncurses;

nativeBuildInputs = [ pkg-config makeWrapper which ]
++ lib.optionals enablePython [ python swig ];
++ lib.optionals enablePython [ python3 swig ];

strictDeps = true;

# Mostly taken from:
# http://www.kdenlive.org/user-manual/downloading-and-installing-kdenlive/installing-source/installing-mlt-rendering-engine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
, gfortran
, lhapdf
, ncurses
, python
, python ? null
, swig
, yoda
, zlib
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/libraries/science/biology/mirtk/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, gtest, fetchFromGitHub, cmake, boost, eigen, python, vtk, zlib, tbb }:
{ lib, stdenv, gtest, fetchFromGitHub, cmake, boost, eigen, python3, vtk, zlib, tbb }:

stdenv.mkDerivation rec {
version = "2.0.0";
Expand Down Expand Up @@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
'';

nativeBuildInputs = [ cmake gtest ];
buildInputs = [ boost eigen python vtk zlib tbb ];
buildInputs = [ boost eigen python3 vtk zlib tbb ];

meta = with lib; {
homepage = "https://github.com/BioMedIA/MIRTK";
Expand Down
6 changes: 3 additions & 3 deletions pkgs/development/libraries/subunit/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, pkg-config, check, cppunit, perl, pythonPackages }:
{ lib, stdenv, fetchurl, pkg-config, check, cppunit, perl, python3Packages }:

# NOTE: for subunit python library see pkgs/top-level/python-packages.nix

Expand All @@ -12,9 +12,9 @@ stdenv.mkDerivation rec {
};

nativeBuildInputs = [ pkg-config ];
buildInputs = [ check cppunit perl pythonPackages.wrapPython ];
buildInputs = [ check cppunit perl python3Packages.wrapPython ];

propagatedBuildInputs = with pythonPackages; [ testtools testscenarios ];
propagatedBuildInputs = with python3Packages; [ testtools testscenarios ];

postFixup = "wrapPythonPrograms";

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/python-modules/subunit/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ buildPythonPackage {
--ignore=python/subunit/tests/test_{output_filter,test_protocol{,2}}.py
'';

patchPhase = ''
postPatch = ''
sed -i 's/version=VERSION/version="${subunit.version}"/' setup.py
'';
}
Loading