4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
51 lines
1.4 KiB
Nix
51 lines
1.4 KiB
Nix
{ buildPythonPackage, wrapPython, python, fetchurl, lib, stdenv, cmake, qt5,
|
|
shiboken2, pyside2 }:
|
|
|
|
stdenv.mkDerivation {
|
|
pname = "pyside2-tools";
|
|
|
|
inherit (pyside2) version src;
|
|
|
|
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
|
|
];
|
|
|
|
postPatch = ''
|
|
cd sources/pyside2-tools
|
|
'';
|
|
|
|
nativeBuildInputs = [ cmake wrapPython ];
|
|
propagatedBuildInputs = [ shiboken2 pyside2 ];
|
|
buildInputs = [ python qt5.qtbase ];
|
|
|
|
cmakeFlags = [
|
|
"-DBUILD_TESTS=OFF"
|
|
];
|
|
|
|
# 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:
|
|
postInstall = ''
|
|
rm $out/bin/pyside_tool.py
|
|
|
|
for tool in uic rcc; do
|
|
makeWrapper "$(command -v $tool)" $out/bin/pyside2-$tool --add-flags "-g python"
|
|
done
|
|
'';
|
|
|
|
postFixup = ''
|
|
wrapPythonPrograms
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "PySide2 development tools";
|
|
license = licenses.gpl2;
|
|
homepage = "https://wiki.qt.io/Qt_for_Python";
|
|
maintainers = with maintainers; [ gebner ];
|
|
};
|
|
}
|