1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 dnspython,
7 chardet,
8 python-daemon,
9 jinja2,
10 click,
11 unittestCheckHook,
12}:
13
14buildPythonPackage rec {
15 pname = "salmon-mail";
16 version = "3.3.0";
17 pyproject = true;
18
19 src = fetchFromGitHub {
20 owner = "moggers87";
21 repo = "salmon";
22 tag = version;
23 hash = "sha256-ysBO/ridfy7YPoTsVwAxar9UvfM/qxrx2dp0EtDNLvE=";
24 };
25
26 nativeCheckInputs = [
27 jinja2
28 unittestCheckHook
29 ];
30
31 build-system = [ setuptools ];
32
33 dependencies = [
34 chardet
35 click
36 dnspython
37 python-daemon
38 ];
39
40 pythonImportsCheck = [
41 "salmon"
42 "salmon.handlers"
43 ];
44
45 # Darwin tests fail without this. See:
46 # https://github.com/NixOS/nixpkgs/pull/82166#discussion_r399909846
47 __darwinAllowLocalNetworking = true;
48
49 # The tests use salmon executable installed by salmon itself so we need to add
50 # that to PATH
51 preCheck = ''
52 export PATH=$out/bin:$PATH
53 '';
54
55 meta = with lib; {
56 homepage = "https://salmon-mail.readthedocs.org/";
57 changelog = "https://github.com/moggers87/salmon/blob/${src.rev}/CHANGELOG.rst";
58 description = "Pythonic mail application server";
59 mainProgram = "salmon";
60 license = licenses.gpl3Only;
61 maintainers = with maintainers; [ jluttine ];
62 };
63}