2020-04-19 16:19:26 +03:00
|
|
|
{ lib
|
2022-12-08 17:59:15 +03:00
|
|
|
, stdenv
|
2020-04-19 16:19:26 +03:00
|
|
|
, python3
|
2023-08-22 09:43:27 +03:00
|
|
|
, fetchpatch
|
2023-05-25 14:54:35 +03:00
|
|
|
, fetchPypi
|
2020-04-19 16:19:26 +03:00
|
|
|
, openssl
|
2016-04-03 02:37:38 +03:00
|
|
|
# Many Salt modules require various Python modules to be installed,
|
|
|
|
# passing them in this array enables Salt to find them.
|
2020-04-19 16:19:26 +03:00
|
|
|
, extraInputs ? []
|
2016-04-03 02:37:38 +03:00
|
|
|
}:
|
2021-10-23 12:08:19 +03:00
|
|
|
|
2022-05-12 19:32:16 +03:00
|
|
|
python3.pkgs.buildPythonApplication rec {
|
2017-05-19 10:33:32 +03:00
|
|
|
pname = "salt";
|
2024-01-12 11:11:57 +03:00
|
|
|
version = "3006.5";
|
2023-08-22 09:43:27 +03:00
|
|
|
format = "setuptools";
|
2016-04-03 02:37:38 +03:00
|
|
|
|
2023-05-25 14:54:35 +03:00
|
|
|
src = fetchPypi {
|
2017-05-19 10:33:32 +03:00
|
|
|
inherit pname version;
|
2024-01-12 11:11:57 +03:00
|
|
|
hash = "sha256-b5aH8lQt3ICEsXy0fwpMr9SJQBI7o+1XMfaqgf5/lz4=";
|
2016-04-03 02:37:38 +03:00
|
|
|
};
|
|
|
|
|
2022-05-12 19:32:16 +03:00
|
|
|
patches = [
|
2023-08-22 09:43:27 +03:00
|
|
|
# https://github.com/saltstack/salt/pull/63795
|
|
|
|
(fetchpatch {
|
|
|
|
name = "remove-duplicate-scripts.patch";
|
|
|
|
url = "https://github.com/saltstack/salt/commit/6b9463836e70e40409dbf653f01aa94ef869dfe7.patch";
|
|
|
|
hash = "sha256-VcVdKC8EH4qoWHtq6eEPl8OviR4eA2k/S2lWNQbubJw=";
|
|
|
|
})
|
2022-05-12 19:32:16 +03:00
|
|
|
./fix-libcrypto-loading.patch
|
|
|
|
];
|
2016-04-03 02:37:38 +03:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace "salt/utils/rsax931.py" \
|
2022-12-08 17:59:15 +03:00
|
|
|
--subst-var-by "libcrypto" "${lib.getLib openssl}/lib/libcrypto${stdenv.hostPlatform.extensions.sharedLibrary}"
|
2021-06-25 00:54:59 +03:00
|
|
|
substituteInPlace requirements/base.txt \
|
|
|
|
--replace contextvars ""
|
2022-05-12 19:32:16 +03:00
|
|
|
|
|
|
|
# Don't require optional dependencies on Darwin, let's use
|
|
|
|
# `extraInputs` like on any other platform
|
|
|
|
echo -n > "requirements/darwin.txt"
|
|
|
|
|
2023-04-22 19:25:10 +03:00
|
|
|
# Remove windows-only requirement
|
2022-05-12 19:32:16 +03:00
|
|
|
substituteInPlace "requirements/zeromq.txt" \
|
2023-04-22 19:25:10 +03:00
|
|
|
--replace 'pyzmq==25.0.2 ; sys_platform == "win32"' ""
|
2016-04-03 02:37:38 +03:00
|
|
|
'';
|
|
|
|
|
2023-08-22 09:43:27 +03:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
|
|
distro
|
|
|
|
jinja2
|
|
|
|
jmespath
|
|
|
|
looseversion
|
|
|
|
markupsafe
|
|
|
|
msgpack
|
|
|
|
packaging
|
|
|
|
psutil
|
|
|
|
pycryptodomex
|
|
|
|
pyyaml
|
|
|
|
pyzmq
|
|
|
|
requests
|
|
|
|
] ++ extraInputs;
|
|
|
|
|
2022-05-12 19:32:16 +03:00
|
|
|
# Don't use fixed dependencies on Darwin
|
|
|
|
USE_STATIC_REQUIREMENTS = "0";
|
|
|
|
|
2016-04-03 02:37:38 +03: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-04-19 16:19:26 +03:00
|
|
|
meta = with lib; {
|
2021-03-17 22:38:16 +03:00
|
|
|
homepage = "https://saltproject.io/";
|
|
|
|
changelog = "https://docs.saltproject.io/en/latest/topics/releases/${version}.html";
|
2016-04-03 02:37:38 +03:00
|
|
|
description = "Portable, distributed, remote execution and configuration management system";
|
2020-10-23 19:28:35 +03:00
|
|
|
maintainers = with maintainers; [ Flakebi ];
|
2016-04-03 02:37:38 +03:00
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
|
|
|
}
|