2020-05-15 21:57:56 +00:00
|
|
|
{ lib
|
|
|
|
, python3
|
|
|
|
, openssl
|
2022-08-21 13:32:41 +00:00
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
# Many Salt modules require various Python modules to be installed,
|
|
|
|
# passing them in this array enables Salt to find them.
|
2020-05-15 21:57:56 +00:00
|
|
|
, extraInputs ? []
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
python3.pkgs.buildPythonApplication rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "salt";
|
2022-06-26 10:26:21 +00:00
|
|
|
version = "3004.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
src = python3.pkgs.fetchPypi {
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit pname version;
|
2022-06-26 10:26:21 +00:00
|
|
|
hash = "sha256-L6ZE9iANTja1WEbLNytuZ7bKD77AaX8djXPncbZl7XA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
2020-07-18 16:06:22 +00:00
|
|
|
distro
|
2020-04-24 23:36:52 +00:00
|
|
|
jinja2
|
|
|
|
markupsafe
|
|
|
|
msgpack
|
2021-12-06 16:07:01 +00:00
|
|
|
psutil
|
2020-07-18 16:06:22 +00:00
|
|
|
pycryptodomex
|
2020-04-24 23:36:52 +00:00
|
|
|
pyyaml
|
|
|
|
pyzmq
|
|
|
|
requests
|
|
|
|
] ++ extraInputs;
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
patches = [
|
|
|
|
./fix-libcrypto-loading.patch
|
2022-08-21 13:32:41 +00:00
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/saltstack/salt/commit/6ec8b90e402ff3fa8f27c7da70ece898592416bc.patch";
|
|
|
|
hash = "sha256-OQCJeG12cp2EZ0BErp6yqsqhv023923rVFDHAFUfF6c=";
|
|
|
|
})
|
2022-05-18 14:49:53 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace "salt/utils/rsax931.py" \
|
2022-04-03 18:54:34 +00:00
|
|
|
--subst-var-by "libcrypto" "${lib.getLib openssl}/lib/libcrypto.so"
|
2021-06-28 23:13:55 +00:00
|
|
|
substituteInPlace requirements/base.txt \
|
|
|
|
--replace contextvars ""
|
2022-05-18 14:49:53 +00:00
|
|
|
|
|
|
|
# Don't require optional dependencies on Darwin, let's use
|
|
|
|
# `extraInputs` like on any other platform
|
|
|
|
echo -n > "requirements/darwin.txt"
|
|
|
|
|
|
|
|
# Bug in 3004.1: https://github.com/saltstack/salt/pull/61839
|
|
|
|
substituteInPlace "salt/utils/entrypoints.py" \
|
|
|
|
--replace 'if sys.version_info >= (3, 10):' 'if False:'
|
|
|
|
|
|
|
|
# Bug in 3004.1: https://github.com/saltstack/salt/issues/61865
|
|
|
|
substituteInPlace "salt/transport/tcp.py" \
|
|
|
|
--replace 'payload = self.pack_publish(package)' 'package = self.pack_publish(package)'
|
|
|
|
|
|
|
|
# 3004.1: requirement of pyzmq was restricted to <22.0.0; looks like that req was incorrect
|
|
|
|
# https://github.com/saltstack/salt/commit/070597e525bb7d56ffadede1aede325dfb1b73a4
|
|
|
|
# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259279
|
|
|
|
# https://github.com/saltstack/salt/pull/61163
|
|
|
|
substituteInPlace "requirements/zeromq.txt" \
|
|
|
|
--replace 'pyzmq<=20.0.0 ; python_version < "3.6"' "" \
|
|
|
|
--replace 'pyzmq>=17.0.0,<22.0.0 ; python_version < "3.9"' 'pyzmq>=17.0.0 ; python_version < "3.9"' \
|
|
|
|
--replace 'pyzmq>19.0.2,<22.0.0 ; python_version >= "3.9"' 'pyzmq>19.0.2 ; python_version >= "3.9"'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
# Don't use fixed dependencies on Darwin
|
|
|
|
USE_STATIC_REQUIREMENTS = "0";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# The tests fail due to socket path length limits at the very least;
|
|
|
|
# possibly there are more issues but I didn't leave the test suite running
|
|
|
|
# as is it rather long.
|
|
|
|
doCheck = false;
|
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
meta = with lib; {
|
2021-03-19 17:17:44 +00:00
|
|
|
homepage = "https://saltproject.io/";
|
|
|
|
changelog = "https://docs.saltproject.io/en/latest/topics/releases/${version}.html";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Portable, distributed, remote execution and configuration management system";
|
2020-10-27 00:29:36 +00:00
|
|
|
maintainers = with maintainers; [ Flakebi ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
|
|
|
}
|