2021-12-06 16:07:01 +00:00
|
|
|
{ wrapPython, python, lib, stdenv, cmake, qt5,
|
2020-04-24 23:36:52 +00:00
|
|
|
shiboken2, pyside2 }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "pyside2-tools";
|
|
|
|
|
|
|
|
inherit (pyside2) version src;
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
patches = [
|
|
|
|
# Upstream has a crazy build system only geared towards producing binary
|
|
|
|
# wheels distributed via pypi. For this, they copy the `uic` and `rcc`
|
|
|
|
# binaries to the wheel.
|
|
|
|
./remove_hacky_binary_copying.patch
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postPatch = ''
|
|
|
|
cd sources/pyside2-tools
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake wrapPython ];
|
|
|
|
propagatedBuildInputs = [ shiboken2 pyside2 ];
|
|
|
|
buildInputs = [ python qt5.qtbase ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_TESTS=OFF"
|
|
|
|
];
|
|
|
|
|
2021-02-19 19:06:45 +00:00
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
# The upstream build system consists of a `setup.py` whichs builds three
|
|
|
|
# different python libraries and calls cmake as a subprocess. We call cmake
|
|
|
|
# directly because that's easier to get working. However, the `setup.py`
|
|
|
|
# build also creates a few wrapper scripts, which we replicate here:
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall = ''
|
|
|
|
rm $out/bin/pyside_tool.py
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
for tool in uic rcc; do
|
|
|
|
makeWrapper "$(command -v $tool)" $out/bin/pyside2-$tool --add-flags "-g python"
|
|
|
|
done
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
wrapPythonPrograms
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "PySide2 development tools";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
homepage = "https://wiki.qt.io/Qt_for_Python";
|
|
|
|
maintainers = with maintainers; [ gebner ];
|
|
|
|
};
|
|
|
|
}
|