about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pyside/shiboken.nix
blob: 29dba5e8f5ec10c8c57f3880568cff0340aa4a19 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{ lib, fetchurl, buildPythonPackage
, cmake
, libxml2
, pkg-config
, libxslt
, pysideApiextractor
, pysideGeneratorrunner
, python
, sphinx
, qt4
, isPy3k
, isPy35
, isPy36
, isPy37
}:

buildPythonPackage rec {
  pname = "pyside-shiboken";
  version = "1.2.4";
  disabled = !isPy3k;

  format = "other";

  src = fetchurl {
    url = "https://github.com/PySide/Shiboken/archive/${version}.tar.gz";
    sha256 = "1536f73a3353296d97a25e24f9554edf3e6a48126886f8d21282c3645ecb96a4";
  };

  enableParallelBuilding = true;

  nativeBuildInputs = [ cmake pkg-config pysideApiextractor pysideGeneratorrunner sphinx qt4 ];

  buildInputs = [ python libxml2 libxslt ];

  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 = lib.optionals isPy3k [
    "-DUSE_PYTHON3=TRUE"
    "-DPYTHON3_INCLUDE_DIR=${lib.getDev python}/include/${python.libPrefix}"
    "-DPYTHON3_LIBRARY=${lib.getLib python}/lib"
  ];

  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;
  };
}