git.iko.soy/typeable/nixpkgs
on master help sign in
pyside: fix on Python 3.x, closes #25328

Pyside requires several tools that do not provide Python modules. They therefore do not need to be build Python-version dependent and so we move them out of `python-packages.nix`. Furthermore, shiboken needs libxml2 and libxslt libraries but not their Python bindings.

commita4aaf5adfd5f290e17d3960528db55e1ef5fbf13 authorFrederik Rietdijk <fridh@fridh.nl> dateSun 30 Apr 2017, 10:29 (10 years ago) parentd729a25
7 files changed+50−27
pkgs/development/python-modules/pyside/apiextractor.nix+6−3 pkgs/development/python-modules/pyside/default.nix+1 pkgs/development/python-modules/pyside/generatorrunner.nix+9−4 pkgs/development/python-modules/pyside/shiboken.nix+10−6 pkgs/development/python-modules/pyside/tools.nix+11−7 pkgs/top-level/all-packages.nix+5 pkgs/top-level/python-packages.nix+8−7
pkgs/development/python-modules/pyside/apiextractor.nix+6−3
@@ -1,6 +1,9 @@
1−{ stdenv, fetchurl, cmake, libxml2, libxslt, python, sphinx, qt4 }:
1+{ stdenv, fetchurl, cmake, libxml2, libxslt, python2, qt4 }:
22
3−stdenv.mkDerivation {
3+# This derivation does not provide any Python module and should therefore be called via `all-packages.nix`.
4+let
5+ pythonEnv = python2.withPackages(ps: with ps; [ sphinx ]);
6+in stdenv.mkDerivation {
47 name = "pyside-apiextractor-0.10.10";
58
69 src = fetchurl {
@@ -10,7 +13,7 @@ stdenv.mkDerivation {
1013
1114 enableParallelBuilding = true;
1215
13− buildInputs = [ cmake libxml2 libxslt sphinx qt4 ];
16+ buildInputs = [ cmake qt4 pythonEnv libxml2 libxslt ];
1417
1518 meta = {
1619 description = "Eases the development of bindings of Qt-based libraries for high level languages by automating most of the process";
pkgs/development/python-modules/pyside/default.nix+1
@@ -1,5 +1,6 @@
11{ lib, fetchurl, cmake, python, buildPythonPackage, pysideGeneratorrunner, pysideShiboken, qt4 }:
22
3+# This derivation provides a Python module and should therefore be called via `python-packages.nix`.
34buildPythonPackage rec {
45 name = "pyside-${version}";
56 version = "1.2.4";
pkgs/development/python-modules/pyside/generatorrunner.nix+9−4
@@ -1,7 +1,12 @@
1−{ stdenv, fetchurl, cmake, pysideApiextractor, python, sphinx, qt4 }:
1+{ stdenv, fetchurl, cmake, pysideApiextractor, python2, qt4 }:
22
3−stdenv.mkDerivation {
4− name = "pyside-generatorrunner-0.6.16";
3+# This derivation does not provide any Python module and should therefore be called via `all-packages.nix`.
4+let
5+ pythonEnv = python2.withPackages(ps: with ps; [ sphinx ]);
6+in stdenv.mkDerivation rec {
7+ pname = "pyside-generatorrunner";
8+ version = "0.6.16";
9+ name = "${pname}-${version}";
510
611 src = fetchurl {
712 url = "https://github.com/PySide/Generatorrunner/archive/0.6.16.tar.gz";
@@ -10,7 +15,7 @@ stdenv.mkDerivation {
1015
1116 enableParallelBuilding = true;
1217
13− buildInputs = [ cmake pysideApiextractor sphinx qt4 ];
18+ buildInputs = [ cmake pysideApiextractor qt4 pythonEnv ];
1419
1520 meta = {
1621 description = "Eases the development of binding generators for C++ and Qt-based libraries by providing a framework to help automating most of the process";
pkgs/development/python-modules/pyside/shiboken.nix+10−6
@@ -1,10 +1,14 @@
1−{ stdenv, fetchurl, cmake, libxml2, libxslt, pysideApiextractor, pysideGeneratorrunner, python, sphinx, qt4, isPy3k, isPy35 }:
1+{ lib, fetchurl, cmake, buildPythonPackage, libxml2, libxslt, pysideApiextractor, pysideGeneratorrunner, python, sphinx, qt4, isPy3k, isPy35 }:
22
3+# This derivation provides a Python module and should therefore be called via `python-packages.nix`.
34# Python 3.5 is not supported: https://github.com/PySide/Shiboken/issues/77
4−stdenv.mkDerivation rec {
5− name = "pyside-shiboken-${version}";
5+buildPythonPackage rec {
6+ name = "${pname}-${version}";
7+ pname = "pyside-shiboken";
68 version = "1.2.4";
79
10+ format = "other";
11+
812 src = fetchurl {
913 url = "https://github.com/PySide/Shiboken/archive/${version}.tar.gz";
1014 sha256 = "1536f73a3353296d97a25e24f9554edf3e6a48126886f8d21282c3645ecb96a4";
@@ -25,9 +29,9 @@ stdenv.mkDerivation rec {
2529
2630 meta = {
2731 description = "Plugin (front-end) for pyside-generatorrunner, that generates bindings for C++ libraries using CPython source code";
28− license = stdenv.lib.licenses.gpl2;
32+ license = lib.licenses.gpl2;
2933 homepage = "http://www.pyside.org/docs/shiboken/";
30− maintainers = [ stdenv.lib.maintainers.chaoflow ];
31− platforms = stdenv.lib.platforms.all;
34+ maintainers = [ lib.maintainers.chaoflow ];
35+ platforms = lib.platforms.all;
3236 };
3337}
pkgs/development/python-modules/pyside/tools.nix+11−7
@@ -1,7 +1,11 @@
1−{ stdenv, fetchurl, cmake, pyside, python, qt4, pysideShiboken }:
1+{ lib, fetchurl, cmake, pyside, qt4, pysideShiboken, buildPythonPackage }:
22
3−stdenv.mkDerivation {
4− name = "pyside-tools-0.2.15";
3+# This derivation provides a Python module and should therefore be called via `python-packages.nix`.
4+buildPythonPackage rec {
5+ pname = "pyside-tools";
6+ version = "0.2.15";
7+ name = "${pname}-${version}";
8+ format = "other";
59
610 src = fetchurl {
711 url = "https://github.com/PySide/Tools/archive/0.2.15.tar.gz";
@@ -10,13 +14,13 @@ stdenv.mkDerivation {
1014
1115 enableParallelBuilding = true;
1216
13− buildInputs = [ cmake pyside python qt4 pysideShiboken ];
17+ buildInputs = [ cmake pyside qt4 pysideShiboken ];
1418
1519 meta = {
1620 description = "Tools for pyside, the LGPL-licensed Python bindings for the Qt cross-platform application and UI framework";
17− license = stdenv.lib.licenses.gpl2;
21+ license = lib.licenses.gpl2;
1822 homepage = "http://www.pyside.org";
19− maintainers = [ stdenv.lib.maintainers.chaoflow ];
20− platforms = stdenv.lib.platforms.all;
23+ maintainers = [ lib.maintainers.chaoflow ];
24+ platforms = lib.platforms.all;
2125 };
2226}
pkgs/top-level/all-packages.nix+5
@@ -6124,6 +6124,11 @@ with pkgs;
61246124 pythonPackages = python3Packages;
61256125 };
61266126
6127+ # These pyside tools do not provide any Python modules and are meant to be here.
6128+ # See ../development/python-modules/pyside/default.nix for details.
6129+ pysideApiextractor = callPackage ../development/python-modules/pyside/apiextractor.nix { };
6130+ pysideGeneratorrunner = callPackage ../development/python-modules/pyside/generatorrunner.nix { };
6131+
61276132 svg2tikz = python27Packages.svg2tikz;
61286133
61296134 pyrex = pyrex095;
pkgs/top-level/python-packages.nix+8−7
@@ -49,8 +49,11 @@ let
4949 fetchSource = {pname, version, sha256}:
5050 # Fetch a source tarball.
5151 let
52− url = "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${pname}-${version}.tar.gz";
53− in pkgs.fetchurl {inherit url sha256;};
52+ urls = [
53+ "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${pname}-${version}.tar.gz"
54+ "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${pname}-${version}.zip"
55+ ];
56+ in pkgs.fetchurl {inherit urls sha256;};
5457 fetcher = (if format == "wheel" then fetchWheel
5558 else if format == "setuptools" then fetchSource
5659 else throw "Unsupported kind ${kind}");
@@ -369,11 +372,9 @@ in {
369372
370373 pyside = callPackage ../development/python-modules/pyside { };
371374
372− pysideApiextractor = callPackage ../development/python-modules/pyside/apiextractor.nix { };
373−
374− pysideGeneratorrunner = callPackage ../development/python-modules/pyside/generatorrunner.nix { };
375−
376− pysideShiboken = callPackage ../development/python-modules/pyside/shiboken.nix { };
375+ pysideShiboken = callPackage ../development/python-modules/pyside/shiboken.nix {
376+ inherit (pkgs) libxml2 libxslt; # Do not need the Python bindings.
377+ };
377378
378379 pysideTools = callPackage ../development/python-modules/pyside/tools.nix { };
379380