diff --git a/pkgs/development/python-modules/pyside/apiextractor.nix b/pkgs/development/python-modules/pyside/apiextractor.nix index a27a365bb2cd..e02f32f223df 100644 --- a/pkgs/development/python-modules/pyside/apiextractor.nix +++ b/pkgs/development/python-modules/pyside/apiextractor.nix @@ -1,6 +1,9 @@ -{ stdenv, fetchurl, cmake, libxml2, libxslt, python, sphinx, qt4 }: +{ stdenv, fetchurl, cmake, libxml2, libxslt, python2, qt4 }: -stdenv.mkDerivation { +# This derivation does not provide any Python module and should therefore be called via `all-packages.nix`. +let + pythonEnv = python2.withPackages(ps: with ps; [ sphinx ]); +in stdenv.mkDerivation { name = "pyside-apiextractor-0.10.10"; src = fetchurl { @@ -10,7 +13,7 @@ stdenv.mkDerivation { enableParallelBuilding = true; - buildInputs = [ cmake libxml2 libxslt sphinx qt4 ]; + buildInputs = [ cmake qt4 pythonEnv libxml2 libxslt ]; meta = { description = "Eases the development of bindings of Qt-based libraries for high level languages by automating most of the process"; diff --git a/pkgs/development/python-modules/pyside/default.nix b/pkgs/development/python-modules/pyside/default.nix index 4aff09b8f8f5..009afdd3a030 100644 --- a/pkgs/development/python-modules/pyside/default.nix +++ b/pkgs/development/python-modules/pyside/default.nix @@ -1,5 +1,6 @@ { lib, fetchurl, cmake, python, buildPythonPackage, pysideGeneratorrunner, pysideShiboken, qt4 }: +# This derivation provides a Python module and should therefore be called via `python-packages.nix`. buildPythonPackage rec { name = "pyside-${version}"; version = "1.2.4"; diff --git a/pkgs/development/python-modules/pyside/generatorrunner.nix b/pkgs/development/python-modules/pyside/generatorrunner.nix index 28ea88ad1fa4..8ecf2734832a 100644 --- a/pkgs/development/python-modules/pyside/generatorrunner.nix +++ b/pkgs/development/python-modules/pyside/generatorrunner.nix @@ -1,7 +1,12 @@ -{ stdenv, fetchurl, cmake, pysideApiextractor, python, sphinx, qt4 }: +{ stdenv, fetchurl, cmake, pysideApiextractor, python2, qt4 }: -stdenv.mkDerivation { - name = "pyside-generatorrunner-0.6.16"; +# This derivation does not provide any Python module and should therefore be called via `all-packages.nix`. +let + pythonEnv = python2.withPackages(ps: with ps; [ sphinx ]); +in stdenv.mkDerivation rec { + pname = "pyside-generatorrunner"; + version = "0.6.16"; + name = "${pname}-${version}"; src = fetchurl { url = "https://github.com/PySide/Generatorrunner/archive/0.6.16.tar.gz"; @@ -10,7 +15,7 @@ stdenv.mkDerivation { enableParallelBuilding = true; - buildInputs = [ cmake pysideApiextractor sphinx qt4 ]; + buildInputs = [ cmake pysideApiextractor qt4 pythonEnv ]; meta = { description = "Eases the development of binding generators for C++ and Qt-based libraries by providing a framework to help automating most of the process"; diff --git a/pkgs/development/python-modules/pyside/shiboken.nix b/pkgs/development/python-modules/pyside/shiboken.nix index 8c91b63d0e11..cef78c215500 100644 --- a/pkgs/development/python-modules/pyside/shiboken.nix +++ b/pkgs/development/python-modules/pyside/shiboken.nix @@ -1,10 +1,14 @@ -{ stdenv, fetchurl, cmake, libxml2, libxslt, pysideApiextractor, pysideGeneratorrunner, python, sphinx, qt4, isPy3k, isPy35 }: +{ lib, fetchurl, cmake, buildPythonPackage, libxml2, libxslt, pysideApiextractor, pysideGeneratorrunner, python, sphinx, qt4, isPy3k, isPy35 }: +# This derivation provides a Python module and should therefore be called via `python-packages.nix`. # Python 3.5 is not supported: https://github.com/PySide/Shiboken/issues/77 -stdenv.mkDerivation rec { - name = "pyside-shiboken-${version}"; +buildPythonPackage rec { + name = "${pname}-${version}"; + pname = "pyside-shiboken"; version = "1.2.4"; + format = "other"; + src = fetchurl { url = "https://github.com/PySide/Shiboken/archive/${version}.tar.gz"; sha256 = "1536f73a3353296d97a25e24f9554edf3e6a48126886f8d21282c3645ecb96a4"; @@ -25,9 +29,9 @@ stdenv.mkDerivation rec { meta = { description = "Plugin (front-end) for pyside-generatorrunner, that generates bindings for C++ libraries using CPython source code"; - license = stdenv.lib.licenses.gpl2; + license = lib.licenses.gpl2; homepage = "http://www.pyside.org/docs/shiboken/"; - maintainers = [ stdenv.lib.maintainers.chaoflow ]; - platforms = stdenv.lib.platforms.all; + maintainers = [ lib.maintainers.chaoflow ]; + platforms = lib.platforms.all; }; } diff --git a/pkgs/development/python-modules/pyside/tools.nix b/pkgs/development/python-modules/pyside/tools.nix index 11f2bd97175c..9d02a016e723 100644 --- a/pkgs/development/python-modules/pyside/tools.nix +++ b/pkgs/development/python-modules/pyside/tools.nix @@ -1,7 +1,11 @@ -{ stdenv, fetchurl, cmake, pyside, python, qt4, pysideShiboken }: +{ lib, fetchurl, cmake, pyside, qt4, pysideShiboken, buildPythonPackage }: -stdenv.mkDerivation { - name = "pyside-tools-0.2.15"; +# This derivation provides a Python module and should therefore be called via `python-packages.nix`. +buildPythonPackage rec { + pname = "pyside-tools"; + version = "0.2.15"; + name = "${pname}-${version}"; + format = "other"; src = fetchurl { url = "https://github.com/PySide/Tools/archive/0.2.15.tar.gz"; @@ -10,13 +14,13 @@ stdenv.mkDerivation { enableParallelBuilding = true; - buildInputs = [ cmake pyside python qt4 pysideShiboken ]; + buildInputs = [ cmake pyside qt4 pysideShiboken ]; meta = { description = "Tools for pyside, the LGPL-licensed Python bindings for the Qt cross-platform application and UI framework"; - license = stdenv.lib.licenses.gpl2; + license = lib.licenses.gpl2; homepage = "http://www.pyside.org"; - maintainers = [ stdenv.lib.maintainers.chaoflow ]; - platforms = stdenv.lib.platforms.all; + maintainers = [ lib.maintainers.chaoflow ]; + platforms = lib.platforms.all; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index feca045ebe17..f3d6104166bb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6124,6 +6124,11 @@ with pkgs; pythonPackages = python3Packages; }; + # These pyside tools do not provide any Python modules and are meant to be here. + # See ../development/python-modules/pyside/default.nix for details. + pysideApiextractor = callPackage ../development/python-modules/pyside/apiextractor.nix { }; + pysideGeneratorrunner = callPackage ../development/python-modules/pyside/generatorrunner.nix { }; + svg2tikz = python27Packages.svg2tikz; pyrex = pyrex095; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 92457ae67aba..06f778b7180f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -49,8 +49,11 @@ let fetchSource = {pname, version, sha256}: # Fetch a source tarball. let - url = "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${pname}-${version}.tar.gz"; - in pkgs.fetchurl {inherit url sha256;}; + urls = [ + "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${pname}-${version}.tar.gz" + "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${pname}-${version}.zip" + ]; + in pkgs.fetchurl {inherit urls sha256;}; fetcher = (if format == "wheel" then fetchWheel else if format == "setuptools" then fetchSource else throw "Unsupported kind ${kind}"); @@ -369,11 +372,9 @@ in { pyside = callPackage ../development/python-modules/pyside { }; - pysideApiextractor = callPackage ../development/python-modules/pyside/apiextractor.nix { }; - - pysideGeneratorrunner = callPackage ../development/python-modules/pyside/generatorrunner.nix { }; - - pysideShiboken = callPackage ../development/python-modules/pyside/shiboken.nix { }; + pysideShiboken = callPackage ../development/python-modules/pyside/shiboken.nix { + inherit (pkgs) libxml2 libxslt; # Do not need the Python bindings. + }; pysideTools = callPackage ../development/python-modules/pyside/tools.nix { };