1{ python, fetchurl, lib, stdenv,
2 cmake, ninja, qt5, shiboken2 }:
3
4stdenv.mkDerivation rec {
5 pname = "pyside2";
6 version = "5.15.5";
7
8 src = fetchurl {
9 url = "https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src/pyside-setup-opensource-src-${version}.tar.xz";
10 sha256 = "0cwvw6695215498rsbm2xzkwaxdr3w7zfvy4kc62c01k6pxs881r";
11 };
12
13 patches = [
14 ./dont_ignore_optional_modules.patch
15 ];
16
17 postPatch = ''
18 cd sources/pyside2
19 '';
20
21 cmakeFlags = [
22 "-DBUILD_TESTS=OFF"
23 "-DPYTHON_EXECUTABLE=${python.interpreter}"
24 ];
25
26 NIX_CFLAGS_COMPILE = "-I${qt5.qtdeclarative.dev}/include/QtQuick/${qt5.qtdeclarative.version}/QtQuick";
27
28 nativeBuildInputs = [ cmake ninja qt5.qmake python ];
29 buildInputs = (with qt5; [
30 qtbase qtxmlpatterns qtmultimedia qttools qtx11extras qtlocation qtscript
31 qtwebsockets qtwebengine qtwebchannel qtcharts qtsensors qtsvg
32 ]) ++ [
33 python.pkgs.setuptools
34 ];
35 propagatedBuildInputs = [ shiboken2 ];
36
37 dontWrapQtApps = true;
38
39 postInstall = ''
40 cd ../../..
41 ${python.interpreter} setup.py egg_info --build-type=pyside2
42 cp -r PySide2.egg-info $out/${python.sitePackages}/
43 '';
44
45 meta = with lib; {
46 description = "LGPL-licensed Python bindings for Qt";
47 license = licenses.lgpl21;
48 homepage = "https://wiki.qt.io/Qt_for_Python";
49 maintainers = with maintainers; [ gebner ];
50 };
51}