1{ lib
2, stdenv
3, python3
4, fetchPypi
5, openssl
6 # Many Salt modules require various Python modules to be installed,
7 # passing them in this array enables Salt to find them.
8, extraInputs ? []
9}:
10
11python3.pkgs.buildPythonApplication rec {
12 pname = "salt";
13 version = "3007.0";
14 format = "setuptools";
15
16 src = fetchPypi {
17 inherit pname version;
18 hash = "sha256-Qb+E5x/GVb+KS1LrRA0GIa6WEJaghtIOEy4VEuLt3/g=";
19 };
20
21 patches = [
22 ./fix-libcrypto-loading.patch
23 ];
24
25 postPatch = ''
26 substituteInPlace "salt/utils/rsax931.py" \
27 --subst-var-by "libcrypto" "${lib.getLib openssl}/lib/libcrypto${stdenv.hostPlatform.extensions.sharedLibrary}"
28 substituteInPlace requirements/base.txt \
29 --replace contextvars ""
30
31 # Don't require optional dependencies on Darwin, let's use
32 # `extraInputs` like on any other platform
33 echo -n > "requirements/darwin.txt"
34
35 # Remove windows-only requirement
36 substituteInPlace "requirements/zeromq.txt" \
37 --replace 'pyzmq==25.0.2 ; sys_platform == "win32"' ""
38 '';
39
40 propagatedBuildInputs = with python3.pkgs; [
41 distro
42 jinja2
43 jmespath
44 looseversion
45 markupsafe
46 msgpack
47 packaging
48 psutil
49 pycryptodomex
50 pyyaml
51 pyzmq
52 requests
53 tornado
54 ] ++ extraInputs;
55
56 # Don't use fixed dependencies on Darwin
57 USE_STATIC_REQUIREMENTS = "0";
58
59 # The tests fail due to socket path length limits at the very least;
60 # possibly there are more issues but I didn't leave the test suite running
61 # as is it rather long.
62 doCheck = false;
63
64 meta = with lib; {
65 homepage = "https://saltproject.io/";
66 changelog = "https://docs.saltproject.io/en/latest/topics/releases/${version}.html";
67 description = "Portable, distributed, remote execution and configuration management system";
68 maintainers = with maintainers; [ Flakebi ];
69 license = licenses.asl20;
70 };
71}