lol
1{
2 lib,
3 fetchFromGitHub,
4 python3Packages,
5 qt6,
6 makeDesktopItem,
7 copyDesktopItems,
8}:
9python3Packages.buildPythonApplication rec {
10 pname = "labelle";
11 version = "1.4.2";
12 pyproject = true;
13
14 src = fetchFromGitHub {
15 owner = "labelle-org";
16 repo = "labelle";
17 tag = "v${version}";
18 hash = "sha256-p+V6ihFDxhG7t4LiwTJVfJTk6rxJxGHqxTdplbLZR2Q=";
19 };
20
21 postPatch = ''
22 substituteInPlace pyproject.toml --replace-fail "hatch-vcs >=0.3.0,<0.4" "hatch-vcs >=0.3.0"
23 substituteInPlace pyproject.toml --replace-fail "Pillow>=8.1.2,<11" "Pillow>=8.1.2"
24 '';
25
26 buildInputs = [ qt6.qtwayland ];
27
28 nativeBuildInputs = [
29 qt6.wrapQtAppsHook
30 python3Packages.hatchling
31 python3Packages.hatch-fancy-pypi-readme
32 python3Packages.hatch-vcs
33 copyDesktopItems
34 ];
35
36 propagatedBuildInputs = with python3Packages; [
37 darkdetect
38 pillow
39 platformdirs
40 pyqrcode
41 pyqt6
42 python-barcode
43 pyusb
44 rich
45 typer
46 ];
47
48 desktopItems = [
49 (makeDesktopItem {
50 name = "labelle GUI";
51 exec = "labelle-gui";
52 desktopName = "labelle GUI";
53 })
54 ];
55
56 meta = {
57 changelog = "https://github.com/labelle-org/labelle/releases/tag/${src.tag}";
58 description = "Print labels with LabelManager PnP from Dymo";
59 homepage = "https://github.com/labelle-org/labelle";
60 license = lib.licenses.asl20;
61 maintainers = with lib.maintainers; [ fabianrig ];
62 mainProgram = "labelle";
63 };
64}