1{ lib, fetchurl, cmake, buildPythonPackage, libxml2, libxslt, pysideApiextractor, pysideGeneratorrunner, python, sphinx, qt4, isPy3k, isPy35, isPy36 }:
2
3# This derivation provides a Python module and should therefore be called via `python-packages.nix`.
4# Python 3.5 is not supported: https://github.com/PySide/Shiboken/issues/77
5buildPythonPackage rec {
6 name = "${pname}-${version}";
7 pname = "pyside-shiboken";
8 version = "1.2.4";
9
10 format = "other";
11
12 src = fetchurl {
13 url = "https://github.com/PySide/Shiboken/archive/${version}.tar.gz";
14 sha256 = "1536f73a3353296d97a25e24f9554edf3e6a48126886f8d21282c3645ecb96a4";
15 };
16
17
18 enableParallelBuilding = true;
19
20 buildInputs = [ cmake libxml2 libxslt pysideApiextractor pysideGeneratorrunner python sphinx qt4 ];
21
22 preConfigure = ''
23 echo "preConfigure: Fixing shiboken_generator install target."
24 substituteInPlace generator/CMakeLists.txt --replace \
25 \"$\{GENERATORRUNNER_PLUGIN_DIR}\" lib/generatorrunner/
26 '';
27
28 # gcc6 patch was also sent upstream: https://github.com/pyside/Shiboken/pull/86
29 patches = [ ./gcc6.patch ] ++ (lib.optional (isPy35 || isPy36) ./shiboken_py35.patch);
30
31 cmakeFlags = if isPy3k then "-DUSE_PYTHON3=TRUE" else null;
32
33 meta = {
34 description = "Plugin (front-end) for pyside-generatorrunner, that generates bindings for C++ libraries using CPython source code";
35 license = lib.licenses.gpl2;
36 homepage = http://www.pyside.org/docs/shiboken/;
37 maintainers = [ lib.maintainers.chaoflow ];
38 platforms = lib.platforms.all;
39 };
40}