From f29609060a1e737021d1adc6baead04d6ae88d61 Mon Sep 17 00:00:00 2001 From: betaboon Date: Mon, 8 Apr 2019 11:31:47 +0200 Subject: [PATCH] cura: support plugins, add octoprint-plugin --- pkgs/applications/misc/cura/default.nix | 8 ++++-- pkgs/applications/misc/cura/plugins.nix | 34 +++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 pkgs/applications/misc/cura/plugins.nix diff --git a/pkgs/applications/misc/cura/default.nix b/pkgs/applications/misc/cura/default.nix index 958b0d4844bb..290801ea5781 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 000000000000..a5a196a78100 --- /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 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7c61d49eb74b..421ae6a90a91 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 { };