biome: 1.9.2 -> 1.9.3 (#349335)
[NixPkgs.git] / pkgs / development / python-modules / pyside2 / default.nix
blob2a3ff3c5ad34330caa07db249f22507e3a6a1b85
2   python,
3   fetchurl,
4   lib,
5   stdenv,
6   cmake,
7   libxcrypt,
8   ninja,
9   qt5,
10   shiboken2,
12 stdenv.mkDerivation rec {
13   pname = "pyside2";
14   version = "5.15.14";
16   src = fetchurl {
17     url = "https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src/pyside-setup-opensource-src-${version}.tar.xz";
18     hash = "sha256-MmURlPamt7zkLwTmixQBrSCH5HiaTI8/uGSehhicY3I=";
19   };
21   patches = [
22     ./nix_compile_cflags.patch
23     ./Final-details-to-enable-3.12-wheel-compatibility.patch
24     ./Python-3.12-Fix-the-structure-of-class-property.patch
25     ./Support-running-PySide-on-Python-3.12.patch
26     ./shiboken2-clang-Fix-and-simplify-resolveType-helper.patch
27     ./shiboken2-clang-Fix-build-with-clang-16.patch
28     ./shiboken2-clang-Fix-clashes-between-type-name-and-enumera.patch
29     ./shiboken2-clang-Record-scope-resolution-of-arguments-func.patch
30     ./shiboken2-clang-Remove-typedef-expansion.patch
31     ./shiboken2-clang-Suppress-class-scope-look-up-for-paramete.patch
32     ./shiboken2-clang-Write-scope-resolution-for-all-parameters.patch
33     ./dont_ignore_optional_modules.patch
34     ./Modify-sendCommand-signatures.patch
35   ];
37   postPatch = ''
38     cd sources/pyside2
39   '';
41   cmakeFlags = [
42     "-DBUILD_TESTS=OFF"
43     "-DPYTHON_EXECUTABLE=${python.interpreter}"
44   ];
46   env.NIX_CFLAGS_COMPILE = "-I${qt5.qtdeclarative.dev}/include/QtQuick/${qt5.qtdeclarative.version}/QtQuick";
48   nativeBuildInputs = [
49     cmake
50     ninja
51     qt5.qmake
52     (python.withPackages (
53       ps: with ps; [
54         distutils
55         setuptools
56       ]
57     ))
58   ];
60   buildInputs =
61     (with qt5; [
62       qtbase
63       qtxmlpatterns
64       qtmultimedia
65       qttools
66       qtx11extras
67       qtlocation
68       qtscript
69       qtwebsockets
70       qtwebengine
71       qtwebchannel
72       qtcharts
73       qtsensors
74       qtsvg
75       qt3d
76     ])
77     ++ (with python.pkgs; [ setuptools ])
78     ++ (lib.optionals (python.pythonOlder "3.9") [
79       # see similar issue: 202262
80       # libxcrypt is required for crypt.h for building older python modules
81       libxcrypt
82     ]);
84   propagatedBuildInputs = [ shiboken2 ];
86   dontWrapQtApps = true;
88   postInstall = ''
89     cd ../../..
90     ${python.pythonOnBuildForHost.interpreter} setup.py egg_info --build-type=pyside2
91     cp -r PySide2.egg-info $out/${python.sitePackages}/
92   '';
94   meta = with lib; {
95     description = "LGPL-licensed Python bindings for Qt";
96     license = licenses.lgpl21;
97     homepage = "https://wiki.qt.io/Qt_for_Python";
98     maintainers = with maintainers; [ gebner ];
99     platforms = platforms.all;
100     broken = stdenv.hostPlatform.isDarwin;
101   };