From 3760c8c7fde6e8b15d19b063579d05018fc2d8b3 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Tue, 21 Mar 2017 13:01:17 +0100 Subject: [PATCH] Python: replace mkPythonDerivation with buildPythonPackage and format="other"; This way all Python packages use the same function, `buildPythonPackage`. --- .../version-management/mercurial/default.nix | 3 ++- pkgs/development/python-modules/dbus/default.nix | 5 +++-- pkgs/development/python-modules/koji/default.nix | 5 +++-- .../python-modules/libsexy/default.nix | 5 +++-- .../python-modules/pycairo/default.nix | 5 +++-- pkgs/development/python-modules/pygobject/3.nix | 5 +++-- .../python-modules/pygobject/default.nix | 4 ++-- .../python-modules/pygtksourceview/default.nix | 5 +++-- pkgs/development/python-modules/pyqt/4.x.nix | 5 +++-- pkgs/development/python-modules/pyqt/5.x.nix | 5 +++-- .../development/python-modules/pyside/default.nix | 5 +++-- pkgs/development/python-modules/pyxml/default.nix | 5 +++-- pkgs/development/python-modules/sip/default.nix | 5 +++-- .../documentation/gnome-doc-utils/default.nix | 3 ++- pkgs/development/tools/misc/d-feet/default.nix | 4 ++-- pkgs/misc/drivers/hplip/default.nix | 3 ++- pkgs/os-specific/linux/dstat/default.nix | 3 ++- pkgs/top-level/python-packages.nix | 15 ++++++++++----- 18 files changed, 55 insertions(+), 35 deletions(-) diff --git a/pkgs/applications/version-management/mercurial/default.nix b/pkgs/applications/version-management/mercurial/default.nix index 034eb5344234..1c97f7252f56 100644 --- a/pkgs/applications/version-management/mercurial/default.nix +++ b/pkgs/applications/version-management/mercurial/default.nix @@ -7,8 +7,9 @@ let version = "3.9.2"; name = "mercurial-${version}"; inherit (python2Packages) docutils hg-git dulwich python; -in python2Packages.mkPythonDerivation { +in python2Packages.buildPythonApplication { inherit name; + format = "other"; src = fetchurl { url = "https://mercurial-scm.org/release/${name}.tar.gz"; diff --git a/pkgs/development/python-modules/dbus/default.nix b/pkgs/development/python-modules/dbus/default.nix index f3f897ac9e79..d2e1d2dc86fd 100644 --- a/pkgs/development/python-modules/dbus/default.nix +++ b/pkgs/development/python-modules/dbus/default.nix @@ -1,8 +1,9 @@ -{ lib, fetchurl, mkPythonDerivation, python, pkgconfig, dbus, dbus_glib, dbus_tools, isPyPy +{ lib, fetchurl, buildPythonPackage, python, pkgconfig, dbus, dbus_glib, dbus_tools, isPyPy , ncurses, pygobject3 }: -if isPyPy then throw "dbus-python not supported for interpreter ${python.executable}" else mkPythonDerivation rec { +if isPyPy then throw "dbus-python not supported for interpreter ${python.executable}" else buildPythonPackage rec { name = "dbus-python-1.2.4"; + format = "other"; src = fetchurl { url = "http://dbus.freedesktop.org/releases/dbus-python/${name}.tar.gz"; diff --git a/pkgs/development/python-modules/koji/default.nix b/pkgs/development/python-modules/koji/default.nix index 262ea74d4a34..28b5e11223ff 100644 --- a/pkgs/development/python-modules/koji/default.nix +++ b/pkgs/development/python-modules/koji/default.nix @@ -1,7 +1,8 @@ -{ stdenv, fetchurl, mkPythonDerivation, pycurl }: +{ stdenv, fetchurl, buildPythonPackage, pycurl }: -mkPythonDerivation rec { +buildPythonPackage rec { name = "koji-1.8"; + format = "other"; src = fetchurl { url = "https://fedorahosted.org/released/koji/koji-1.8.0.tar.bz2"; diff --git a/pkgs/development/python-modules/libsexy/default.nix b/pkgs/development/python-modules/libsexy/default.nix index fa79cfa3be5c..79eb8ab2f83c 100644 --- a/pkgs/development/python-modules/libsexy/default.nix +++ b/pkgs/development/python-modules/libsexy/default.nix @@ -1,8 +1,9 @@ -{ stdenv, fetchurl, mkPythonDerivation, libsexy, pkgconfig, libxml2, pygtk, pango, gtk2, glib }: +{ stdenv, fetchurl, buildPythonPackage, libsexy, pkgconfig, libxml2, pygtk, pango, gtk2, glib }: -mkPythonDerivation rec { +buildPythonPackage rec { name = "libsexy-${version}"; version = "0.1.9"; + format = "other"; src = fetchurl { url = "http://releases.chipx86.com/libsexy/sexy-python/sexy-python-${version}.tar.gz"; diff --git a/pkgs/development/python-modules/pycairo/default.nix b/pkgs/development/python-modules/pycairo/default.nix index e7cf3b4c4489..5d002c096239 100644 --- a/pkgs/development/python-modules/pycairo/default.nix +++ b/pkgs/development/python-modules/pycairo/default.nix @@ -1,8 +1,9 @@ -{ lib, fetchurl, fetchpatch, python, mkPythonDerivation, pkgconfig, cairo, xlibsWrapper, isPyPy, isPy35, isPy3k }: +{ lib, fetchurl, fetchpatch, python, buildPythonPackage, pkgconfig, cairo, xlibsWrapper, isPyPy, isPy35, isPy3k }: -if (isPyPy) then throw "pycairo not supported for interpreter ${python.executable}" else mkPythonDerivation rec { +if (isPyPy) then throw "pycairo not supported for interpreter ${python.executable}" else buildPythonPackage rec { version = "1.10.0"; name = "pycairo-${version}"; + format = "other"; src = if isPy3k then fetchurl { url = "http://cairographics.org/releases/pycairo-${version}.tar.bz2"; diff --git a/pkgs/development/python-modules/pygobject/3.nix b/pkgs/development/python-modules/pygobject/3.nix index 33bb1d5a4cab..984b11844342 100644 --- a/pkgs/development/python-modules/pygobject/3.nix +++ b/pkgs/development/python-modules/pygobject/3.nix @@ -1,9 +1,10 @@ -{ stdenv, fetchurl, mkPythonDerivation, python, pkgconfig, glib, gobjectIntrospection, pycairo, cairo, which, ncurses}: +{ stdenv, fetchurl, buildPythonPackage, python, pkgconfig, glib, gobjectIntrospection, pycairo, cairo, which, ncurses}: -mkPythonDerivation rec { +buildPythonPackage rec { major = "3.22"; minor = "0"; name = "pygobject-${major}.${minor}"; + format = "other"; src = fetchurl { url = "mirror://gnome/sources/pygobject/${major}/${name}.tar.xz"; diff --git a/pkgs/development/python-modules/pygobject/default.nix b/pkgs/development/python-modules/pygobject/default.nix index 6723ba6b6a58..a3658a96bf3d 100644 --- a/pkgs/development/python-modules/pygobject/default.nix +++ b/pkgs/development/python-modules/pygobject/default.nix @@ -1,6 +1,6 @@ -{ stdenv, fetchurl, python, mkPythonDerivation, pkgconfig, glib }: +{ stdenv, fetchurl, python, buildPythonPackage, pkgconfig, glib }: -mkPythonDerivation rec { +buildPythonPackage rec { name = "pygobject-${version}"; version = "2.28.6"; diff --git a/pkgs/development/python-modules/pygtksourceview/default.nix b/pkgs/development/python-modules/pygtksourceview/default.nix index 133cbdb34fd2..499634236acd 100644 --- a/pkgs/development/python-modules/pygtksourceview/default.nix +++ b/pkgs/development/python-modules/pygtksourceview/default.nix @@ -1,9 +1,10 @@ -{ lib, fetchurl, python, mkPythonDerivation, pkgconfig, pygobject2, glib, pygtk, gnome2 }: +{ lib, fetchurl, python, buildPythonPackage, pkgconfig, pygobject2, glib, pygtk, gnome2 }: let version = "2.10.1"; in -mkPythonDerivation { +buildPythonPackage { name = "pygtksourceview-${version}"; + format = "other"; src = fetchurl { url = "http://ftp.gnome.org/pub/gnome/sources/pygtksourceview/2.10/pygtksourceview-${version}.tar.bz2"; diff --git a/pkgs/development/python-modules/pyqt/4.x.nix b/pkgs/development/python-modules/pyqt/4.x.nix index dc3dd69ac02e..a5ae0aaa137d 100644 --- a/pkgs/development/python-modules/pyqt/4.x.nix +++ b/pkgs/development/python-modules/pyqt/4.x.nix @@ -2,9 +2,10 @@ let version = "4.12"; - inherit (pythonPackages) mkPythonDerivation python dbus-python sip; -in mkPythonDerivation { + inherit (pythonPackages) buildPythonPackage python dbus-python sip; +in buildPythonPackage { name = "PyQt-x11-gpl-${version}"; + format = "other"; src = fetchurl { url = "mirror://sourceforge/pyqt/PyQt4_gpl_x11-${version}.tar.gz"; diff --git a/pkgs/development/python-modules/pyqt/5.x.nix b/pkgs/development/python-modules/pyqt/5.x.nix index ee3419eed0e9..880edfbab079 100644 --- a/pkgs/development/python-modules/pyqt/5.x.nix +++ b/pkgs/development/python-modules/pyqt/5.x.nix @@ -3,9 +3,10 @@ let version = "5.8.1"; - inherit (pythonPackages) mkPythonDerivation python dbus-python sip; -in mkPythonDerivation { + inherit (pythonPackages) buildPythonPackage python dbus-python sip; +in buildPythonPackage { name = "PyQt-${version}"; + format = "other"; meta = with lib; { description = "Python bindings for Qt5"; diff --git a/pkgs/development/python-modules/pyside/default.nix b/pkgs/development/python-modules/pyside/default.nix index 6473ebf22b13..4aff09b8f8f5 100644 --- a/pkgs/development/python-modules/pyside/default.nix +++ b/pkgs/development/python-modules/pyside/default.nix @@ -1,8 +1,9 @@ -{ lib, fetchurl, cmake, python, mkPythonDerivation, pysideGeneratorrunner, pysideShiboken, qt4 }: +{ lib, fetchurl, cmake, python, buildPythonPackage, pysideGeneratorrunner, pysideShiboken, qt4 }: -mkPythonDerivation rec { +buildPythonPackage rec { name = "pyside-${version}"; version = "1.2.4"; + format = "other"; src = fetchurl { url = "https://github.com/PySide/PySide/archive/${version}.tar.gz"; diff --git a/pkgs/development/python-modules/pyxml/default.nix b/pkgs/development/python-modules/pyxml/default.nix index abea143d11da..b85b20423697 100644 --- a/pkgs/development/python-modules/pyxml/default.nix +++ b/pkgs/development/python-modules/pyxml/default.nix @@ -1,7 +1,8 @@ -{lib, fetchurl, python, mkPythonDerivation, makeWrapper}: +{lib, fetchurl, python, buildPythonPackage, makeWrapper}: -mkPythonDerivation rec { +buildPythonPackage rec { name = "PyXML-0.8.4"; + format = "other"; src = fetchurl { url = "mirror://sourceforge/pyxml/${name}.tar.gz"; sha256 = "04wc8i7cdkibhrldy6j65qp5l75zjxf5lx6qxdxfdf2gb3wndawz"; diff --git a/pkgs/development/python-modules/sip/default.nix b/pkgs/development/python-modules/sip/default.nix index 99d3c89e1f9d..29295de66b7e 100644 --- a/pkgs/development/python-modules/sip/default.nix +++ b/pkgs/development/python-modules/sip/default.nix @@ -1,7 +1,8 @@ -{ lib, fetchurl, mkPythonDerivation, python, isPyPy }: +{ lib, fetchurl, buildPythonPackage, python, isPyPy }: -if isPyPy then throw "sip not supported for interpreter ${python.executable}" else mkPythonDerivation rec { +if isPyPy then throw "sip not supported for interpreter ${python.executable}" else buildPythonPackage rec { name = "sip-4.19.1"; + format = "other"; src = fetchurl { url = "mirror://sourceforge/pyqt/sip/${name}/${name}.tar.gz"; diff --git a/pkgs/development/tools/documentation/gnome-doc-utils/default.nix b/pkgs/development/tools/documentation/gnome-doc-utils/default.nix index 18933426db0a..ef339d47ea05 100644 --- a/pkgs/development/tools/documentation/gnome-doc-utils/default.nix +++ b/pkgs/development/tools/documentation/gnome-doc-utils/default.nix @@ -1,8 +1,9 @@ {stdenv, fetchurl, pkgconfig, libxml2Python, libxslt, intltool , makeWrapper, python2Packages }: -python2Packages.mkPythonDerivation { +python2Packages.buildPythonApplication { name = "gnome-doc-utils-0.20.10"; + format = "other"; src = fetchurl { url = mirror://gnome/sources/gnome-doc-utils/0.20/gnome-doc-utils-0.20.10.tar.xz; diff --git a/pkgs/development/tools/misc/d-feet/default.nix b/pkgs/development/tools/misc/d-feet/default.nix index 2ada782563e5..4fec00a2fd7e 100644 --- a/pkgs/development/tools/misc/d-feet/default.nix +++ b/pkgs/development/tools/misc/d-feet/default.nix @@ -4,9 +4,9 @@ let version = "${major}.11"; major = "0.3"; -in pythonPackages.mkPythonDerivation rec { +in pythonPackages.buildPythonApplication rec { name = "d-feet-${version}"; - namePrefix = ""; + format = "other"; src = fetchurl { url = "mirror://gnome/sources/d-feet/${major}/d-feet-${version}.tar.xz"; diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix index c0a6c0a9baa0..1c40493e4ae9 100644 --- a/pkgs/misc/drivers/hplip/default.nix +++ b/pkgs/misc/drivers/hplip/default.nix @@ -47,8 +47,9 @@ in assert withPlugin -> builtins.elem hplipArch pluginArches || throw "HPLIP plugin not supported on ${stdenv.system}"; -pythonPackages.mkPythonDerivation { +pythonPackages.buildPythonApplication { inherit name src; + format = "other"; buildInputs = [ libjpeg diff --git a/pkgs/os-specific/linux/dstat/default.nix b/pkgs/os-specific/linux/dstat/default.nix index ccedc381504f..366cc9787f28 100644 --- a/pkgs/os-specific/linux/dstat/default.nix +++ b/pkgs/os-specific/linux/dstat/default.nix @@ -1,7 +1,8 @@ { stdenv, fetchurl, python2Packages }: -python2Packages.mkPythonDerivation rec { +python2Packages.buildPythonApplication rec { name = "dstat-${version}"; + format = "other"; version = "0.7.3"; src = fetchurl { diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index cf06f64421e1..d80c36842352 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7035,9 +7035,10 @@ in { buildInputs = with self; [ fudge_9 nose ]; }; - fedora_cert = mkPythonDerivation rec { + fedora_cert = buildPythonPackage rec { name = "fedora-cert-0.5.9.2"; meta.maintainers = with maintainers; [ mornfall ]; + format = "other"; src = pkgs.fetchurl { url = "https://fedorahosted.org/releases/f/e/fedora-packager/fedora-packager-0.5.9.2.tar.bz2"; @@ -21809,8 +21810,9 @@ in { }; - pysvn = mkPythonDerivation rec { + pysvn = buildPythonPackage rec { name = "pysvn-1.8.0"; + format = "other"; src = pkgs.fetchurl { url = "http://pysvn.barrys-emacs.org/source_kits/${name}.tar.gz"; @@ -21965,9 +21967,10 @@ in { }); - pywebkitgtk = mkPythonDerivation rec { + pywebkitgtk = buildPythonPackage rec { name = "pywebkitgtk-${version}"; version = "1.1.8"; + format = "other"; src = pkgs.fetchurl { url = "http://pywebkitgtk.googlecode.com/files/${name}.tar.bz2"; @@ -22300,10 +22303,11 @@ in { qscintilla = if isPy3k || isPyPy then throw "qscintilla-${pkgs.qscintilla.version} not supported for interpreter ${python.executable}" - else mkPythonDerivation rec { + else buildPythonPackage rec { # TODO: Qt5 support name = "qscintilla-${version}"; version = pkgs.qscintilla.version; + format = "other"; src = pkgs.qscintilla.src; @@ -25833,9 +25837,10 @@ in { # Python package. tkinter = let py = python.override{x11Support=true;}; - in mkPythonDerivation rec { + in buildPythonPackage rec { name = "tkinter-${python.version}"; src = py; + format = "other"; disabled = isPy26 || isPyPy;