klipperscreen: repackage

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