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

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

73 lines
2.3 KiB
Nix
Raw Normal View History

2020-04-19 13:19:26 +00:00
{ lib
2022-12-08 14:59:15 +00:00
, stdenv
2020-04-19 13:19:26 +00:00
, python3
, openssl
, fetchpatch
# Many Salt modules require various Python modules to be installed,
# passing them in this array enables Salt to find them.
2020-04-19 13:19:26 +00:00
, extraInputs ? []
}:
2021-10-23 09:08:19 +00:00
2022-05-12 16:32:16 +00:00
python3.pkgs.buildPythonApplication rec {
2017-05-19 07:33:32 +00:00
pname = "salt";
2022-10-13 22:15:02 +00:00
version = "3005.1";
2022-05-12 16:32:16 +00:00
src = python3.pkgs.fetchPypi {
2017-05-19 07:33:32 +00:00
inherit pname version;
2022-10-13 22:15:02 +00:00
hash = "sha256-+hTF2HP4Y7UJUBIdfiOiRJUCdFSQx8SMDPBFQGz+V8E=";
};
2022-05-12 16:32:16 +00:00
propagatedBuildInputs = with python3.pkgs; [
2020-06-18 19:38:54 +00:00
distro
jinja2
2022-10-13 22:15:02 +00:00
jmespath
markupsafe
2018-07-08 14:34:10 +00:00
msgpack
2021-10-23 09:08:19 +00:00
psutil
2020-06-18 19:38:54 +00:00
pycryptodomex
pyyaml
pyzmq
requests
] ++ extraInputs;
2022-05-12 16:32:16 +00:00
patches = [
./fix-libcrypto-loading.patch
];
postPatch = ''
substituteInPlace "salt/utils/rsax931.py" \
2022-12-08 14:59:15 +00:00
--subst-var-by "libcrypto" "${lib.getLib openssl}/lib/libcrypto${stdenv.hostPlatform.extensions.sharedLibrary}"
substituteInPlace requirements/base.txt \
--replace contextvars ""
2022-05-12 16:32:16 +00:00
# Don't require optional dependencies on Darwin, let's use
# `extraInputs` like on any other platform
echo -n > "requirements/darwin.txt"
# 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"'
'';
2022-05-12 16:32:16 +00: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 13:19:26 +00: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;
};
}