diff options
author | betaboon <betaboon@0x80.ninja> | 2019-04-08 11:31:47 +0200 |
---|---|---|
committer | Gabriel Ebner <gebner@gebner.org> | 2019-06-13 19:14:52 +0200 |
commit | f29609060a1e737021d1adc6baead04d6ae88d61 (patch) | |
tree | 3900d003b254535e5e5881698caebbbb0cac346e /pkgs/applications/misc/cura | |
parent | b6e10d79e96487b412ae8a8db5d1bff1b2b58646 (diff) |
cura: support plugins, add octoprint-plugin
Diffstat (limited to 'pkgs/applications/misc/cura')
-rw-r--r-- | pkgs/applications/misc/cura/default.nix | 8 | ||||
-rw-r--r-- | pkgs/applications/misc/cura/plugins.nix | 34 |
2 files changed, 40 insertions, 2 deletions
diff --git a/pkgs/applications/misc/cura/default.nix b/pkgs/applications/misc/cura/default.nix index 958b0d4844bb8..290801ea57811 100644 --- a/pkgs/applications/misc/cura/default.nix +++ b/pkgs/applications/misc/cura/default.nix @@ -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 = '' diff --git a/pkgs/applications/misc/cura/plugins.nix b/pkgs/applications/misc/cura/plugins.nix new file mode 100644 index 0000000000000..a5a196a781009 --- /dev/null +++ b/pkgs/applications/misc/cura/plugins.nix @@ -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 |