cura: support plugins, add octoprint-plugin

This commit is contained in:
betaboon 2019-04-08 11:31:47 +02:00 committed by Gabriel Ebner
parent b6e10d79e9
commit f29609060a
3 changed files with 42 additions and 2 deletions

View file

@ -1,4 +1,4 @@
{ mkDerivation, lib, fetchFromGitHub, cmake, python3, qtbase, qtquickcontrols2, qtgraphicaleffects, curaengine }:
{ mkDerivation, lib, fetchFromGitHub, cmake, python3, qtbase, qtquickcontrols2, qtgraphicaleffects, curaengine, plugins ? [] }:
mkDerivation rec {
name = "cura-${version}";
@ -21,7 +21,7 @@ mkDerivation rec {
buildInputs = [ qtbase qtquickcontrols2 qtgraphicaleffects ];
propagatedBuildInputs = with python3.pkgs; [
libsavitar numpy-stl pyserial requests uranium zeroconf
];
] ++ plugins;
nativeBuildInputs = [ cmake python3.pkgs.wrapPython ];
cmakeFlags = [
@ -37,6 +37,10 @@ mkDerivation rec {
postInstall = ''
mkdir -p $out/share/cura/resources/materials
cp ${materials}/*.fdm_material $out/share/cura/resources/materials/
mkdir -p $out/lib/cura/plugins
for plugin in ${toString plugins}; do
ln -s $plugin/lib/cura/plugins/* $out/lib/cura/plugins
done
'';
postFixup = ''

View file

@ -0,0 +1,34 @@
{ stdenv, fetchFromGitHub, cmake, python3Packages }:
let
self = {
octoprint = stdenv.mkDerivation rec {
pname = "Cura-OctoPrintPlugin";
version = "3.5.5";
src = fetchFromGitHub {
owner = "fieldOfView";
repo = pname;
rev = "d05a9a4c1a01c584d5cec4f4b7d170077235467a";
sha256 = "0ik69g3kbn7rz2wh0cfq9ww8x222kagd8jvsd4xlqgq4yrf0jk7x";
};
nativeBuildInputs = [ cmake ];
propagatedBuildInputs = with python3Packages; [
netifaces
];
meta = with stdenv.lib; {
description = "Enables printing directly to OctoPrint and monitoring the process";
homepage = "https://github.com/fieldOfView/Cura-OctoPrintPlugin";
license = licenses.agpl3;
maintainers = with maintainers; [ gebner ];
};
};
};
in self

View file

@ -20151,6 +20151,8 @@ in
};
cura = qt5.callPackage ../applications/misc/cura { };
curaPlugins = callPackage ../applications/misc/cura/plugins.nix { };
curaLulzbot = callPackage ../applications/misc/cura/lulzbot.nix { };
curaByDagoma = callPackage ../applications/misc/curabydagoma { };