Merge pull request #76488 from jtojnar/more-python-cleanups

Another batch of Python 2 clean-ups
This commit is contained in:
Frederik Rietdijk 2020-01-06 12:00:36 +01:00 committed by GitHub
commit 8fff915659
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 57 additions and 39 deletions

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, fftwSinglePrec, lv2, pkgconfig, python, wafHook }: { stdenv, fetchurl, fftwSinglePrec, lv2, pkgconfig, wafHook }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "mda-lv2"; pname = "mda-lv2";
@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
}; };
nativeBuildInputs = [ pkgconfig wafHook ]; nativeBuildInputs = [ pkgconfig wafHook ];
buildInputs = [ fftwSinglePrec lv2 python ]; buildInputs = [ fftwSinglePrec lv2 ];
meta = with stdenv.lib; { meta = with stdenv.lib; {
homepage = http://drobilla.net/software/mda-lv2/; homepage = http://drobilla.net/software/mda-lv2/;

View File

@ -1,10 +1,10 @@
{ stdenv, fetchurl, pkgconfig, intltool, perlPackages { stdenv, fetchurl, pkgconfig, intltool, perlPackages
, goffice, gnome3, wrapGAppsHook, gtk3, bison, pythonPackages , goffice, gnome3, wrapGAppsHook, gtk3, bison, python3Packages
, itstool , itstool
}: }:
let let
inherit (pythonPackages) python pygobject3; inherit (python3Packages) python pygobject3;
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
pname = "gnumeric"; pname = "gnumeric";
version = "1.12.46"; version = "1.12.46";

View File

@ -1,5 +1,5 @@
{ stdenv, lib, fetchgit, flex, bison, pkgconfig, which { stdenv, lib, fetchgit, flex, bison, pkgconfig, which
, pythonSupport ? stdenv.buildPlatform == stdenv.hostPlatform, python, swig , pythonSupport ? false, python, swig
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {

View File

@ -21,7 +21,6 @@
, libsecret , libsecret
, db , db
, python3 , python3
, python
, readline , readline
, gtk3 , gtk3
}: }:
@ -51,7 +50,6 @@ stdenv.mkDerivation rec {
meson meson
ninja ninja
pkgconfig pkgconfig
python
python3 python3
vala vala
]; ];

View File

@ -4,11 +4,10 @@
, meson , meson
, ninja , ninja
, pkgconfig , pkgconfig
, python , python3
, gst-plugins-base , gst-plugins-base
, libxml2 , libxml2
, flex , flex
, perl
, gettext , gettext
, gobject-introspection , gobject-introspection
}: }:
@ -34,9 +33,8 @@ stdenv.mkDerivation rec {
pkgconfig pkgconfig
gettext gettext
gobject-introspection gobject-introspection
python python3
flex flex
perl
]; ];
buildInputs = [ buildInputs = [

View File

@ -3,7 +3,7 @@
, meson , meson
, ninja , ninja
, pkgconfig , pkgconfig
, python , python3
, gst-plugins-base , gst-plugins-base
, orc , orc
, gettext , gettext
@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
ninja ninja
gettext gettext
pkgconfig pkgconfig
python python3
]; ];
buildInputs = [ buildInputs = [

View File

@ -3,7 +3,7 @@
, pkgconfig , pkgconfig
, gstreamer , gstreamer
, gst-plugins-base , gst-plugins-base
, python , python3
, gobject-introspection , gobject-introspection
, json-glib , json-glib
}: }:
@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
]; ];
buildInputs = [ buildInputs = [
python python3
json-glib json-glib
]; ];

View File

@ -1,8 +1,5 @@
{ stdenv, autoreconfHook, fetchFromGitHub, pkgconfig, python2Packages, glib }: { stdenv, autoreconfHook, fetchFromGitHub, pkgconfig, enablePython ? false, python, glib }:
let
inherit (python2Packages) python cython;
in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "libplist"; pname = "libplist";
version = "2019-04-04"; version = "2019-04-04";
@ -14,18 +11,23 @@ stdenv.mkDerivation rec {
sha256 = "19yw80yblq29i2jx9yb7bx0lfychy9dncri3fk4as35kq5bf26i8"; sha256 = "19yw80yblq29i2jx9yb7bx0lfychy9dncri3fk4as35kq5bf26i8";
}; };
outputs = ["bin" "dev" "out" "py"]; outputs = ["bin" "dev" "out" ] ++ stdenv.lib.optional enablePython "py";
nativeBuildInputs = [ nativeBuildInputs = [
pkgconfig pkgconfig
python
cython
autoreconfHook autoreconfHook
] ++ stdenv.lib.optionals enablePython [
python
python.pkgs.cython
];
configureFlags = stdenv.lib.optionals (!enablePython) [
"--without-cython"
]; ];
propagatedBuildInputs = [ glib ]; propagatedBuildInputs = [ glib ];
postFixup = '' postFixup = stdenv.lib.optionalString enablePython ''
moveToOutput "lib/${python.libPrefix}" "$py" moveToOutput "lib/${python.libPrefix}" "$py"
''; '';

