2020-08-25 23:29:31 +02:00
|
|
|
{ pkgs
|
|
|
|
, stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
2021-11-02 21:33:17 +01:00
|
|
|
, python3
|
2021-08-09 17:13:12 +02:00
|
|
|
, substituteAll
|
2021-02-01 03:43:52 +01:00
|
|
|
, nix-update-script
|
2020-08-25 23:29:31 +02:00
|
|
|
# To include additional plugins, pass them here as an overlay.
|
2020-03-14 11:02:07 +01:00
|
|
|
, packageOverrides ? self: super: {}
|
|
|
|
}:
|
2016-10-06 10:05:54 +02:00
|
|
|
let
|
2018-12-06 05:43:36 +01:00
|
|
|
mkOverride = attrname: version: sha256:
|
2020-08-25 23:29:31 +02:00
|
|
|
self: super: {
|
|
|
|
${attrname} = super.${attrname}.overridePythonAttrs (
|
|
|
|
oldAttrs: {
|
2018-12-06 05:43:36 +01:00
|
|
|
inherit version;
|
2018-08-30 22:14:06 +02:00
|
|
|
src = oldAttrs.src.override {
|
2018-12-06 05:43:36 +01:00
|
|
|
inherit version sha256;
|
2018-08-30 22:14:06 +02:00
|
|
|
};
|
2020-08-25 23:29:31 +02:00
|
|
|
}
|
|
|
|
);
|
|
|
|
};
|
2018-12-06 05:43:36 +01:00
|
|
|
|
2021-11-02 21:33:17 +01:00
|
|
|
py = python3.override {
|
2020-03-14 11:02:07 +01:00
|
|
|
self = py;
|
2020-08-25 23:29:31 +02: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
|
2021-08-09 17:13:12 +02:00
|
|
|
(mkOverride "click" "7.1.2" "d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a")
|
2020-12-07 14:14:38 +01:00
|
|
|
(mkOverride "flask-babel" "1.0.0" "0gmb165vkwv5v7dxsxa2i3zhafns0fh938m2zdcrv4d8z5l099yn")
|
2021-08-09 17:13:12 +02:00
|
|
|
(mkOverride "itsdangerous" "1.1.0" "321b033d07f2a4136d3ec762eac9f16a10ccd60f53c0c91af90217ace7ba1f19")
|
|
|
|
(mkOverride "jinja2" "2.11.3" "a6d58433de0ae800347cab1fa3043cebbabe8baa9d29e668f1c768cb87a333c6")
|
2020-08-25 23:29:31 +02:00
|
|
|
(mkOverride "markdown" "3.1.1" "2e50876bcdd74517e7b71f3e7a76102050edec255b3983403f1a63e7c8a41e7a")
|
2021-08-09 17:13:12 +02:00
|
|
|
(mkOverride "markupsafe" "1.1.1" "29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b")
|
|
|
|
|
|
|
|
# Requires flask<2, cannot mkOverride because tests need to be disabled
|
|
|
|
(
|
|
|
|
self: super: {
|
|
|
|
flask = super.flask.overridePythonAttrs (oldAttrs: rec {
|
2021-11-02 21:33:17 +01:00
|
|
|
version = "1.1.4";
|
2021-08-09 17:13:12 +02:00
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
2021-11-02 21:33:17 +01:00
|
|
|
sha256 = "15ni4xlm57a15f5hipp8w0c9zba20179bvfns2392fiq1lcbdghg";
|
2021-08-09 17:13:12 +02:00
|
|
|
};
|
|
|
|
doCheck = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
# Requires werkezug<2, cannot mkOverride because tests need to be disabled
|
|
|
|
(
|
|
|
|
self: super: {
|
|
|
|
werkzeug = super.werkzeug.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "1.0.1";
|
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
|
|
|
sha256 = "6c80b1e5ad3665290ea39320b91e1be1e0d5f60652b964a3070216de83d2e47c";
|
|
|
|
};
|
|
|
|
doCheck= false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2021-09-14 12:44:18 +02:00
|
|
|
# Requires unidecode>=0.04.14,<0.05. Upstream changed the source naming between releases
|
|
|
|
(
|
|
|
|
self: super: {
|
|
|
|
unidecode = super.unidecode.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "0.04.21";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "avian2";
|
|
|
|
repo = "unidecode";
|
|
|
|
rev = "release-${version}";
|
|
|
|
sha256 = "0p5bkibv0xm1265dlfrz3zq3k9bbx07gl8zyq8mvvb8hi7p5lifg";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|
|
|
|
)
|
2019-04-02 09:07:47 +02:00
|
|
|
|
2021-06-16 18:24:26 +02:00
|
|
|
# Requires websocket-client <1.0, >=0.57. Cannot do mkOverride b/c differing underscore/hyphen in pypi source name
|
|
|
|
(
|
|
|
|
self: super: {
|
|
|
|
websocket-client = super.websocket-client.overridePythonAttrs (
|
|
|
|
oldAttrs: rec {
|
2021-11-02 21:33:17 +01:00
|
|
|
version = "0.59.0";
|
2021-06-16 18:24:26 +02:00
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
2021-11-02 21:33:17 +01:00
|
|
|
sha256 = "0p0cz2mdissq7iw1n7jrmsfir0jfmgs1dvnpnrx477ffx9hbsxnk";
|
2021-06-16 18:24:26 +02:00
|
|
|
};
|
2021-11-02 21:33:17 +01:00
|
|
|
propagatedBuildInputs = with self; [
|
|
|
|
six
|
|
|
|
pysocks
|
|
|
|
];
|
|
|
|
disabledTests = [
|
|
|
|
"testConnect" # requires network access
|
|
|
|
];
|
2021-06-16 18:24:26 +02:00
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2021-07-08 02:14:36 +02:00
|
|
|
# Octoprint needs zeroconf >=0.24 <0.25. This can't be done via mkOverride, because in zeroconf 0.32
|
|
|
|
# the super package was migrated to fetchFromGitHub.
|
2020-12-04 21:08:40 +01:00
|
|
|
(
|
|
|
|
self: super: {
|
|
|
|
zeroconf = super.zeroconf.overrideAttrs (oldAttrs: rec {
|
|
|
|
version = "0.24.5";
|
2021-07-08 02:14:36 +02:00
|
|
|
src = super.fetchPypi {
|
|
|
|
inherit (oldAttrs) pname;
|
2020-12-04 21:08:40 +01:00
|
|
|
inherit version;
|
|
|
|
sha256 = "0jpgd0rk91si93857mjrizan5gc42kj1q4fi4160qgk68la88fl9";
|
|
|
|
};
|
2021-07-08 02:14:36 +02:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"zeroconf"
|
|
|
|
];
|
|
|
|
buildInputs = with self; [
|
|
|
|
pytestCheckHook
|
|
|
|
nose
|
|
|
|
];
|
|
|
|
pytestFlagsArray = [ "zeroconf/test.py" ];
|
2020-12-04 21:08:40 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2021-12-21 14:23:35 +01:00
|
|
|
# Octoprint pulls in celery indirectly but has no support for the up-to-date releases
|
|
|
|
(
|
|
|
|
self: super: {
|
|
|
|
celery = super.celery.overrideAttrs (oldAttrs: rec {
|
|
|
|
version = "5.0.0";
|
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
|
|
|
sha256 = "sha256-MTkw/d3nA9jjcCmjBL+RQpzRGu72PFfebayp2Vjh8lU=";
|
|
|
|
};
|
|
|
|
doCheck = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
# Octoprint would allow later sentry-sdk releases but not later click releases
|
|
|
|
(
|
|
|
|
self: super: {
|
|
|
|
sentry-sdk = super.sentry-sdk.overrideAttrs (oldAttrs: rec {
|
|
|
|
pname = "sentry-sdk";
|
|
|
|
version = "1.4.3";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "getsentry";
|
|
|
|
repo = "sentry-python";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "sha256-vdE6eqELMM69CWHaNYhF0HMCTV3tQsJlMHAA96oCy8c=";
|
|
|
|
};
|
|
|
|
disabledTests = [
|
|
|
|
"test_apply_simulates_delivery_info"
|
|
|
|
"test_auto_enabling_integrations_catches_import_error"
|
|
|
|
];
|
|
|
|
disabledTestPaths = [
|
|
|
|
# Don't test integrations
|
|
|
|
"tests/integrations"
|
|
|
|
];
|
|
|
|
});
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2020-08-25 23:29:31 +02:00
|
|
|
# Built-in dependency
|
|
|
|
(
|
|
|
|
self: super: {
|
|
|
|
octoprint-filecheck = self.buildPythonPackage rec {
|
|
|
|
pname = "OctoPrint-FileCheck";
|
2021-08-09 17:13:12 +02:00
|
|
|
version = "2021.2.23";
|
2020-03-10 13:42:31 +01:00
|
|
|
|
2020-08-25 23:29:31 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OctoPrint";
|
|
|
|
repo = "OctoPrint-FileCheck";
|
|
|
|
rev = version;
|
2021-08-09 17:13:12 +02:00
|
|
|
sha256 = "sha256-e/QGEBa9+pjOdrZq3Zc6ifbSMClIyeTOi0Tji0YdVmI=";
|
2020-08-25 23:29:31 +02:00
|
|
|
};
|
|
|
|
doCheck = false;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
)
|
2020-03-10 13:42:31 +01:00
|
|
|
|
2020-08-25 23:29:31 +02:00
|
|
|
# Built-in dependency
|
|
|
|
(
|
|
|
|
self: super: {
|
|
|
|
octoprint-firmwarecheck = self.buildPythonPackage rec {
|
|
|
|
pname = "OctoPrint-FirmwareCheck";
|
2021-11-02 21:13:42 +01:00
|
|
|
version = "2021.10.11";
|
2018-12-06 05:43:36 +01:00
|
|
|
|
2020-08-25 23:29:31 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OctoPrint";
|
|
|
|
repo = "OctoPrint-FirmwareCheck";
|
|
|
|
rev = version;
|
2021-11-02 21:13:42 +01:00
|
|
|
sha256 = "0hl0612x0h4pcwsrga5il5x3m04j37cmyzh2dg1kl971cvrw79n2";
|
2021-08-09 17:13:12 +02:00
|
|
|
};
|
|
|
|
doCheck = false;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
(
|
|
|
|
self: super: {
|
|
|
|
octoprint-pisupport = self.buildPythonPackage rec {
|
|
|
|
pname = "OctoPrint-PiSupport";
|
2021-11-02 20:58:31 +01:00
|
|
|
version = "2021.10.28";
|
2021-08-09 17:13:12 +02:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OctoPrint";
|
|
|
|
repo = "OctoPrint-PiSupport";
|
|
|
|
rev = version;
|
2021-11-02 20:58:31 +01:00
|
|
|
sha256 = "01bpvv1sn3113fdpw6b90c2rj8lqay118x609yy64z9ccm93khl9";
|
2020-08-25 23:29:31 +02:00
|
|
|
};
|
2021-08-09 17:13:12 +02:00
|
|
|
|
|
|
|
# requires octoprint itself during tests
|
2020-08-25 23:29:31 +02:00
|
|
|
doCheck = false;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
)
|
2016-02-14 12:56:07 +01:00
|
|
|
|
2020-08-25 23:29:31 +02:00
|
|
|
(
|
|
|
|
self: super: {
|
|
|
|
octoprint = self.buildPythonPackage rec {
|
|
|
|
pname = "OctoPrint";
|
2021-11-02 21:33:17 +01:00
|
|
|
version = "1.7.2";
|
2016-02-14 12:56:07 +01:00
|
|
|
|
2020-08-25 23:29:31 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OctoPrint";
|
|
|
|
repo = "OctoPrint";
|
|
|
|
rev = version;
|
2021-11-02 21:33:17 +01:00
|
|
|
sha256 = "sha256-jCfzUx3LQ7TlXKQU8qbhyS1P4Wew/SSgJHVSc1VLdx4=";
|
2020-08-25 23:29:31 +02:00
|
|
|
};
|
2017-03-21 15:31:08 +01:00
|
|
|
|
2020-08-25 23:29:31 +02:00
|
|
|
propagatedBuildInputs = with super; [
|
2020-12-04 21:09:22 +01:00
|
|
|
blinker
|
|
|
|
cachelib
|
|
|
|
click
|
2021-11-02 21:33:17 +01:00
|
|
|
colorlog
|
2020-12-04 21:09:22 +01:00
|
|
|
emoji
|
|
|
|
feedparser
|
|
|
|
filetype
|
2020-08-25 23:29:31 +02:00
|
|
|
flask
|
|
|
|
flask-babel
|
|
|
|
flask_assets
|
2020-12-04 21:09:22 +01:00
|
|
|
flask_login
|
|
|
|
frozendict
|
|
|
|
future
|
2020-08-25 23:29:31 +02:00
|
|
|
itsdangerous
|
2021-08-09 17:13:12 +02:00
|
|
|
immutabledict
|
2020-12-04 21:09:22 +01:00
|
|
|
jinja2
|
|
|
|
markdown
|
|
|
|
markupsafe
|
2020-08-25 23:29:31 +02:00
|
|
|
netaddr
|
|
|
|
netifaces
|
2020-12-04 21:09:22 +01:00
|
|
|
octoprint-filecheck
|
|
|
|
octoprint-firmwarecheck
|
2021-08-09 17:13:12 +02:00
|
|
|
octoprint-pisupport
|
2021-11-02 21:33:17 +01:00
|
|
|
pathvalidate
|
2020-08-25 23:29:31 +02:00
|
|
|
pkginfo
|
2021-08-09 17:13:12 +02:00
|
|
|
pip
|
2020-12-04 21:09:22 +01:00
|
|
|
psutil
|
|
|
|
pylru
|
|
|
|
pyserial
|
|
|
|
pyyaml
|
|
|
|
regex
|
2020-08-25 23:29:31 +02:00
|
|
|
requests
|
2020-12-04 21:09:22 +01:00
|
|
|
rsa
|
|
|
|
sarge
|
2020-08-25 23:29:31 +02:00
|
|
|
semantic-version
|
|
|
|
sentry-sdk
|
2021-08-09 17:13:12 +02:00
|
|
|
setuptools
|
2020-12-04 21:09:22 +01:00
|
|
|
tornado
|
2020-08-25 23:29:31 +02:00
|
|
|
unidecode
|
2020-12-04 21:09:22 +01:00
|
|
|
watchdog
|
2021-06-15 13:12:45 +02:00
|
|
|
websocket-client
|
2020-12-04 21:09:22 +01:00
|
|
|
werkzeug
|
|
|
|
wrapt
|
2020-12-04 21:08:40 +01:00
|
|
|
zeroconf
|
2021-08-09 17:13:12 +02:00
|
|
|
zipstream-new
|
2021-12-21 14:23:35 +01:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
py.pkgs.appdirs
|
|
|
|
];
|
2016-02-14 12:56:07 +01:00
|
|
|
|
2021-12-21 14:23:35 +01:00
|
|
|
checkInputs = with super; [
|
|
|
|
ddt
|
|
|
|
mock
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2020-03-10 13:42:31 +01:00
|
|
|
|
2021-08-09 17:13:12 +02:00
|
|
|
patches = [
|
|
|
|
# substitute pip and let it find out, that it can't write anywhere
|
|
|
|
(substituteAll {
|
|
|
|
src = ./pip-path.patch;
|
|
|
|
pip = "${super.pip}/bin/pip";
|
|
|
|
})
|
|
|
|
|
|
|
|
# hardcore path to ffmpeg and hide related settings
|
|
|
|
(substituteAll {
|
|
|
|
src = ./ffmpeg-path.patch;
|
|
|
|
ffmpeg = "${pkgs.ffmpeg}/bin/ffmpeg";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-08-25 23:29:31 +02:00
|
|
|
postPatch = let
|
|
|
|
ignoreVersionConstraints = [
|
2021-11-02 21:33:17 +01:00
|
|
|
"cachelib"
|
|
|
|
"colorlog"
|
2021-02-02 16:44:27 +01:00
|
|
|
"emoji"
|
2021-08-09 17:13:12 +02:00
|
|
|
"immutabledict"
|
2022-01-09 00:48:23 +01:00
|
|
|
"PyYAML"
|
2021-12-21 14:23:35 +01:00
|
|
|
"sarge"
|
2020-08-25 23:29:31 +02:00
|
|
|
"sentry-sdk"
|
2021-02-02 16:44:27 +01:00
|
|
|
"watchdog"
|
2021-11-02 21:33:17 +01:00
|
|
|
"wrapt"
|
|
|
|
"zeroconf"
|
2020-08-25 23:29:31 +02:00
|
|
|
];
|
|
|
|
in
|
|
|
|
''
|
|
|
|
sed -r -i \
|
|
|
|
${lib.concatStringsSep "\n" (
|
|
|
|
map (
|
|
|
|
e:
|
|
|
|
''-e 's@${e}[<>=]+.*@${e}",@g' \''
|
|
|
|
) ignoreVersionConstraints
|
|
|
|
)}
|
|
|
|
setup.py
|
|
|
|
'';
|
2017-03-21 15:31:08 +01:00
|
|
|
|
2020-08-25 23:29:31 +02:00
|
|
|
dontUseSetuptoolsCheck = true;
|
2020-03-10 13:42:31 +01:00
|
|
|
|
2020-08-25 23:29:31 +02:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
rm pytest.ini
|
|
|
|
'';
|
2020-05-03 11:59:18 +02:00
|
|
|
|
2020-08-25 23:29:31 +02:00
|
|
|
disabledTests = [
|
|
|
|
"test_check_setup" # Why should it be able to call pip?
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
"test_set_external_modification"
|
|
|
|
];
|
|
|
|
|
2021-02-01 03:43:52 +01:00
|
|
|
passthru = {
|
|
|
|
python = self.python;
|
|
|
|
updateScript = nix-update-script { attrPath = "octoprint"; };
|
|
|
|
};
|
2020-08-25 23:29:31 +02:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-08-25 23:29:31 +02:00
|
|
|
homepage = "https://octoprint.org/";
|
|
|
|
description = "The snappy web interface for your 3D printer";
|
2021-12-21 14:23:35 +01:00
|
|
|
license = licenses.agpl3Only;
|
2020-08-25 23:29:31 +02:00
|
|
|
maintainers = with maintainers; [ abbradar gebner WhittlesJr ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
)
|
|
|
|
(import ./plugins.nix { inherit pkgs; })
|
|
|
|
packageOverrides
|
|
|
|
]
|
|
|
|
);
|
2016-02-14 12:56:07 +01:00
|
|
|
};
|
2020-08-25 23:29:31 +02:00
|
|
|
in
|
|
|
|
with py.pkgs; toPythonApplication octoprint
|