about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pyside
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/pyside')
-rw-r--r--nixpkgs/pkgs/development/python-modules/pyside/apiextractor.nix25
-rw-r--r--nixpkgs/pkgs/development/python-modules/pyside/default.nix27
-rw-r--r--nixpkgs/pkgs/development/python-modules/pyside/gcc6.patch18
-rw-r--r--nixpkgs/pkgs/development/python-modules/pyside/generatorrunner.nix27
-rw-r--r--nixpkgs/pkgs/development/python-modules/pyside/shiboken.nix39
-rw-r--r--nixpkgs/pkgs/development/python-modules/pyside/shiboken_py35.patch12
-rw-r--r--nixpkgs/pkgs/development/python-modules/pyside/tools.nix29
7 files changed, 177 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/pyside/apiextractor.nix b/nixpkgs/pkgs/development/python-modules/pyside/apiextractor.nix
new file mode 100644
index 000000000000..d9168f291c02
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/pyside/apiextractor.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, cmake, libxml2, libxslt, python2, qt4 }:
+
+# 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 {
+    url = "https://github.com/PySide/Apiextractor/archive/0.10.10.tar.gz";
+    sha256 = "1zj8yrxy08iv1pk38djxw3faimm226w6wmi0gm32w4yczblylwz3";
+  };
+
+  enableParallelBuilding = true;
+
+  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";
+    license = stdenv.lib.licenses.gpl2;
+    homepage = http://www.pyside.org/docs/apiextractor/;
+    maintainers = [ ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/python-modules/pyside/default.nix b/nixpkgs/pkgs/development/python-modules/pyside/default.nix
new file mode 100644
index 000000000000..37ffd8e76e30
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/pyside/default.nix
@@ -0,0 +1,27 @@
+{ lib, fetchurl, cmake, buildPythonPackage, pysideGeneratorrunner, pysideShiboken, qt4, mesa }:
+
+# This derivation provides a Python module and should therefore be called via `python-packages.nix`.
+buildPythonPackage rec {
+  pname = "pyside";
+  version = "1.2.4";
+  format = "other";
+
+  src = fetchurl {
+    url = "https://github.com/PySide/PySide/archive/${version}.tar.gz";
+    sha256 = "90f2d736e2192ac69e5a2ac798fce2b5f7bf179269daa2ec262986d488c3b0f7";
+  };
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ cmake pysideGeneratorrunner pysideShiboken qt4 ];
+
+  buildInputs = [ mesa ];
+
+  makeFlags = "QT_PLUGIN_PATH=" + pysideShiboken + "/lib/generatorrunner";
+
+  meta = {
+    description = "LGPL-licensed Python bindings for the Qt cross-platform application and UI framework";
+    license = lib.licenses.lgpl21;
+    homepage = http://www.pyside.org;
+  };
+}
diff --git a/nixpkgs/pkgs/development/python-modules/pyside/gcc6.patch b/nixpkgs/pkgs/development/python-modules/pyside/gcc6.patch
new file mode 100644
index 000000000000..440e94508c57
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/pyside/gcc6.patch
@@ -0,0 +1,18 @@
+--- Shiboken-1.2.4.org/tests/libsample/simplefile.cpp	2017-08-26 09:06:27.216859143 +0100
++++ Shiboken-1.2.4/tests/libsample/simplefile.cpp	2017-08-26 09:05:40.037029652 +0100
+@@ -90,13 +90,13 @@
+ SimpleFile::exists() const
+ {
+     std::ifstream ifile(p->m_filename);
+-    return ifile;
++    return (bool)ifile;
+ }
+ 
+ bool
+ SimpleFile::exists(const char* filename)
+ {
+     std::ifstream ifile(filename);
+-    return ifile;
++    return (bool)ifile;
+ }
+ 
diff --git a/nixpkgs/pkgs/development/python-modules/pyside/generatorrunner.nix b/nixpkgs/pkgs/development/python-modules/pyside/generatorrunner.nix
new file mode 100644
index 000000000000..0950726172d5
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/pyside/generatorrunner.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, cmake, pysideApiextractor, python2, qt4 }:
+
+# 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 ]);
+  pname = "pyside-generatorrunner";
+  version = "0.6.16";
+in stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/PySide/Generatorrunner/archive/0.6.16.tar.gz";
+    sha256 = "0vzk3cp0pfbhd921r8f1xkcz96znla39dhj074k623x9k26lj2sj";
+  };
+
+  enableParallelBuilding = true;
+
+  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";
+    license = stdenv.lib.licenses.gpl2;
+    homepage = http://www.pyside.org/docs/generatorrunner/;
+    maintainers = [ ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/python-modules/pyside/shiboken.nix b/nixpkgs/pkgs/development/python-modules/pyside/shiboken.nix
new file mode 100644
index 000000000000..42ad55ad0b95
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/pyside/shiboken.nix
@@ -0,0 +1,39 @@
+{ lib, fetchurl, cmake, buildPythonPackage, libxml2, libxslt, pysideApiextractor, pysideGeneratorrunner, python, sphinx, qt4, isPy3k, isPy35, isPy36, isPy37 }:
+
+# 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
+buildPythonPackage rec {
+  pname = "pyside-shiboken";
+  version = "1.2.4";
+
+  format = "other";
+
+  src = fetchurl {
+    url = "https://github.com/PySide/Shiboken/archive/${version}.tar.gz";
+    sha256 = "1536f73a3353296d97a25e24f9554edf3e6a48126886f8d21282c3645ecb96a4";
+  };
+
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ cmake libxml2 libxslt pysideApiextractor pysideGeneratorrunner python sphinx qt4 ];
+
+  preConfigure = ''
+    echo "preConfigure: Fixing shiboken_generator install target."
+    substituteInPlace generator/CMakeLists.txt --replace \
+      \"$\{GENERATORRUNNER_PLUGIN_DIR}\" lib/generatorrunner/
+  '';
+
+  # gcc6 patch was also sent upstream: https://github.com/pyside/Shiboken/pull/86
+  patches = [ ./gcc6.patch ] ++ (lib.optional (isPy35 || isPy36 || isPy37) ./shiboken_py35.patch);
+
+  cmakeFlags = if isPy3k then "-DUSE_PYTHON3=TRUE" else null;
+
+  meta = {
+    description = "Plugin (front-end) for pyside-generatorrunner, that generates bindings for C++ libraries using CPython source code";
+    license = lib.licenses.gpl2;
+    homepage = http://www.pyside.org/docs/shiboken/;
+    maintainers = [ ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/python-modules/pyside/shiboken_py35.patch b/nixpkgs/pkgs/development/python-modules/pyside/shiboken_py35.patch
new file mode 100644
index 000000000000..fb095cf991cf
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/pyside/shiboken_py35.patch
@@ -0,0 +1,12 @@
+diff --git a/cmake/Modules/FindPython3Libs.cmake b/cmake/Modules/FindPython3Libs.cmake
+--- a/cmake/Modules/FindPython3Libs.cmake
++++ b/cmake/Modules/FindPython3Libs.cmake
+@@ -27,7 +27,7 @@ INCLUDE(CMakeFindFrameworks)
+ # Search for the python framework on Apple.
+ # CMAKE_FIND_FRAMEWORKS(Python)
+ 
+-FOREACH(_CURRENT_VERSION 3.4 3.3 3.2 3.1 3.0)
++FOREACH(_CURRENT_VERSION 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
+   IF(_CURRENT_VERSION GREATER 3.1)
+       SET(_32FLAGS "m" "u" "mu" "dm" "du" "dmu" "")
+   ELSE()
diff --git a/nixpkgs/pkgs/development/python-modules/pyside/tools.nix b/nixpkgs/pkgs/development/python-modules/pyside/tools.nix
new file mode 100644
index 000000000000..e23e63525183
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/pyside/tools.nix
@@ -0,0 +1,29 @@
+{ lib, fetchurl, cmake, pyside, qt4, pysideShiboken, buildPythonPackage }:
+
+# This derivation provides a Python module and should therefore be called via `python-packages.nix`.
+buildPythonPackage rec {
+  pname = "pyside-tools";
+  version = "0.2.15";
+  format = "other";
+
+  src = fetchurl {
+    url = "https://github.com/PySide/Tools/archive/0.2.15.tar.gz";
+    sha256 = "0x4z3aq7jgar74gxzwznl3agla9i1dcskw5gh11jnnwwn63ffzwa";
+  };
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ qt4 ];
+
+  propagatedBuildInputs = [ pyside pysideShiboken ];
+
+  meta = {
+    description = "Tools for pyside, the LGPL-licensed Python bindings for the Qt cross-platform application and UI framework";
+    license = lib.licenses.gpl2;
+    homepage = http://www.pyside.org;
+    maintainers = [ ];
+    platforms = lib.platforms.all;
+  };
+}