Skip to content

Commit

Permalink
Python: replace mkPythonDerivation with buildPythonPackage and format…
Browse files Browse the repository at this point in the history
…="other";

This way all Python packages use the same function,
`buildPythonPackage`.

(cherry picked from commit 3760c8c)
  • Loading branch information
FRidh committed Mar 21, 2017
1 parent 2722b1c commit 504323c
Show file tree
Hide file tree
Showing 18 changed files with 55 additions and 35 deletions.
3 changes: 2 additions & 1 deletion pkgs/applications/version-management/mercurial/default.nix
Expand Up @@ -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";
Expand Down
5 changes: 3 additions & 2 deletions 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";
Expand Down
5 changes: 3 additions & 2 deletions 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";
Expand Down
5 changes: 3 additions & 2 deletions 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";
Expand Down
5 changes: 3 additions & 2 deletions 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";
Expand Down
5 changes: 3 additions & 2 deletions 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";
Expand Down
4 changes: 2 additions & 2 deletions 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";

Expand Down
5 changes: 3 additions & 2 deletions 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";
Expand Down
5 changes: 3 additions & 2 deletions pkgs/development/python-modules/pyqt/4.x.nix
Expand Up @@ -2,9 +2,10 @@

let
version = "4.11.3";
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/PyQt-${version}/PyQt-x11-gpl-${version}.tar.gz";
Expand Down
5 changes: 3 additions & 2 deletions pkgs/development/python-modules/pyqt/5.x.nix
Expand Up @@ -3,9 +3,10 @@

let
version = "5.6";
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";
Expand Down
5 changes: 3 additions & 2 deletions 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";
Expand Down
5 changes: 3 additions & 2 deletions 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";
Expand Down
5 changes: 3 additions & 2 deletions 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.18.1";
format = "other";

src = fetchurl {
url = "mirror://sourceforge/pyqt/sip/${name}/${name}.tar.gz";
Expand Down
@@ -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;
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/tools/misc/d-feet/default.nix
Expand Up @@ -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";
Expand Down
3 changes: 2 additions & 1 deletion pkgs/misc/drivers/hplip/default.nix
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion 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 {
Expand Down
15 changes: 10 additions & 5 deletions pkgs/top-level/python-packages.nix
Expand Up @@ -7017,9 +7017,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";
Expand Down Expand Up @@ -21738,8 +21739,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";
Expand Down Expand Up @@ -21894,9 +21896,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";
Expand Down Expand Up @@ -22229,10 +22232,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;

Expand Down Expand Up @@ -25749,9 +25753,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;

Expand Down

3 comments on commit 504323c

@vcunat
Copy link
Member

@vcunat vcunat commented on 504323c Mar 21, 2017

Choose a reason for hiding this comment

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

This broke the build of python2Packages.pygobject2 and consequently some other packages.

[...]
building
********************************************************************
* Building PyGObject using distutils is only supported on windows. *
* To build PyGObject in a supported way, read the INSTALL file.    *
********************************************************************

@FRidh
Copy link
Member Author

@FRidh FRidh commented on 504323c Mar 21, 2017

Choose a reason for hiding this comment

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

I'll have a look at it right away.

@FRidh
Copy link
Member Author

@FRidh FRidh commented on 504323c Mar 21, 2017

Choose a reason for hiding this comment

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

fixed on staging and staging-17.03 with 8143413 and 7e22474

Please sign in to comment.