python312Packages.materialx: 1.39.1 -> 1.38.10 (#380449)
[NixPkgs.git] / pkgs / by-name / al / alot / package.nix
blobc720e0b8374eaff4e6f3fd3ec9a9f54b75685fd7
2   lib,
3   python311,
4   fetchFromGitHub,
5   file,
6   gnupg,
7   gawk,
8   procps,
9   notmuch,
10   withManpage ? false,
13 with python311.pkgs;
14 buildPythonApplication rec {
15   pname = "alot";
16   version = "0.11";
17   pyproject = true;
19   outputs =
20     [
21       "out"
22     ]
23     ++ lib.optionals withManpage [
24       "man"
25     ];
27   disabled = !isPy3k;
29   src = fetchFromGitHub {
30     owner = "pazz";
31     repo = "alot";
32     tag = version;
33     sha256 = "sha256-mXaRzl7260uxio/BQ36BCBxgKhl1r0Rc6PwFZA8qNqc=";
34   };
36   postPatch = ''
37     substituteInPlace alot/settings/manager.py \
38       --replace-fail /usr/share "$out/share"
39   '';
41   nativeBuildInputs = [
42     setuptools-scm
43   ] ++ lib.optional withManpage sphinx;
45   propagatedBuildInputs = [
46     configobj
47     file
48     gpgme
49     notmuch2
50     python-magic
51     service-identity
52     twisted
53     urwid
54     urwidtrees
55   ];
57   nativeCheckInputs = [
58     future
59     gawk
60     gnupg
61     mock
62     procps
63     pytestCheckHook
64     notmuch
65   ];
67   postBuild = lib.optionalString withManpage [
68     "make -C docs man"
69   ];
71   disabledTests = [
72     # Some twisted tests need internet access
73     "test_env_set"
74     "test_no_spawn_no_stdin_attached"
75     # DatabaseLockedError
76     "test_save_named_query"
77   ];
79   postInstall =
80     let
81       completionPython = python.withPackages (ps: [ ps.configobj ]);
82     in
83     lib.optionalString withManpage ''
84       mkdir -p $out/man
85       cp -r docs/build/man $out/man
86     ''
87     + ''
88       mkdir -p $out/share/{applications,alot}
89       cp -r extra/themes $out/share/alot
91       substituteInPlace extra/completion/alot-completion.zsh \
92         --replace-fail "python3" "${completionPython.interpreter}"
93       install -D extra/completion/alot-completion.zsh $out/share/zsh/site-functions/_alot
95       sed "s,/usr/bin,$out/bin,g" extra/alot.desktop > $out/share/applications/alot.desktop
96     '';
98   meta = with lib; {
99     homepage = "https://github.com/pazz/alot";
100     description = "Terminal MUA using notmuch mail";
101     mainProgram = "alot";
102     license = licenses.gpl3Plus;
103     platforms = platforms.linux;
104     maintainers = with maintainers; [ milibopp ];
105   };