2020-09-25 04:45:31 +00:00
|
|
|
{ pkgs
|
|
|
|
, stdenv
|
2023-04-29 16:46:19 +00:00
|
|
|
, callPackage
|
2020-09-25 04:45:31 +00:00
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
2021-12-06 16:07:01 +00:00
|
|
|
, python3
|
2021-08-25 08:27:29 +00:00
|
|
|
, substituteAll
|
2021-02-05 17:12:51 +00:00
|
|
|
, nix-update-script
|
2023-02-02 18:25:31 +00:00
|
|
|
, nixosTests
|
2020-09-25 04:45:31 +00:00
|
|
|
# To include additional plugins, pass them here as an overlay.
|
2022-02-20 05:27:41 +00:00
|
|
|
, packageOverrides ? self: super: { }
|
2020-05-03 17:38:23 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
let
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
py = python3.override {
|
2020-05-03 17:38:23 +00:00
|
|
|
self = py;
|
2022-02-20 05:27:41 +00:00
|
|
|
packageOverrides = lib.foldr lib.composeExtensions (self: super: { }) (
|
2020-09-25 04:45:31 +00:00
|
|
|
[
|
|
|
|
# Built-in dependency
|
|
|
|
(
|
|
|
|
self: super: {
|
|
|
|
octoprint-filecheck = self.buildPythonPackage rec {
|
|
|
|
pname = "OctoPrint-FileCheck";
|
2021-08-25 08:27:29 +00:00
|
|
|
version = "2021.2.23";
|
2020-05-03 17:38:23 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OctoPrint";
|
|
|
|
repo = "OctoPrint-FileCheck";
|
|
|
|
rev = version;
|
2021-08-25 08:27:29 +00:00
|
|
|
sha256 = "sha256-e/QGEBa9+pjOdrZq3Zc6ifbSMClIyeTOi0Tji0YdVmI=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
doCheck = false;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
)
|
2020-05-03 17:38:23 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
# Built-in dependency
|
|
|
|
(
|
|
|
|
self: super: {
|
|
|
|
octoprint-firmwarecheck = self.buildPythonPackage rec {
|
|
|
|
pname = "OctoPrint-FirmwareCheck";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "2021.10.11";
|
2020-05-03 17:38:23 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OctoPrint";
|
|
|
|
repo = "OctoPrint-FirmwareCheck";
|
|
|
|
rev = version;
|
2022-09-30 11:47:45 +00:00
|
|
|
hash = "sha256-wqbD82bhJDrDawJ+X9kZkoA6eqGxqJc1Z5dA0EUwgEI=";
|
2021-08-25 08:27:29 +00:00
|
|
|
};
|
|
|
|
doCheck = false;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
(
|
|
|
|
self: super: {
|
|
|
|
octoprint-pisupport = self.buildPythonPackage rec {
|
|
|
|
pname = "OctoPrint-PiSupport";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "2023.5.24";
|
2021-08-25 08:27:29 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OctoPrint";
|
|
|
|
repo = "OctoPrint-PiSupport";
|
|
|
|
rev = version;
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-KfkZXJ2f02G2ee+J1w+YQRKz+LSWwxVIIwmdevDGhew=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
2021-08-25 08:27:29 +00:00
|
|
|
|
|
|
|
# requires octoprint itself during tests
|
2020-09-25 04:45:31 +00:00
|
|
|
doCheck = false;
|
2023-02-02 18:25:31 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace octoprint_pi_support/__init__.py \
|
|
|
|
--replace /usr/bin/vcgencmd ${self.pkgs.libraspberrypi}/bin/vcgencmd
|
|
|
|
'';
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
)
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
(
|
|
|
|
self: super: {
|
|
|
|
octoprint = self.buildPythonPackage rec {
|
|
|
|
pname = "OctoPrint";
|
2023-10-19 13:55:26 +00:00
|
|
|
version = "1.9.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OctoPrint";
|
|
|
|
repo = "OctoPrint";
|
|
|
|
rev = version;
|
2023-10-19 13:55:26 +00:00
|
|
|
hash = "sha256-SYN/BrcukHMDwk70XGu/pO45fSPr/KOEyd4wxtz2Fo0=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
propagatedBuildInputs = with self; [
|
2022-09-30 11:47:45 +00:00
|
|
|
argon2-cffi
|
2020-12-09 12:39:15 +00:00
|
|
|
blinker
|
|
|
|
cachelib
|
|
|
|
click
|
2021-12-06 16:07:01 +00:00
|
|
|
colorlog
|
2020-12-09 12:39:15 +00:00
|
|
|
emoji
|
|
|
|
feedparser
|
|
|
|
filetype
|
2020-09-25 04:45:31 +00:00
|
|
|
flask
|
|
|
|
flask-babel
|
2023-10-09 19:29:22 +00:00
|
|
|
flask-assets
|
2022-10-21 18:38:19 +00:00
|
|
|
flask-login
|
2022-09-30 11:47:45 +00:00
|
|
|
flask-limiter
|
2020-12-09 12:39:15 +00:00
|
|
|
frozendict
|
|
|
|
future
|
2020-09-25 04:45:31 +00:00
|
|
|
itsdangerous
|
2021-08-25 08:27:29 +00:00
|
|
|
immutabledict
|
2020-12-09 12:39:15 +00:00
|
|
|
jinja2
|
|
|
|
markdown
|
|
|
|
markupsafe
|
2020-09-25 04:45:31 +00:00
|
|
|
netaddr
|
|
|
|
netifaces
|
2020-12-09 12:39:15 +00:00
|
|
|
octoprint-filecheck
|
|
|
|
octoprint-firmwarecheck
|
2021-08-25 08:27:29 +00:00
|
|
|
octoprint-pisupport
|
2022-09-30 11:47:45 +00:00
|
|
|
passlib
|
2021-12-06 16:07:01 +00:00
|
|
|
pathvalidate
|
2020-09-25 04:45:31 +00:00
|
|
|
pkginfo
|
2021-08-25 08:27:29 +00:00
|
|
|
pip
|
2020-12-09 12:39:15 +00:00
|
|
|
psutil
|
|
|
|
pylru
|
|
|
|
pyserial
|
|
|
|
pyyaml
|
|
|
|
regex
|
2020-09-25 04:45:31 +00:00
|
|
|
requests
|
2020-12-09 12:39:15 +00:00
|
|
|
rsa
|
|
|
|
sarge
|
2020-09-25 04:45:31 +00:00
|
|
|
semantic-version
|
|
|
|
sentry-sdk
|
2021-08-25 08:27:29 +00:00
|
|
|
setuptools
|
2020-12-09 12:39:15 +00:00
|
|
|
tornado
|
2020-09-25 04:45:31 +00:00
|
|
|
unidecode
|
2020-12-09 12:39:15 +00:00
|
|
|
watchdog
|
2021-06-28 23:13:55 +00:00
|
|
|
websocket-client
|
2020-12-09 12:39:15 +00:00
|
|
|
werkzeug
|
|
|
|
wrapt
|
|
|
|
zeroconf
|
2022-04-27 09:35:20 +00:00
|
|
|
zipstream-ng
|
2023-07-15 17:15:38 +00:00
|
|
|
class-doc
|
|
|
|
pydantic
|
2021-12-24 04:21:11 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
py.pkgs.appdirs
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = with self; [
|
2021-12-24 04:21:11 +00:00
|
|
|
ddt
|
|
|
|
mock
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-25 08:27:29 +00:00
|
|
|
patches = [
|
|
|
|
# substitute pip and let it find out, that it can't write anywhere
|
|
|
|
(substituteAll {
|
|
|
|
src = ./pip-path.patch;
|
2023-01-20 10:41:00 +00:00
|
|
|
pip = "${self.pip}/bin/pip";
|
2021-08-25 08:27:29 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
# hardcore path to ffmpeg and hide related settings
|
|
|
|
(substituteAll {
|
|
|
|
src = ./ffmpeg-path.patch;
|
|
|
|
ffmpeg = "${pkgs.ffmpeg}/bin/ffmpeg";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
postPatch =
|
|
|
|
let
|
|
|
|
ignoreVersionConstraints = [
|
|
|
|
"cachelib"
|
|
|
|
"colorlog"
|
|
|
|
"emoji"
|
|
|
|
"immutabledict"
|
|
|
|
"PyYAML"
|
|
|
|
"sarge"
|
|
|
|
"sentry-sdk"
|
|
|
|
"watchdog"
|
|
|
|
"wrapt"
|
|
|
|
"zeroconf"
|
2022-04-27 09:35:20 +00:00
|
|
|
"Flask-Login"
|
|
|
|
"werkzeug"
|
2022-09-14 18:05:37 +00:00
|
|
|
"flask"
|
2023-01-20 10:41:00 +00:00
|
|
|
"Flask-Limiter"
|
2023-07-15 17:15:38 +00:00
|
|
|
"blinker"
|
2022-02-20 05:27:41 +00:00
|
|
|
];
|
|
|
|
in
|
2020-09-25 04:45:31 +00:00
|
|
|
''
|
2022-02-20 05:27:41 +00:00
|
|
|
sed -r -i \
|
|
|
|
${lib.concatStringsSep "\n" (
|
|
|
|
map (
|
|
|
|
e:
|
|
|
|
''-e 's@${e}[<>=]+.*@${e}",@g' \''
|
|
|
|
) ignoreVersionConstraints
|
|
|
|
)}
|
|
|
|
setup.py
|
2020-09-25 04:45:31 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
dontUseSetuptoolsCheck = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
rm pytest.ini
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
disabledTests = [
|
|
|
|
"test_check_setup" # Why should it be able to call pip?
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
"test_set_external_modification"
|
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
passthru = {
|
2023-04-29 16:46:19 +00:00
|
|
|
inherit (self) python;
|
2022-12-28 21:21:41 +00:00
|
|
|
updateScript = nix-update-script { };
|
2023-02-02 18:25:31 +00:00
|
|
|
tests = {
|
2023-04-29 16:46:19 +00:00
|
|
|
plugins = (callPackage ./plugins.nix { }) super self;
|
2023-02-02 18:25:31 +00:00
|
|
|
inherit (nixosTests) octoprint;
|
|
|
|
};
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-09-25 04:45:31 +00:00
|
|
|
homepage = "https://octoprint.org/";
|
|
|
|
description = "The snappy web interface for your 3D printer";
|
2021-12-24 04:21:11 +00:00
|
|
|
license = licenses.agpl3Only;
|
2022-03-30 09:31:56 +00:00
|
|
|
maintainers = with maintainers; [ abbradar gebner WhittlesJr gador ];
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
)
|
2023-04-29 16:46:19 +00:00
|
|
|
(callPackage ./plugins.nix { })
|
2020-09-25 04:45:31 +00:00
|
|
|
packageOverrides
|
|
|
|
]
|
|
|
|
);
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-09-25 04:45:31 +00:00
|
|
|
in
|
2022-02-20 05:27:41 +00:00
|
|
|
with py.pkgs; toPythonApplication octoprint
|