signalbackup-tools: 20241220 -> 20250106 (#371523)
[NixPkgs.git] / pkgs / applications / misc / meerk40t / default.nix
blobd694ecdfd874c75d1de8427aea7a1bb1e4bebce6
2   lib,
3   fetchFromGitHub,
4   meerk40t-camera,
5   python3Packages,
6   gtk3,
7   wrapGAppsHook3,
8 }:
10 python3Packages.buildPythonApplication rec {
11   pname = "MeerK40t";
12   version = "0.9.5300";
13   pyproject = true;
15   src = fetchFromGitHub {
16     owner = "meerk40t";
17     repo = pname;
18     tag = version;
19     hash = "sha256-dybmbmEvvTka0wMBIUDYemqDaCvG9odgCbIWYhROJLI=";
20   };
22   nativeBuildInputs =
23     [
24       wrapGAppsHook3
25     ]
26     ++ (with python3Packages; [
27       setuptools
28     ]);
30   # prevent double wrapping
31   dontWrapGApps = true;
33   # https://github.com/meerk40t/meerk40t/blob/main/setup.py
34   propagatedBuildInputs =
35     with python3Packages;
36     [
37       meerk40t-camera
38       numpy
39       pyserial
40       pyusb
41       setuptools
42       wxpython
43     ]
44     ++ lib.flatten (lib.attrValues optional-dependencies);
46   optional-dependencies = with python3Packages; {
47     cam = [
48       opencv4
49     ];
50     camhead = [
51       opencv4
52     ];
53     dxf = [
54       ezdxf
55     ];
56     gui = [
57       wxpython
58       pillow
59       opencv4
60       ezdxf
61     ];
62   };
64   preFixup = ''
65     gappsWrapperArgs+=(
66       --prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}"
67     )
68     makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
69   '';
71   nativeCheckInputs = with python3Packages; [
72     unittestCheckHook
73   ];
75   preCheck = ''
76     export HOME=$TMPDIR
77   '';
79   meta = with lib; {
80     changelog = "https://github.com/meerk40t/meerk40t/releases/tag/${version}";
81     description = "MeerK40t LaserCutter Software";
82     mainProgram = "meerk40t";
83     homepage = "https://github.com/meerk40t/meerk40t";
84     license = licenses.mit;
85     maintainers = with maintainers; [ hexa ];
86   };