nixpkgs/pkgs/tools/admin/salt/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

78 lines
2.1 KiB
Nix
Raw Normal View History

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
, fetchPypi
2020-04-19 16:19:26 +03:00
, openssl
# 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 ? []
}:
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";
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=";
};
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
];
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}"
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"
# Remove windows-only requirement
2022-05-12 19:32:16 +03:00
substituteInPlace "requirements/zeromq.txt" \
--replace 'pyzmq==25.0.2 ; sys_platform == "win32"' ""
'';
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";
# 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; {
homepage = "https://saltproject.io/";
changelog = "https://docs.saltproject.io/en/latest/topics/releases/${version}.html";
description = "Portable, distributed, remote execution and configuration management system";
maintainers = with maintainers; [ Flakebi ];
license = licenses.asl20;
};
}