python3Packages.plover: fix plover_build_utils for GUI plugins (#531389)

This commit is contained in:
Yueh-Shun Li
2026-06-15 20:59:46 +00:00
committed by GitHub
4 changed files with 92 additions and 16 deletions
@@ -0,0 +1,52 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
plover,
setuptools,
wheel,
nix-update-script,
}:
buildPythonPackage (finalAttrs: {
pname = "plover-combo";
version = "2.0.0-unstable-2025-09-11";
pyproject = true;
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "opensteno";
repo = "plover_combo";
rev = "82e4b498bd0d7878af4e60fd26453362f41132a8";
hash = "sha256-GCRfoYu/LZDIGs/9RXDCcTEke3PHMifBEuDUrGH/Juc=";
};
build-system = [
plover
setuptools
wheel
];
dependency = [
plover
]
++ plover.optional-dependencies.gui-qt;
pythonImportsCheck = [
"plover_combo"
# Modules providing Plover entry points
"plover_combo.combo_ui"
];
passthru.updateScript = nix-update-script { };
meta = {
description = "Combo Mode for Plover";
homepage = "https://github.com/opensteno/plover_combo";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
ShamrockLee
];
};
})
@@ -56,6 +56,11 @@ buildPythonPackage (finalAttrs: {
wcwidth
xlib
];
optional-dependencies = {
gui-qt = [
pyqt5
];
};
nativeBuildInputs = [
wrapQtAppsHook
];
+33 -16
View File
@@ -36,6 +36,20 @@
pyobjc-core,
}:
let
# Replacement for missing pyside6-essentials tools,
# workaround for https://github.com/NixOS/nixpkgs/issues/277849.
# Ideally this would be solved in pyside6 itself but I spent four
# hours trying to untangle its build system before giving up. If
# anyone wants to spend the time fixing it feel free to request
# me (@Pandapip1) as a reviewer.
pyside-tools-rcc = buildPackages.writeShellScriptBin "pyside6-rcc" ''
exec ${buildPackages.qt6.qtbase}/libexec/rcc -g python "$@"
'';
pyside-tools-uic = buildPackages.writeShellScriptBin "pyside6-uic" ''
exec ${buildPackages.qt6.qtbase}/libexec/uic -g python "$@"
'';
in
buildPythonPackage (finalAttrs: {
__structuredAttrs = true;
@@ -50,32 +64,29 @@ buildPythonPackage (finalAttrs: {
hash = "sha256-1NpZmUDq806geKANqswPYglHwInxum/c/Hxq7JhTpbc=";
};
# pythonRelaxDeps seemingly doesn't work here
postPatch = ''
# pythonRelaxDeps doesn't work for build-system dependencies
sed -i 's/,<77//g' pyproject.toml
sed -i /PySide6-Essentials/d pyproject.toml
substituteInPlace plover_build_utils/setup.py \
--replace-fail "pyside6-rcc" ${lib.getExe pyside-tools-rcc} \
--replace-fail "pyside6-uic" ${lib.getExe pyside-tools-uic}
'';
pythonRelaxDeps = [ "xkbcommon" ];
pythonRelaxDeps = [
"xkbcommon"
];
pythonRemoveDeps = [
# We currently don't have it in Nixpkgs.
"PySide6-Essentials"
];
build-system = [
babel
setuptools
pyside6
wheel
# Replacement for missing pyside6-essentials tools,
# workaround for https://github.com/NixOS/nixpkgs/issues/277849.
# Ideally this would be solved in pyside6 itself but I spent four
# hours trying to untangle its build system before giving up. If
# anyone wants to spend the time fixing it feel free to request
# me (@Pandapip1) as a reviewer.
(buildPackages.writeShellScriptBin "pyside6-uic" ''
exec ${qtbase}/libexec/uic -g python "$@"
'')
(buildPackages.writeShellScriptBin "pyside6-rcc" ''
exec ${qtbase}/libexec/rcc -g python "$@"
'')
];
dependencies = [
appdirs
@@ -104,6 +115,12 @@ buildPythonPackage (finalAttrs: {
pyobjc-framework-Cocoa
pyobjc-framework-Quartz
];
optional-dependencies = {
gui-qt = [
# TODO(@ShamrockLee): use PySide6-Essentials once available
pyside6
];
};
nativeBuildInputs = [
wrapQtAppsHook
];
+2
View File
@@ -12892,6 +12892,8 @@ self: super: with self; {
# https://github.com/opensteno/plover_plugins_registry/blob/master/unsupported.json
plover = plover_5;
plover-combo = callPackage ../development/python-modules/plover-combo { };
plover-dict-commands = callPackage ../development/python-modules/plover-dict-commands { };
plover-lapwing-aio = callPackage ../development/python-modules/plover-lapwing-aio { };