2021-06-17 20:04:12 +00:00
|
|
|
{ lib, python3Packages, fetchFromGitHub, glib, wrapGAppsHook }:
|
2014-03-29 22:03:35 +00:00
|
|
|
|
2020-06-14 01:25:11 +00:00
|
|
|
python3Packages.buildPythonApplication rec {
|
2020-12-30 17:51:10 +00:00
|
|
|
pname = "printrun";
|
2023-03-19 11:59:55 +00:00
|
|
|
version = "2.0.0";
|
2015-10-27 10:23:12 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kliment";
|
|
|
|
repo = "Printrun";
|
2023-03-19 11:59:55 +00:00
|
|
|
rev = "printrun-${version}";
|
|
|
|
hash = "sha256-ijJc0CVPiYW5VjTqhY1kO+Fy3dfuPoMn7KRhvcsdAZw=";
|
2014-03-29 22:03:35 +00:00
|
|
|
};
|
|
|
|
|
2023-03-19 11:59:55 +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-17 20:04:12 +00:00
|
|
|
nativeBuildInputs = [ glib wrapGAppsHook ];
|
|
|
|
|
2020-06-14 01:25:11 +00:00
|
|
|
propagatedBuildInputs = with python3Packages; [
|
2023-03-19 11:59:55 +00:00
|
|
|
appdirs cython dbus-python numpy six wxPython_4_2 psutil pyglet pyopengl pyserial cffi cairosvg lxml
|
2015-10-27 10:23:12 +00:00
|
|
|
];
|
2014-03-29 22:03:35 +00:00
|
|
|
|
2023-03-19 11:59:55 +00:00
|
|
|
# pyglet.canvas.xlib.NoSuchDisplayException: Cannot connect to "None"
|
2014-03-29 22:03:35 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2015-11-20 12:48:30 +00:00
|
|
|
setupPyBuildFlags = ["-i"];
|
|
|
|
|
2014-03-29 22:03:35 +00:00
|
|
|
postInstall = ''
|
|
|
|
for f in $out/share/applications/*.desktop; do
|
|
|
|
sed -i -e "s|/usr/|$out/|g" "$f"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-06-17 20:04:12 +00:00
|
|
|
dontWrapGApps = true;
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2014-03-29 22:03:35 +00:00
|
|
|
description = "Pronterface, Pronsole, and Printcore - Pure Python 3d printing host software";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/kliment/Printrun";
|
2023-03-19 11:59:55 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2014-03-29 22:03:35 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|