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