Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ python
2, fetchurl
3, lib
4, stdenv
5, cmake
6, libxcrypt
7, ninja
8, qt5
9, shiboken2
10}:
11
12stdenv.mkDerivation rec {
13 pname = "pyside2";
14 version = "5.15.5";
15
16 src = fetchurl {
17 url = "https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src/pyside-setup-opensource-src-${version}.tar.xz";
18 sha256 = "0cwvw6695215498rsbm2xzkwaxdr3w7zfvy4kc62c01k6pxs881r";
19 };
20
21 patches = [
22 ./dont_ignore_optional_modules.patch
23 ];
24
25 postPatch = ''
26 cd sources/pyside2
27 '';
28
29 cmakeFlags = [
30 "-DBUILD_TESTS=OFF"
31 "-DPYTHON_EXECUTABLE=${python.interpreter}"
32 ];
33
34 NIX_CFLAGS_COMPILE = "-I${qt5.qtdeclarative.dev}/include/QtQuick/${qt5.qtdeclarative.version}/QtQuick";
35
36 nativeBuildInputs = [ cmake ninja qt5.qmake python ];
37
38 buildInputs = (with qt5; [
39 qtbase
40 qtxmlpatterns
41 qtmultimedia
42 qttools
43 qtx11extras
44 qtlocation
45 qtscript
46 qtwebsockets
47 qtwebengine
48 qtwebchannel
49 qtcharts
50 qtsensors
51 qtsvg
52 ]) ++ (with python.pkgs; [
53 setuptools
54 ]) ++ (lib.optionals (python.pythonOlder "3.9") [
55 # see similar issue: 202262
56 # libxcrypt is required for crypt.h for building older python modules
57 libxcrypt
58 ]);
59
60 propagatedBuildInputs = [ shiboken2 ];
61
62 dontWrapQtApps = true;
63
64 postInstall = ''
65 cd ../../..
66 ${python.interpreter} setup.py egg_info --build-type=pyside2
67 cp -r PySide2.egg-info $out/${python.sitePackages}/
68 '';
69
70 meta = with lib; {
71 description = "LGPL-licensed Python bindings for Qt";
72 license = licenses.lgpl21;
73 homepage = "https://wiki.qt.io/Qt_for_Python";
74 maintainers = with maintainers; [ gebner ];
75 };
76}