1{
2 wrapPython,
3 python,
4 lib,
5 stdenv,
6 cmake,
7 qt5,
8 distutils,
9 shiboken2,
10 pyside2,
11}:
12
13stdenv.mkDerivation {
14 pname = "pyside2-tools";
15
16 inherit (pyside2) version src;
17
18 patches = [
19 # Upstream has a crazy build system only geared towards producing binary
20 # wheels distributed via pypi. For this, they copy the `uic` and `rcc`
21 # binaries to the wheel.
22 ./remove_hacky_binary_copying.patch
23 ];
24
25 postPatch = ''
26 cd sources/pyside2-tools
27 '';
28
29 nativeBuildInputs = [
30 cmake
31 distutils
32 wrapPython
33 ];
34 propagatedBuildInputs = [
35 shiboken2
36 pyside2
37 ];
38 buildInputs = [
39 python
40 qt5.qtbase
41 ];
42
43 cmakeFlags = [ "-DBUILD_TESTS=OFF" ];
44
45 dontWrapQtApps = true;
46
47 # The upstream build system consists of a `setup.py` whichs builds three
48 # different python libraries and calls cmake as a subprocess. We call cmake
49 # directly because that's easier to get working. However, the `setup.py`
50 # build also creates a few wrapper scripts, which we replicate here:
51 postInstall = ''
52 rm $out/bin/pyside_tool.py
53
54 for tool in uic rcc; do
55 makeWrapper "$(command -v $tool)" $out/bin/pyside2-$tool --add-flags "-g python"
56 done
57 '';
58
59 postFixup = ''
60 wrapPythonPrograms
61 '';
62
63 meta = with lib; {
64 description = "PySide2 development tools";
65 license = licenses.gpl2;
66 homepage = "https://wiki.qt.io/Qt_for_Python";
67 maintainers = with maintainers; [ ];
68 };
69}