python3Packages.dbus-python: Switch to finalAttrs pattern

It was not supported when 6ffea0de4c was introduced.
This commit is contained in:
Jan Tojnar
2026-07-11 10:48:15 +02:00
parent e73de5be04
commit 0dd4000289

View File

@@ -16,83 +16,83 @@
dbus-glib,
}:
lib.fix (
finalPackage:
buildPythonPackage rec {
buildPythonPackage (finalAttrs: {
pname = "dbus-python";
version = "1.4.0";
pyproject = true;
disabled = isPyPy;
outputs = [
"out"
"dev"
];
src = fetchPypi {
pname = "dbus-python";
version = "1.4.0";
pyproject = true;
inherit (finalAttrs) version;
hash = "sha256-mRZm5Jj2Db8+Sbi3Z49VWbimUDT99hquYs3s232Jx3A=";
};
disabled = isPyPy;
patches = [
# reduce required dependencies
# https://gitlab.freedesktop.org/dbus/dbus-python/-/merge_requests/23
(fetchpatch {
url = "https://gitlab.freedesktop.org/dbus/dbus-python/-/commit/d5e19698a8d6e1485f05b67a5b2daa2392819aaf.patch";
hash = "sha256-Rmj/ByRLiLnIF3JsMBElJugxsG8IARcBdixLhoWgIYU=";
})
];
outputs = [
"out"
"dev"
];
postPatch = ''
# we provide patchelf natively, not through the python package
sed -i '/patchelf/d' pyproject.toml
src = fetchPypi {
inherit pname version;
hash = "sha256-mRZm5Jj2Db8+Sbi3Z49VWbimUDT99hquYs3s232Jx3A=";
};
patchShebangs test/*.sh
'';
patches = [
# reduce required dependencies
# https://gitlab.freedesktop.org/dbus/dbus-python/-/merge_requests/23
(fetchpatch {
url = "https://gitlab.freedesktop.org/dbus/dbus-python/-/commit/d5e19698a8d6e1485f05b67a5b2daa2392819aaf.patch";
hash = "sha256-Rmj/ByRLiLnIF3JsMBElJugxsG8IARcBdixLhoWgIYU=";
})
];
nativeBuildInputs = [
dbus # build systems checks for `dbus-run-session` in PATH
meson
meson-python
pkg-config
];
postPatch = ''
# we provide patchelf natively, not through the python package
sed -i '/patchelf/d' pyproject.toml
buildInputs = [
dbus
dbus-glib
];
patchShebangs test/*.sh
'';
mesonFlags = [
(lib.mesonBool "tests" finalAttrs.finalPackage.doInstallCheck)
];
nativeBuildInputs = [
dbus # build systems checks for `dbus-run-session` in PATH
meson
meson-python
pkg-config
];
# workaround bug in meson-python
# https://github.com/mesonbuild/meson-python/issues/240
postInstall = ''
mkdir -p $dev/lib
mv $out/${python.sitePackages}/.dbus_python.mesonpy.libs/pkgconfig/ $dev/lib
'';
buildInputs = [
dbus
dbus-glib
];
# make sure the Cflags in the pkgconfig file are correct and make the structure backwards compatible
postFixup = ''
ln -s $dev/include/*/dbus_python/dbus-1.0/ $dev/include/dbus-1.0
'';
mesonFlags = [ (lib.mesonBool "tests" finalPackage.doInstallCheck) ];
nativeCheckInputs = [ dbus.out ];
# workaround bug in meson-python
# https://github.com/mesonbuild/meson-python/issues/240
postInstall = ''
mkdir -p $dev/lib
mv $out/${python.sitePackages}/.dbus_python.mesonpy.libs/pkgconfig/ $dev/lib
'';
checkPhase = ''
runHook preCheck
# make sure the Cflags in the pkgconfig file are correct and make the structure backwards compatible
postFixup = ''
ln -s $dev/include/*/dbus_python/dbus-1.0/ $dev/include/dbus-1.0
'';
meson test -C build --no-rebuild --print-errorlogs --timeout-multiplier 0
nativeCheckInputs = [ dbus.out ];
runHook postCheck
'';
checkPhase = ''
runHook preCheck
meson test -C build --no-rebuild --print-errorlogs --timeout-multiplier 0
runHook postCheck
'';
meta = {
description = "Python DBus bindings";
homepage = "https://gitlab.freedesktop.org/dbus/dbus-python";
license = lib.licenses.mit;
platforms = dbus.meta.platforms;
maintainers = [ ];
};
}
)
meta = {
description = "Python DBus bindings";
homepage = "https://gitlab.freedesktop.org/dbus/dbus-python";
license = lib.licenses.mit;
platforms = dbus.meta.platforms;
maintainers = [ ];
};
})