streamdeck-ui: Fix order of attributes

This commit is contained in:
Ulrik Strid 2024-06-12 22:55:40 +02:00
parent 5881753f62
commit 4541511023

View file

@ -1,15 +1,16 @@
{
lib,
python3Packages,
copyDesktopItems,
fetchFromGitHub,
fetchPypi,
copyDesktopItems,
writeText,
lib,
makeDesktopItem,
wrapGAppsHook3,
xvfb-run,
python3Packages,
qt6,
wrapGAppsHook3,
writeText,
xvfb-run,
}:
let
# There are breaking changes between 6 and 7
importlib-metadata_6 = python3Packages.importlib-metadata.overrideAttrs (_: rec {
@ -21,6 +22,7 @@ let
};
});
in
python3Packages.buildPythonApplication rec {
pname = "streamdeck-ui";
version = "4.1.2";
@ -32,56 +34,10 @@ python3Packages.buildPythonApplication rec {
hash = "sha256-CSsFPGnKVQUCND6YOA9kfO41KS85C57YL9LcrWlQRKo=";
};
desktopItems =
let
common = {
name = "streamdeck-ui";
desktopName = "Stream Deck UI";
icon = "streamdeck-ui";
exec = "streamdeck";
comment = "UI for the Elgato Stream Deck";
categories = [ "Utility" ];
};
in
builtins.map makeDesktopItem [
common
(
common
// {
name = "${common.name}-noui";
exec = "${common.exec} --no-ui";
noDisplay = true;
}
)
];
postInstall =
let
udevRules = ''
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", TAG+="uaccess"
'';
in
''
mkdir -p $out/lib/systemd/user
substitute scripts/streamdeck.service $out/lib/systemd/user/streamdeck.service \
--replace '<path to streamdeck>' $out/bin/streamdeck
mkdir -p "$out/etc/udev/rules.d"
cp ${writeText "70-streamdeck.rules" udevRules} $out/etc/udev/rules.d/70-streamdeck.rules
mkdir -p "$out/share/pixmaps"
cp streamdeck_ui/logo.png $out/share/pixmaps/streamdeck-ui.png
'';
dontWrapQtApps = true;
dontWrapGApps = true;
makeWrapperArgs = [
"\${qtWrapperArgs[@]}"
"\${gappsWrapperArgs[@]}"
];
format = "pyproject";
pythonRelaxDeps = [ "pillow" ];
nativeBuildInputs = [
python3Packages.poetry-core
python3Packages.pythonRelaxDepsHook
@ -90,8 +46,6 @@ python3Packages.buildPythonApplication rec {
wrapGAppsHook3
];
pythonRelaxDeps = [ "pillow" ];
propagatedBuildInputs =
with python3Packages;
[
@ -117,11 +71,63 @@ python3Packages.buildPythonApplication rec {
]);
checkPhase = ''
runHook preCheck
# The tests needs to find the log file
export STREAMDECK_UI_LOG_FILE=$(pwd)/.streamdeck_ui.log
xvfb-run pytest tests
runHook preCheck
'';
postInstall =
let
udevRules = ''
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", TAG+="uaccess"
'';
in
''
mkdir -p $out/lib/systemd/user
substitute scripts/streamdeck.service $out/lib/systemd/user/streamdeck.service \
--replace '<path to streamdeck>' $out/bin/streamdeck
mkdir -p "$out/etc/udev/rules.d"
cp ${writeText "70-streamdeck.rules" udevRules} $out/etc/udev/rules.d/70-streamdeck.rules
mkdir -p "$out/share/pixmaps"
cp streamdeck_ui/logo.png $out/share/pixmaps/streamdeck-ui.png
'';
desktopItems =
let
common = {
name = "streamdeck-ui";
desktopName = "Stream Deck UI";
icon = "streamdeck-ui";
exec = "streamdeck";
comment = "UI for the Elgato Stream Deck";
categories = [ "Utility" ];
};
in
builtins.map makeDesktopItem [
common
(
common
// {
name = "${common.name}-noui";
exec = "${common.exec} --no-ui";
noDisplay = true;
}
)
];
dontWrapQtApps = true;
dontWrapGApps = true;
makeWrapperArgs = [
"\${qtWrapperArgs[@]}"
"\${gappsWrapperArgs[@]}"
];
meta = {
description = "Linux compatible UI for the Elgato Stream Deck";
downloadPage = "https://github.com/streamdeck-linux-gui/streamdeck-linux-gui/";