about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc/klipperscreen/default.nix
blob: 789ab7c6882870f704732cae66e53b7a2cb0720a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{ lib
, python3
, fetchFromGitHub
, wrapGAppsHook
, gobject-introspection
, gitUpdater
}: python3.pkgs.buildPythonApplication rec {
  pname = "KlipperScreen";
  version = "0.3.2";
  format = "other";

  src = fetchFromGitHub {
    owner = "jordanruthe";
    repo = "KlipperScreen";
    rev = "v${version}";
    hash = "sha256-LweO5EVWr3OxziHrjtQDdWyUBCVUJ17afkw7RCZWgcg=";
  };

  nativeBuildInputs = [
    gobject-introspection
    wrapGAppsHook
  ];

  pythonPath = with python3.pkgs; [
    jinja2
    netifaces
    requests
    websocket-client
    pycairo
    pygobject3
    mpv
    six
    dbus-python
  ];

  dontWrapGApps = true;

  preFixup = ''
    mkdir -p $out/bin
    cp -r . $out/dist
    gappsWrapperArgs+=(--set PYTHONPATH "$PYTHONPATH")
    wrapGApp $out/dist/screen.py
    ln -s $out/dist/screen.py $out/bin/KlipperScreen
  '';

  passthru.updateScript = gitUpdater { url = meta.homepage; };

  meta = with lib; {
    description = "Touchscreen GUI for the Klipper 3D printer firmware";
    homepage = "https://github.com/jordanruthe/KlipperScreen";
    license = licenses.agpl3Only;
    maintainers = with maintainers; [ cab404 ];
    mainProgram = "KlipperScreen";
  };
}