biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / applications / misc / meerk40t / default.nix
blobc1a0b41a58ac4e9a993db5f14f403528f07a5eb5
1 { lib
2 , fetchFromGitHub
3 , meerk40t-camera
4 , python3Packages
5 , gtk3
6 , wrapGAppsHook
7 }:
9 python3Packages.buildPythonApplication rec {
10   pname = "MeerK40t";
11   version = "0.9.4000";
12   pyproject = true;
14   src = fetchFromGitHub {
15     owner = "meerk40t";
16     repo = pname;
17     rev = "refs/tags/${version}";
18     hash = "sha256-ceDnnHdmJ6VOrM9pSxjeKQ748E8fsIqSQ36qFpXc9Ac=";
19   };
21   nativeBuildInputs = [
22     wrapGAppsHook
23   ] ++ (with python3Packages; [
24     setuptools
25   ]);
27   # prevent double wrapping
28   dontWrapGApps = true;
30   # https://github.com/meerk40t/meerk40t/blob/main/setup.py
31   propagatedBuildInputs = with python3Packages; [
32     meerk40t-camera
33     numpy
34     pyserial
35     pyusb
36     setuptools
37     wxpython
38   ]
39   ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
41   passthru.optional-dependencies = with python3Packages; {
42     cam = [
43       opencv4
44     ];
45     camhead = [
46       opencv4
47     ];
48     dxf = [
49       ezdxf
50     ];
51     gui = [
52       wxpython
53       pillow
54       opencv4
55       ezdxf
56     ];
57   };
59   preFixup = ''
60     gappsWrapperArgs+=(
61       --prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}"
62     )
63     makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
64   '';
66   nativeCheckInputs = with python3Packages; [
67     unittestCheckHook
68   ];
70   preCheck = ''
71     export HOME=$TMPDIR
72   '';
74   meta = with lib; {
75     changelog = "https://github.com/meerk40t/meerk40t/releases/tag/${version}";
76     description = "MeerK40t LaserCutter Software";
77     mainProgram = "meerk40t";
78     homepage = "https://github.com/meerk40t/meerk40t";
79     license = licenses.mit;
80     maintainers = with maintainers; [ hexa ];
81   };