diff options
Diffstat (limited to 'nixpkgs/pkgs/applications/misc/octoprint')
3 files changed, 550 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/misc/octoprint/default.nix b/nixpkgs/pkgs/applications/misc/octoprint/default.nix new file mode 100644 index 000000000000..af42466d0ead --- /dev/null +++ b/nixpkgs/pkgs/applications/misc/octoprint/default.nix @@ -0,0 +1,196 @@ +{ pkgs +, stdenv +, lib +, fetchFromGitHub +, python3 +, nix-update-script + # To include additional plugins, pass them here as an overlay. +, packageOverrides ? self: super: {} +}: +let + mkOverride = attrname: version: sha256: + self: super: { + ${attrname} = super.${attrname}.overridePythonAttrs ( + oldAttrs: { + inherit version; + src = oldAttrs.src.override { + inherit version sha256; + }; + } + ); + }; + + py = python3.override { + self = py; + packageOverrides = lib.foldr lib.composeExtensions (self: super: {}) ( + [ + # the following dependencies are non trivial to update since later versions introduce backwards incompatible + # changes that might affect plugins, or due to other observed problems + (mkOverride "flask-babel" "1.0.0" "0gmb165vkwv5v7dxsxa2i3zhafns0fh938m2zdcrv4d8z5l099yn") + (mkOverride "rsa" "4.0" "1a836406405730121ae9823e19c6e806c62bbad73f890574fff50efa4122c487") + (mkOverride "markdown" "3.1.1" "2e50876bcdd74517e7b71f3e7a76102050edec255b3983403f1a63e7c8a41e7a") + (mkOverride "tornado" "5.1.1" "4e5158d97583502a7e2739951553cbd88a72076f152b4b11b64b9a10c4c49409") + (mkOverride "unidecode" "0.04.21" "280a6ab88e1f2eb5af79edff450021a0d3f0448952847cd79677e55e58bad051") + (mkOverride "sarge" "0.1.5.post0" "1c1ll7pys9vra5cfi8jxlgrgaql6c27l6inpy15aprgqhc4ck36s") + + # Octoprint needs zeroconf >=0.24 <0.25. While this should be done in + # the mkOverride aboves, this package also has broken tests, so we need + # a proper override. + ( + self: super: { + zeroconf = super.zeroconf.overrideAttrs (oldAttrs: rec { + version = "0.24.5"; + src = oldAttrs.src.override { + inherit version; + sha256 = "0jpgd0rk91si93857mjrizan5gc42kj1q4fi4160qgk68la88fl9"; + }; + buildInputs = [ self.nose ]; + checkPhase = "nosetests"; + }); + } + ) + + # Built-in dependency + ( + self: super: { + octoprint-filecheck = self.buildPythonPackage rec { + pname = "OctoPrint-FileCheck"; + version = "2020.08.07"; + + src = fetchFromGitHub { + owner = "OctoPrint"; + repo = "OctoPrint-FileCheck"; + rev = version; + sha256 = "05ys05l5x7d2bkg3yqrga6m65v3g5fcnnzbfab7j9w2pzjdapx5b"; + }; + doCheck = false; + }; + } + ) + + # Built-in dependency + ( + self: super: { + octoprint-firmwarecheck = self.buildPythonPackage rec { + pname = "OctoPrint-FirmwareCheck"; + version = "2020.09.23"; + + src = fetchFromGitHub { + owner = "OctoPrint"; + repo = "OctoPrint-FirmwareCheck"; + rev = version; + sha256 = "1l1ajhnsc39prgk59mp93h90dgl9gh660cci00z5b5gj2h6dv1d1"; + }; + doCheck = false; + }; + } + ) + + ( + self: super: { + octoprint = self.buildPythonPackage rec { + pname = "OctoPrint"; + version = "1.5.3"; + + src = fetchFromGitHub { + owner = "OctoPrint"; + repo = "OctoPrint"; + rev = version; + sha256 = "sha256-ZL/P/YIHynPmP8ssZZUKZDJscBsSsCq3UtOHrTVLpec="; + }; + + propagatedBuildInputs = with super; [ + blinker + cachelib + click + emoji + feedparser + filetype + flask + flask-babel + flask_assets + flask_login + frozendict + future + itsdangerous + jinja2 + markdown + markupsafe + netaddr + netifaces + octoprint-filecheck + octoprint-firmwarecheck + pkginfo + psutil + pylru + pyserial + pyyaml + regex + requests + rsa + sarge + semantic-version + sentry-sdk + tornado + unidecode + watchdog + websocket_client + werkzeug + wrapt + zeroconf + ] ++ lib.optionals stdenv.isDarwin [ py.pkgs.appdirs ]; + + checkInputs = with super; [ pytestCheckHook mock ddt ]; + + postPatch = let + ignoreVersionConstraints = [ + "emoji" + "sentry-sdk" + "watchdog" + ]; + in + '' + sed -r -i \ + ${lib.concatStringsSep "\n" ( + map ( + e: + ''-e 's@${e}[<>=]+.*@${e}",@g' \'' + ) ignoreVersionConstraints + )} + setup.py + ''; + + dontUseSetuptoolsCheck = true; + + preCheck = '' + export HOME=$(mktemp -d) + rm pytest.ini + ''; + + disabledTests = [ + "test_check_setup" # Why should it be able to call pip? + ] ++ lib.optionals stdenv.isDarwin [ + "test_set_external_modification" + ]; + + passthru = { + python = self.python; + updateScript = nix-update-script { attrPath = "octoprint"; }; + }; + + meta = with lib; { + homepage = "https://octoprint.org/"; + description = "The snappy web interface for your 3D printer"; + license = licenses.agpl3; + maintainers = with maintainers; [ abbradar gebner WhittlesJr ]; + }; + }; + } + ) + (import ./plugins.nix { inherit pkgs; }) + packageOverrides + ] + ); + }; +in + with py.pkgs; toPythonApplication octoprint diff --git a/nixpkgs/pkgs/applications/misc/octoprint/plugins.nix b/nixpkgs/pkgs/applications/misc/octoprint/plugins.nix new file mode 100644 index 000000000000..df0409c8be48 --- /dev/null +++ b/nixpkgs/pkgs/applications/misc/octoprint/plugins.nix @@ -0,0 +1,337 @@ +{ pkgs }: + +with pkgs; + +self: super: let + buildPlugin = args: self.buildPythonPackage (args // { + pname = "OctoPrintPlugin-${args.pname}"; + inherit (args) version; + propagatedBuildInputs = (args.propagatedBuildInputs or []) ++ [ super.octoprint ]; + # none of the following have tests + doCheck = false; + }); +in { + inherit buildPlugin; + + abl-expert = buildPlugin rec { + pname = "ABL_Expert"; + version = "0.6"; + + src = fetchgit { + url = "https://framagit.org/razer/Octoprint_ABL_Expert/"; + rev = version; + sha256 = "0ij3rvdwya1sbymwm5swlh2j4jagb6fal945g88zrzh5xf26hzjh"; + }; + + meta = with lib; { + description = "Marlin auto bed leveling control, mesh correction, and z probe handling"; + homepage = "https://framagit.org/razer/Octoprint_ABL_Expert/"; + license = licenses.agpl3; + maintainers = with maintainers; [ WhittlesJr ]; + }; + }; + + bedlevelvisualizer = buildPlugin rec { + pname = "BedLevelVisualizer"; + version = "0.1.15"; + + src = fetchFromGitHub { + owner = "jneilliii"; + repo = "OctoPrint-${pname}"; + rev = version; + sha256 = "1bq39fnarnpk8phxfbpx6l4n9anf358z1cgid5r89nadmn2a0cny"; + }; + + propagatedBuildInputs = with super; [ numpy ]; + + meta = with lib; { + description = "Displays 3D mesh of bed topography report"; + homepage = "https://github.com/jneilliii/OctoPrint-BedLevelVisualizer"; + license = licenses.agpl3; + maintainers = with maintainers; [ lovesegfault ]; + }; + }; + + curaenginelegacy = buildPlugin rec { + pname = "CuraEngineLegacy"; + version = "1.1.1"; + + src = fetchFromGitHub { + owner = "OctoPrint"; + repo = "OctoPrint-${pname}"; + rev = version; + sha256 = "1a7pxlmj1a7blkv97sn1k390pbjcxx2860011pbjcdnli74zpvv5"; + }; + + meta = with lib; { + description = "Plugin for slicing via Cura Legacy from within OctoPrint"; + homepage = "https://github.com/OctoPrint/OctoPrint-CuraEngineLegacy"; + license = licenses.agpl3; + maintainers = with maintainers; [ gebner ]; + }; + }; + + displaylayerprogress = buildPlugin rec { + pname = "OctoPrint-DisplayLayerProgress"; + version = "1.24.0"; + + src = fetchFromGitHub { + owner = "OllisGit"; + repo = pname; + rev = version; + sha256 = "1lbivg3rcjzv8zqvp8n8gcaczxdm7gvd5ihjb6jq0fgf958lv59n"; + }; + + meta = with lib; { + description = "OctoPrint-Plugin that sends the current progress of a print via M117 command"; + homepage = "https://github.com/OllisGit/OctoPrint-DisplayLayerProgress"; + license = licenses.agpl3; + maintainers = with maintainers; [ j0hax ]; + }; + }; + + gcodeeditor = buildPlugin rec { + pname = "GcodeEditor"; + version = "0.2.9"; + + src = fetchFromGitHub { + owner = "ieatacid"; + repo = "OctoPrint-${pname}"; + rev = version; + sha256 = "1yjj9lmxbzmzrn7gahw9lj7554fphalbjjp8ns0rr9py3rshwxkm"; + }; + + meta = with lib; { + description = "Edit gcode on OctoPrint"; + homepage = "https://github.com/ieatacid/OctoPrint-GcodeEditor"; + license = licenses.agpl3; + maintainers = with maintainers; [ WhittlesJr ]; + }; + }; + + marlingcodedocumentation = buildPlugin rec { + pname = "MarlinGcodeDocumentation"; + version = "0.11.0"; + + src = fetchFromGitHub { + owner = "costas-basdekis"; + repo = pname; + rev = "v${version}"; + sha256 = "0vx06w9hqwy0k4r8g67y8gdckfdx7wl8ghfx6hmxc1s8fgkghfkc"; + }; + + meta = with lib; { + description = "Displays GCode documentation for Marlin in the Octoprint terminal command line"; + homepage = "https://github.com/costas-basdekis/MarlinGcodeDocumentation"; + license = licenses.agpl3; + maintainers = with maintainers; [ lovesegfault ]; + }; + }; + + mqtt = buildPlugin rec { + pname = "MQTT"; + version = "0.8.7"; + + src = fetchFromGitHub { + owner = "OctoPrint"; + repo = "OctoPrint-MQTT"; + rev = version; + sha256 = "0k82h7wafbcqdvk5wjw4dp9lydwszfj1lf8vvymwbqdn7pf5h0dy"; + }; + + propagatedBuildInputs = with super; [ paho-mqtt ]; + + meta = with lib; { + description = "Publish printer status MQTT"; + homepage = "https://github.com/OctoPrint/OctoPrint-MQTT"; + license = licenses.agpl3; + maintainers = with maintainers; [ peterhoeg ]; + }; + }; + + printtimegenius = buildPlugin rec { + pname = "PrintTimeGenius"; + version = "2.2.6"; + + src = fetchFromGitHub { + owner = "eyal0"; + repo = "OctoPrint-${pname}"; + rev = version; + sha256 = "04zfgd3x3lbriyzwhpqnwdcfdm19fsqgsb7l2ix5d0ssmqxwg2r6"; + }; + + preConfigure = '' + # PrintTimeGenius ships with marlin-calc binaries for multiple architectures + rm */analyzers/marlin-calc* + sed 's@"{}.{}".format(binary_base_name, machine)@"${pkgs.marlin-calc}/bin/marlin-calc"@' -i */analyzers/analyze_progress.py + ''; + + patches = [ + ./printtimegenius-logging.patch + ]; + + meta = with lib; { + description = "Better print time estimation for OctoPrint"; + homepage = "https://github.com/eyal0/OctoPrint-PrintTimeGenius"; + license = licenses.agpl3; + maintainers = with maintainers; [ gebner ]; + }; + }; + + psucontrol = buildPlugin rec { + pname = "PSUControl"; + version = "0.1.9"; + + src = fetchFromGitHub { + owner = "kantlivelong"; + repo = "OctoPrint-${pname}"; + rev = version; + sha256 = "1cn009bdgn6c9ba9an5wfj8z02wi0xcsmbhkqggiqlnqy1fq45ca"; + }; + + preConfigure = '' + # optional; RPi.GPIO is broken on vanilla kernels + sed /RPi.GPIO/d -i requirements.txt + ''; + + meta = with lib; { + description = "OctoPrint plugin to control ATX/AUX power supply"; + homepage = "https://github.com/kantlivelong/OctoPrint-PSUControl"; + license = licenses.agpl3; + maintainers = with maintainers; [ gebner ]; + }; + }; + + simpleemergencystop = buildPlugin rec { + pname = "SimpleEmergencyStop"; + version = "1.0.3"; + + src = fetchFromGitHub { + owner = "Sebclem"; + repo = "OctoPrint-${pname}"; + rev = version; + sha256 = "0hhh5grmn32abkix1b9fr1d0pcpdi2r066iypcxdxcza9qzwjiyi"; + }; + + meta = with lib; { + description = "A simple plugin that add an emergency stop buton on NavBar of OctoPrint"; + homepage = "https://github.com/Sebclem/OctoPrint-SimpleEmergencyStop"; + license = licenses.agpl3; + maintainers = with maintainers; [ WhittlesJr ]; + }; + }; + + stlviewer = buildPlugin rec { + pname = "STLViewer"; + version = "0.4.2"; + + src = fetchFromGitHub { + owner = "jneilliii"; + repo = "OctoPrint-STLViewer"; + rev = version; + sha256 = "0mkvh44fn2ch4z2avsdjwi1rp353ylmk9j5fln4x7rx8ph8y7g2b"; + }; + + meta = with lib; { + description = "A simple stl viewer tab for OctoPrint"; + homepage = "https://github.com/jneilliii/Octoprint-STLViewer"; + license = licenses.agpl3; + maintainers = with maintainers; [ abbradar ]; + }; + }; + + themeify = buildPlugin rec { + pname = "Themeify"; + version = "1.2.2"; + + src = fetchFromGitHub { + owner = "Birkbjo"; + repo = "Octoprint-${pname}"; + rev = "v${version}"; + sha256 = "0j1qs6kyh947npdy7pqda25fjkqinpas3sy0qyscqlxi558lhvx2"; + }; + + meta = with lib; { + description = "Beautiful themes for OctoPrint"; + homepage = "https://github.com/birkbjo/OctoPrint-Themeify"; + license = licenses.agpl3; + maintainers = with maintainers; [ lovesegfault ]; + }; + }; + + titlestatus = buildPlugin rec { + pname = "TitleStatus"; + version = "0.0.5"; + + src = fetchFromGitHub { + owner = "MoonshineSG"; + repo = "OctoPrint-TitleStatus"; + rev = version; + sha256 = "10nxjrixg0i6n6x8ghc1ndshm25c97bvkcis5j9kmlkkzs36i2c6"; + }; + + meta = with lib; { + description = "Show printers status in window title"; + homepage = "https://github.com/MoonshineSG/OctoPrint-TitleStatus"; + license = licenses.agpl3; + maintainers = with maintainers; [ abbradar ]; + }; + }; + + touchui = buildPlugin rec { + pname = "TouchUI"; + version = "0.3.16"; + + src = fetchFromGitHub { + owner = "BillyBlaze"; + repo = "OctoPrint-${pname}"; + rev = version; + sha256 = "1jlqjirc4ygl4k7jp93l2h6b18jap3mzz8sf2g61j9w0kgv9l365"; + }; + + meta = with lib; { + description = "Touch friendly interface for a small TFT module or phone for OctoPrint"; + homepage = "https://github.com/BillyBlaze/OctoPrint-TouchUI"; + license = licenses.agpl3; + maintainers = with maintainers; [ gebner ]; + }; + }; + + octoklipper = buildPlugin rec { + pname = "OctoKlipper"; + version = "0.3.2"; + + src = fetchFromGitHub { + owner = "AliceGrey"; + repo = "OctoprintKlipperPlugin"; + rev = version; + sha256 = "15yg2blbgqp2gdpsqqm8qiiznq5qaq8wss07jimkl0865vrvlz7l"; + }; + + meta = with lib; { + description = "A plugin for a better integration of Klipper into OctoPrint"; + homepage = "https://github.com/AliceGrey/OctoprintKlipperPlugin"; + license = licenses.agpl3; + maintainers = with maintainers; [ lovesegfault ]; + }; + }; + + octoprint-dashboard = buildPlugin rec { + pname = "OctoPrint-Dashboard"; + version = "1.15.2"; + + src = fetchFromGitHub { + owner = "StefanCohen"; + repo = pname; + rev = version; + sha256 = "0p94jwd7kagh3sixhcrqmsgbay4aaf9l1pgyi2b45jym8pvld5n4"; + }; + + meta = with lib; { + description = "A dashboard for Octoprint"; + homepage = "https://github.com/StefanCohen/OctoPrint-Dashboard"; + license = licenses.agpl3; + maintainers = with maintainers; [ j0hax ]; + }; + }; +} diff --git a/nixpkgs/pkgs/applications/misc/octoprint/printtimegenius-logging.patch b/nixpkgs/pkgs/applications/misc/octoprint/printtimegenius-logging.patch new file mode 100644 index 000000000000..66c2e83d62ca --- /dev/null +++ b/nixpkgs/pkgs/applications/misc/octoprint/printtimegenius-logging.patch @@ -0,0 +1,17 @@ +diff --git a/setup.py b/setup.py +index 6a6610e..cc45902 100644 +--- a/setup.py ++++ b/setup.py +@@ -35,9 +35,9 @@ plugin_license = "AGPLv3" + # Any additional requirements besides OctoPrint should be listed here + # For now, require the working release, which is only 1.3.9rc1. + plugin_requires = ["OctoPrint>=1.3.9rc1", "psutil", "sarge"] +-from sys import version_info +-if version_info[0] < 3: +- plugin_requires.append("logging") ++#from sys import version_info ++#if version_info[0] < 3: ++# plugin_requires.append("logging") + + ### -------------------------------------------------------------------------------------------------------------------- + ### More advanced options that you usually shouldn't have to touch follow after this point |