1{
2 python,
3 lib,
4 stdenv,
5 pyside2,
6 cmake,
7 qt5,
8 libxcrypt,
9 llvmPackages_15,
10 pythonAtLeast,
11}:
12
13stdenv.mkDerivation {
14 pname = "shiboken2";
15
16 inherit (pyside2) version src;
17
18 patches = [ ./nix_compile_cflags.patch ];
19
20 postPatch = ''
21 cd sources/shiboken2
22 '';
23
24 CLANG_INSTALL_DIR = llvmPackages_15.libclang.out;
25
26 nativeBuildInputs = [ cmake ];
27
28 buildInputs =
29 [
30 llvmPackages_15.libclang
31 python
32 python.pkgs.setuptools
33 qt5.qtbase
34 qt5.qtxmlpatterns
35 ]
36 ++ (lib.optionals (python.pythonOlder "3.9") [
37 # see similar issue: 202262
38 # libxcrypt is required for crypt.h for building older python modules
39 libxcrypt
40 ]);
41
42 cmakeFlags = [ "-DBUILD_TESTS=OFF" ];
43
44 dontWrapQtApps = true;
45
46 postInstall = ''
47 cd ../../..
48 ${python.pythonOnBuildForHost.interpreter} setup.py egg_info --build-type=shiboken2
49 cp -r shiboken2.egg-info $out/${python.sitePackages}/
50 rm $out/bin/shiboken_tool.py
51 '';
52
53 meta = with lib; {
54 description = "Generator for the PySide2 Qt bindings";
55 mainProgram = "shiboken2";
56 license = with licenses; [
57 gpl2
58 lgpl21
59 ];
60 homepage = "https://wiki.qt.io/Qt_for_Python";
61 maintainers = with maintainers; [ gebner ];
62 broken = pythonAtLeast "3.12";
63 };
64}