View File

@ -1,4 +1,4 @@
{ stdenv, lib, fetchFromGitHub, autoreconfHook, perl, cracklib, python }: { stdenv, lib, fetchFromGitHub, autoreconfHook, perl, cracklib, python3 }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "libpwquality"; pname = "libpwquality";
@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
}; };
nativeBuildInputs = [ autoreconfHook perl ]; nativeBuildInputs = [ autoreconfHook perl ];
buildInputs = [ cracklib python ]; buildInputs = [ cracklib python3 ];
meta = with lib; { meta = with lib; {
description = "Password quality checking and random password generation library"; description = "Password quality checking and random password generation library";

View File

@ -1,11 +1,11 @@
{ qtModule, lib, python2, qtbase, qtsvg }: { qtModule, lib, python3, qtbase, qtsvg }:
with lib; with lib;
qtModule { qtModule {
name = "qtdeclarative"; name = "qtdeclarative";
qtInputs = [ qtbase qtsvg ]; qtInputs = [ qtbase qtsvg ];
nativeBuildInputs = [ python2 ]; nativeBuildInputs = [ python3 ];
outputs = [ "out" "dev" "bin" ]; outputs = [ "out" "dev" "bin" ];
preConfigure = '' preConfigure = ''
NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QML2_IMPORT_PREFIX=\"$qtQmlPrefix\"" NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QML2_IMPORT_PREFIX=\"$qtQmlPrefix\""

View File

@ -1,5 +1,5 @@
{ stdenv, lib, fetchgit, darwin, writeText { stdenv, lib, fetchgit, darwin, writeText
, git, ninja, python2 }: , git, ninja, python3 }:
let let
rev = "64b846c96daeb3eaf08e26d8a84d8451c6cb712b"; rev = "64b846c96daeb3eaf08e26d8a84d8451c6cb712b";
@ -25,7 +25,7 @@ stdenv.mkDerivation {
inherit rev sha256; inherit rev sha256;
}; };
nativeBuildInputs = [ ninja python2 git ]; nativeBuildInputs = [ ninja python3 git ];
buildInputs = lib.optionals stdenv.isDarwin (with darwin; with apple_sdk.frameworks; [ buildInputs = lib.optionals stdenv.isDarwin (with darwin; with apple_sdk.frameworks; [
libobjc libobjc
cctools cctools

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, libgcrypt, libnl, pkgconfig, python2Packages, wireless-regdb }: { stdenv, fetchurl, fetchpatch, libgcrypt, libnl, pkgconfig, python3, wireless-regdb }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "crda"; pname = "crda";
@ -9,9 +9,24 @@ stdenv.mkDerivation rec {
url = "http://kernel.org/pub/software/network/crda/crda-${version}.tar.xz"; url = "http://kernel.org/pub/software/network/crda/crda-${version}.tar.xz";
}; };
patches = [
# Switch to Python 3
# https://lore.kernel.org/linux-wireless/1437542484-23409-1-git-send-email-ahmed.taahir@gmail.com/
(fetchpatch {
url = "https://lore.kernel.org/linux-wireless/1437542484-23409-2-git-send-email-ahmed.taahir@gmail.com/raw";
sha256 = "0s2n340cgaasvg1k8g9v8xjrbh4y2mcgrhdmv97ja2fs8xjcjbf1";
})
(fetchpatch {
url = "https://lore.kernel.org/linux-wireless/1437542484-23409-3-git-send-email-ahmed.taahir@gmail.com/raw";
sha256 = "01dlfw7kqhyx025jxq2l75950b181p9r7i9zkflcwvbzzdmx59md";
})
];
buildInputs = [ libgcrypt libnl ]; buildInputs = [ libgcrypt libnl ];
nativeBuildInputs = [ nativeBuildInputs = [
pkgconfig python2Packages.m2crypto python2Packages.python pkgconfig
python3
python3.pkgs.pycrypto
]; ];
postPatch = '' postPatch = ''
@ -37,6 +52,11 @@ stdenv.mkDerivation rec {
doCheck = true; doCheck = true;
checkTarget = "verify"; checkTarget = "verify";
postInstall = ''
# The patch installs build header
rm $out/include/reglib/keys-gcrypt.h
'';
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Linux wireless Central Regulatory Domain Agent"; description = "Linux wireless Central Regulatory Domain Agent";
longDescription = '' longDescription = ''

View File

@ -1,5 +1,5 @@
{ stdenv, file, lib, fetchFromGitHub, autoreconfHook, bison, flex, pkgconfig { stdenv, file, lib, fetchFromGitHub, autoreconfHook, bison, flex, pkgconfig
, pythonSupport ? stdenv.buildPlatform == stdenv.hostPlatform, swig ? null, python}: , pythonSupport ? false, swig ? null, python}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "libnl"; pname = "libnl";

View File

@ -1,6 +1,6 @@
{ stdenv, fetchurl, fetchpatch { stdenv, fetchurl, fetchpatch
, pkgconfig, autoreconfHook , pkgconfig, autoreconfHook
, gmp, python, iptables, ldns, unbound, openssl, pcsclite, glib , gmp, python3, iptables, ldns, unbound, openssl, pcsclite, glib
, openresolv , openresolv
, systemd, pam , systemd, pam
, curl , curl
@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkgconfig autoreconfHook ]; nativeBuildInputs = [ pkgconfig autoreconfHook ];
buildInputs = buildInputs =
[ curl gmp python ldns unbound openssl pcsclite ] [ curl gmp python3 ldns unbound openssl pcsclite ]
++ optionals enableTNC [ trousers sqlite libxml2 ] ++ optionals enableTNC [ trousers sqlite libxml2 ]
++ optionals stdenv.isLinux [ systemd.dev pam iptables ] ++ optionals stdenv.isLinux [ systemd.dev pam iptables ]
++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ SystemConfiguration ]) ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ SystemConfiguration ])

View File

@ -1,5 +1,5 @@
{ stdenv, fetchFromGitHub, lib { stdenv, fetchFromGitHub, lib
, intltool, glib, pkgconfig, polkit, python, sqlite , intltool, glib, pkgconfig, polkit, python3, sqlite
, gobject-introspection, vala, gtk-doc, autoreconfHook, autoconf-archive , gobject-introspection, vala, gtk-doc, autoreconfHook, autoconf-archive
# TODO: set enableNixBackend to true, as soon as it builds # TODO: set enableNixBackend to true, as soon as it builds
, nix, enableNixBackend ? false, boost , nix, enableNixBackend ? false, boost
@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
sha256 = "02wq3jw3mkdld90irh5vdfd5bri2g1p89mhrmj56kvif1fqak46x"; sha256 = "02wq3jw3mkdld90irh5vdfd5bri2g1p89mhrmj56kvif1fqak46x";
}; };
buildInputs = [ glib polkit python gobject-introspection ] buildInputs = [ glib polkit python3 gobject-introspection ]
++ lib.optional enableSystemd systemd ++ lib.optional enableSystemd systemd
++ lib.optional enableBashCompletion bash-completion; ++ lib.optional enableBashCompletion bash-completion;
propagatedBuildInputs = [ sqlite nix boost ]; propagatedBuildInputs = [ sqlite nix boost ];

View File

@ -1,5 +1,5 @@
{ lib, fetchurl, stdenv, ncurses, { lib, fetchurl, stdenv, ncurses,
IOKit, python }: IOKit, python3 }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "htop"; pname = "htop";
@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
sha256 = "0mrwpb3cpn3ai7ar33m31yklj64c3pp576vh1naqff6f21pq5mnr"; sha256 = "0mrwpb3cpn3ai7ar33m31yklj64c3pp576vh1naqff6f21pq5mnr";
}; };
nativeBuildInputs = [ python ]; nativeBuildInputs = [ python3 ];
buildInputs = buildInputs =
[ ncurses ] ++ [ ncurses ] ++
lib.optionals stdenv.isDarwin [ IOKit ]; lib.optionals stdenv.isDarwin [ IOKit ];

View File

@ -3932,7 +3932,7 @@ in {
libsavitar = callPackage ../development/python-modules/libsavitar { }; libsavitar = callPackage ../development/python-modules/libsavitar { };
libplist = disabledIf isPy3k libplist = disabledIf isPy3k
(toPythonModule (pkgs.libplist.override{python2Packages=self; })).py; (toPythonModule (pkgs.libplist.override { enablePython = true; inherit python; })).py;
libxml2 = (toPythonModule (pkgs.libxml2.override{pythonSupport=true; inherit python;})).py; libxml2 = (toPythonModule (pkgs.libxml2.override{pythonSupport=true; inherit python;})).py;