tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
klipperscreen: repackage
Vladimir Serov
2 years ago
1ebfd5f8
d4825e5e
+36
-43
3 changed files
expand all
collapse all
unified
split
pkgs
applications
misc
klipperscreen
default.nix
fix-paths.diff
setup.py
+36
-10
pkgs/applications/misc/klipperscreen/default.nix
···
1
1
-
{ lib, stdenv, writeText, python3Packages, fetchFromGitHub, gtk3, gobject-introspection, gdk-pixbuf, wrapGAppsHook, librsvg }:
2
2
-
python3Packages.buildPythonPackage rec {
1
1
+
{ lib
2
2
+
, python3
3
3
+
, fetchFromGitHub
4
4
+
, wrapGAppsHook
5
5
+
, gobject-introspection
6
6
+
, gitUpdater
7
7
+
}: python3.pkgs.buildPythonApplication rec {
3
8
pname = "KlipperScreen";
4
9
version = "0.3.2";
10
10
+
format = "other";
5
11
6
12
src = fetchFromGitHub {
7
13
owner = "jordanruthe";
8
8
-
repo = pname;
14
14
+
repo = "KlipperScreen";
9
15
rev = "v${version}";
10
16
hash = "sha256-LweO5EVWr3OxziHrjtQDdWyUBCVUJ17afkw7RCZWgcg=";
11
17
};
12
12
-
patches = [ ./fix-paths.diff ];
13
18
14
14
-
buildInputs = [ gtk3 librsvg ];
15
15
-
nativeBuildInputs = [ wrapGAppsHook gdk-pixbuf gobject-introspection ];
19
19
+
nativeBuildInputs = [
20
20
+
gobject-introspection
21
21
+
wrapGAppsHook
22
22
+
];
16
23
17
17
-
propagatedBuildInputs = with python3Packages; [ jinja2 netifaces requests websocket-client pycairo pygobject3 mpv six dbus-python numpy pycairo ];
24
24
+
pythonPath = with python3.pkgs; [
25
25
+
jinja2
26
26
+
netifaces
27
27
+
requests
28
28
+
websocket-client
29
29
+
pycairo
30
30
+
pygobject3
31
31
+
mpv
32
32
+
six
33
33
+
dbus-python
34
34
+
];
18
35
19
19
-
preBuild = ''
20
20
-
ln -s ${./setup.py} setup.py
36
36
+
dontWrapGApps = true;
37
37
+
38
38
+
preFixup = ''
39
39
+
mkdir -p $out/bin
40
40
+
cp -r . $out/dist
41
41
+
gappsWrapperArgs+=(--set PYTHONPATH "$PYTHONPATH")
42
42
+
wrapGApp $out/dist/screen.py
43
43
+
ln -s $out/dist/screen.py $out/bin/KlipperScreen
21
44
'';
22
45
46
46
+
passthru.updateScript = gitUpdater { url = meta.homepage; };
47
47
+
23
48
meta = with lib; {
24
49
description = "Touchscreen GUI for the Klipper 3D printer firmware";
25
25
-
homepage = "https://github.com/jordanruthe/${pname}";
50
50
+
homepage = "https://github.com/jordanruthe/KlipperScreen";
26
51
license = licenses.agpl3;
52
52
+
maintainers = with maintainers; [ cab404 ];
27
53
};
28
54
}
-22
pkgs/applications/misc/klipperscreen/fix-paths.diff
···
1
1
-
diff --git a/screen.py b/screen.py
2
2
-
index 4fd75cd..a10779a 100755
3
3
-
--- a/screen.py
4
4
-
+++ b/screen.py
5
5
-
@@ -48,7 +48,7 @@ PRINTER_BASE_STATUS_OBJECTS = [
6
6
-
'exclude_object',
7
7
-
]
8
8
-
9
9
-
-klipperscreendir = pathlib.Path(__file__).parent.resolve()
10
10
-
+klipperscreendir = pathlib.Path(functions.__file__).parent.parent.resolve()
11
11
-
12
12
-
13
13
-
def set_text_direction(lang=None):
14
14
-
@@ -254,7 +254,7 @@ class KlipperScreen(Gtk.Window):
15
15
-
def _load_panel(self, panel, *args):
16
16
-
if panel not in self.load_panel:
17
17
-
logging.debug(f"Loading panel: {panel}")
18
18
-
- panel_path = os.path.join(os.path.dirname(__file__), 'panels', f"{panel}.py")
19
19
-
+ panel_path = os.path.join(klipperscreendir, 'panels', f"{panel}.py")
20
20
-
logging.info(f"Panel path: {panel_path}")
21
21
-
if not os.path.exists(panel_path):
22
22
-
logging.error(f"Panel {panel} does not exist")
-11
pkgs/applications/misc/klipperscreen/setup.py
···
1
1
-
from setuptools import setup
2
2
-
3
3
-
setup(
4
4
-
name='KlipperScreen',
5
5
-
install_requires=[],
6
6
-
packages=['styles', 'panels', 'ks_includes', 'ks_includes.widgets'],
7
7
-
package_data={'ks_includes': ['defaults.conf', 'locales/**', 'emptyCursor.xbm'], 'styles': ['**']},
8
8
-
entry_points={
9
9
-
'console_scripts': ['KlipperScreen=screen:main']
10
10
-
},
11
11
-
)