2022-07-18 16:21:45 +00:00
|
|
|
{ lib
|
|
|
|
, python3Packages
|
|
|
|
, fetchFromGitHub
|
2022-12-02 08:20:57 +00:00
|
|
|
, fetchpatch
|
2022-07-18 16:21:45 +00:00
|
|
|
, copyDesktopItems
|
|
|
|
, wrapQtAppsHook
|
|
|
|
, writeText
|
|
|
|
, makeDesktopItem
|
|
|
|
, xvfb-run
|
|
|
|
}:
|
|
|
|
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
pname = "streamdeck-ui";
|
2022-09-30 11:47:45 +00:00
|
|
|
version = "2.0.6";
|
2022-07-18 16:21:45 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = pname;
|
|
|
|
owner = "timothycrosley";
|
|
|
|
rev = "v${version}";
|
2022-09-30 11:47:45 +00:00
|
|
|
sha256 = "sha256-5dk+5oefg5R68kv038gsZ2p5ixmpj/vBLBp/V7Sdos8=";
|
2022-07-18 16:21:45 +00:00
|
|
|
};
|
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "use-poetry-core.patch";
|
|
|
|
url = "https://github.com/timothycrosley/streamdeck-ui/commit/e271656c1f47b1619d1b942e2ebb01ab2d6a68a9.patch";
|
|
|
|
hash = "sha256-wqYwX6eSqMnW6OG7wSprD62Dz818ayFduVrqW9E/ays=";
|
|
|
|
})
|
2023-01-20 10:41:00 +00:00
|
|
|
(fetchpatch {
|
|
|
|
name = "update-python-xlib-0.33.patch";
|
|
|
|
url = "https://github.com/timothycrosley/streamdeck-ui/commit/07d7fdd33085b413dd26b02d8a02820edad2d568.patch";
|
|
|
|
hash = "sha256-PylTrbfB8RJ0+kbgJlRdcvfdahGoob8LabwhuFNsUpY=";
|
|
|
|
})
|
2022-12-02 08:20:57 +00:00
|
|
|
];
|
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
desktopItems = [ (makeDesktopItem {
|
|
|
|
name = "streamdeck-ui";
|
|
|
|
desktopName = "Stream Deck UI";
|
|
|
|
icon = "streamdeck-ui";
|
|
|
|
exec = "streamdeck --no-ui";
|
|
|
|
comment = "UI for the Elgato Stream Deck";
|
|
|
|
categories = [ "Utility" ];
|
|
|
|
noDisplay = true;
|
|
|
|
}) ];
|
|
|
|
|
|
|
|
postInstall =
|
|
|
|
let
|
|
|
|
udevRules = ''
|
2022-09-30 11:47:45 +00:00
|
|
|
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", TAG+="uaccess"
|
2022-07-18 16:21:45 +00:00
|
|
|
'';
|
|
|
|
in
|
|
|
|
''
|
|
|
|
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;
|
|
|
|
makeWrapperArgs = [ "\${qtWrapperArgs[@]}" ];
|
|
|
|
|
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2022-12-02 08:20:57 +00:00
|
|
|
python3Packages.poetry-core
|
2022-07-18 16:21:45 +00:00
|
|
|
copyDesktopItems
|
|
|
|
wrapQtAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
|
|
setuptools
|
|
|
|
filetype
|
|
|
|
cairosvg
|
|
|
|
pillow
|
|
|
|
pynput
|
|
|
|
pyside2
|
|
|
|
streamdeck
|
|
|
|
xlib
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-07-18 16:21:45 +00:00
|
|
|
xvfb-run
|
|
|
|
python3Packages.pytest
|
|
|
|
python3Packages.hypothesis-auto
|
|
|
|
];
|
|
|
|
|
|
|
|
# Ignored tests are not in a running or passing state.
|
|
|
|
# Fixes have been merged upstream but not yet released.
|
|
|
|
# Revisit these ignored tests on each update.
|
|
|
|
checkPhase = ''
|
|
|
|
xvfb-run pytest tests \
|
|
|
|
--ignore=tests/test_api.py \
|
|
|
|
--ignore=tests/test_filter.py \
|
|
|
|
--ignore=tests/test_stream_deck_monitor.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Linux compatible UI for the Elgato Stream Deck";
|
|
|
|
homepage = "https://timothycrosley.github.io/streamdeck-ui/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ majiir ];
|
|
|
|
};
|
|
|
|
}
|