2024-05-15 15:35:15 +00:00
|
|
|
{ lib, python3Packages, fetchFromGitHub, glib, wrapGAppsHook3 }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
python3Packages.buildPythonApplication rec {
|
2021-01-05 17:05:55 +00:00
|
|
|
pname = "printrun";
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "2.0.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kliment";
|
|
|
|
repo = "Printrun";
|
2024-01-25 14:12:00 +00:00
|
|
|
rev = "refs/tags/printrun-${version}";
|
|
|
|
hash = "sha256-GmTA/C45MuptN/Y0KjpFjaLV3sWoM4rHz8AMfV9sf4U=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace requirements.txt \
|
|
|
|
--replace "pyglet >= 1.1, < 2.0" "pyglet" \
|
|
|
|
--replace "cairosvg >= 1.0.9, < 2.6.0" "cairosvg"
|
|
|
|
sed -i -r "s|/usr(/local)?/share/|$out/share/|g" printrun/utils.py
|
|
|
|
'';
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
nativeBuildInputs = [ glib wrapGAppsHook3 ];
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
propagatedBuildInputs = with python3Packages; [
|
2024-01-13 08:15:51 +00:00
|
|
|
appdirs cython dbus-python numpy six wxpython psutil pyglet pyopengl pyserial cffi cairosvg lxml
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
# pyglet.canvas.xlib.NoSuchDisplayException: Cannot connect to "None"
|
2020-04-24 23:36:52 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
setupPyBuildFlags = ["-i"];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
for f in $out/share/applications/*.desktop; do
|
|
|
|
sed -i -e "s|/usr/|$out/|g" "$f"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
dontWrapGApps = true;
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Pronterface, Pronsole, and Printcore - Pure Python 3d printing host software";
|
|
|
|
homepage = "https://github.com/kliment/Printrun";
|
2023-03-24 00:07:29 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|