2021-06-28 23:13:55 +00:00
|
|
|
{ lib, python3Packages, fetchFromGitHub, glib, wrapGAppsHook }:
|
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";
|
2023-03-24 00:07:29 +00:00
|
|
|
version = "2.0.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kliment";
|
|
|
|
repo = "Printrun";
|
2023-03-24 00:07:29 +00:00
|
|
|
rev = "printrun-${version}";
|
|
|
|
hash = "sha256-ijJc0CVPiYW5VjTqhY1kO+Fy3dfuPoMn7KRhvcsdAZw=";
|
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
|
|
|
|
'';
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
nativeBuildInputs = [ glib wrapGAppsHook ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
propagatedBuildInputs = with python3Packages; [
|
2023-03-24 00:07:29 +00:00
|
|
|
appdirs cython dbus-python numpy six wxPython_4_2 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;
|
|
|
|
};
|
|
|
|
}
|