2020-09-25 04:45:31 +00:00
|
|
|
{ pkgs
|
|
|
|
, stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, python3
|
2021-02-05 17:12:51 +00:00
|
|
|
, nix-update-script
|
2020-09-25 04:45:31 +00:00
|
|
|
# To include additional plugins, pass them here as an overlay.
|
2020-05-03 17:38:23 +00:00
|
|
|
, packageOverrides ? self: super: {}
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
let
|
|
|
|
mkOverride = attrname: version: sha256:
|
2020-09-25 04:45:31 +00:00
|
|
|
self: super: {
|
|
|
|
${attrname} = super.${attrname}.overridePythonAttrs (
|
|
|
|
oldAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit version;
|
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version sha256;
|
|
|
|
};
|
2020-09-25 04:45:31 +00:00
|
|
|
}
|
|
|
|
);
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-05-03 17:38:23 +00:00
|
|
|
py = python3.override {
|
|
|
|
self = py;
|
2020-09-25 04:45:31 +00:00
|
|
|
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
|
2020-12-09 12:39:15 +00:00
|
|
|
(mkOverride "flask-babel" "1.0.0" "0gmb165vkwv5v7dxsxa2i3zhafns0fh938m2zdcrv4d8z5l099yn")
|
2020-09-25 04:45:31 +00:00
|
|
|
(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")
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-12-09 12:39:15 +00:00
|
|
|
# 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";
|
|
|
|
});
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
# Built-in dependency
|
|
|
|
(
|
|
|
|
self: super: {
|
|
|
|
octoprint-filecheck = self.buildPythonPackage rec {
|
|
|
|
pname = "OctoPrint-FileCheck";
|
|
|
|
version = "2020.08.07";
|
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;
|
|
|
|
sha256 = "05ys05l5x7d2bkg3yqrga6m65v3g5fcnnzbfab7j9w2pzjdapx5b";
|
|
|
|
};
|
|
|
|
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";
|
2020-12-09 12:39:15 +00:00
|
|
|
version = "2020.09.23";
|
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;
|
2020-12-09 12:39:15 +00:00
|
|
|
sha256 = "1l1ajhnsc39prgk59mp93h90dgl9gh660cci00z5b5gj2h6dv1d1";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
doCheck = false;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
)
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
(
|
|
|
|
self: super: {
|
|
|
|
octoprint = self.buildPythonPackage rec {
|
|
|
|
pname = "OctoPrint";
|
2021-02-05 17:12:51 +00:00
|
|
|
version = "1.5.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;
|
2021-02-05 17:12:51 +00:00
|
|
|
sha256 = "sha256-ZL/P/YIHynPmP8ssZZUKZDJscBsSsCq3UtOHrTVLpec=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
propagatedBuildInputs = with super; [
|
2020-12-09 12:39:15 +00:00
|
|
|
blinker
|
|
|
|
cachelib
|
|
|
|
click
|
|
|
|
emoji
|
|
|
|
feedparser
|
|
|
|
filetype
|
2020-09-25 04:45:31 +00:00
|
|
|
flask
|
|
|
|
flask-babel
|
|
|
|
flask_assets
|
2020-12-09 12:39:15 +00:00
|
|
|
flask_login
|
|
|
|
frozendict
|
|
|
|
future
|
2020-09-25 04:45:31 +00:00
|
|
|
itsdangerous
|
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
|
2020-09-25 04:45:31 +00:00
|
|
|
pkginfo
|
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
|
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
|
|
|
|
websocket_client
|
|
|
|
werkzeug
|
|
|
|
wrapt
|
|
|
|
zeroconf
|
2020-09-25 04:45:31 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [ py.pkgs.appdirs ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
checkInputs = with super; [ pytestCheckHook mock ddt ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
postPatch = let
|
|
|
|
ignoreVersionConstraints = [
|
2021-02-05 17:12:51 +00:00
|
|
|
"emoji"
|
2020-09-25 04:45:31 +00:00
|
|
|
"sentry-sdk"
|
2021-02-05 17:12:51 +00:00
|
|
|
"watchdog"
|
2020-09-25 04:45:31 +00:00
|
|
|
];
|
|
|
|
in
|
|
|
|
''
|
|
|
|
sed -r -i \
|
|
|
|
${lib.concatStringsSep "\n" (
|
|
|
|
map (
|
|
|
|
e:
|
|
|
|
''-e 's@${e}[<>=]+.*@${e}",@g' \''
|
|
|
|
) ignoreVersionConstraints
|
|
|
|
)}
|
|
|
|
setup.py
|
|
|
|
'';
|
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 = {
|
|
|
|
python = self.python;
|
|
|
|
updateScript = nix-update-script { attrPath = "octoprint"; };
|
|
|
|
};
|
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";
|
|
|
|
license = licenses.agpl3;
|
|
|
|
maintainers = with maintainers; [ abbradar gebner WhittlesJr ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
)
|
|
|
|
(import ./plugins.nix { inherit pkgs; })
|
|
|
|
packageOverrides
|
|
|
|
]
|
|
|
|
);
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-09-25 04:45:31 +00:00
|
|
|
in
|
|
|
|
with py.pkgs; toPythonApplication octoprint
|