Skip to content

Commit

Permalink
Merge pull request #131719 from FRidh/python2-to-3
Browse files Browse the repository at this point in the history
Python: further migrate packages from 2 to 3
  • Loading branch information
FRidh authored Jul 29, 2021
2 parents 3888701 + 238fa78 commit 8dcfe52
Show file tree
Hide file tree
Showing 44 changed files with 133 additions and 103 deletions.
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

# 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

0 comments on commit 8dcfe52

Please sign in to comment.