lol
1{ lib
2, stdenv
3, fetchFromGitHub
4, glibcLocales
5, meson
6, ninja
7, pkg-config
8, python3
9, cld2
10, coreutils
11, emacs
12, glib
13, gmime3
14, texinfo
15, xapian
16}:
17
18stdenv.mkDerivation rec {
19 pname = "mu";
20 version = "1.12.5";
21
22 outputs = [ "out" "mu4e" ];
23
24 src = fetchFromGitHub {
25 owner = "djcb";
26 repo = "mu";
27 rev = "v${version}";
28 hash = "sha256-dQeXL+CcysmlV6VYSuZtWGSgIhoqP6Y20Qora4l0iP8=";
29 };
30
31 postPatch = ''
32 substituteInPlace lib/utils/mu-utils-file.cc \
33 --replace-fail "/bin/rm" "${coreutils}/bin/rm"
34 substituteInPlace lib/tests/bench-indexer.cc \
35 --replace-fail "/bin/rm" "${coreutils}/bin/rm"
36 substituteInPlace lib/mu-maildir.cc \
37 --replace-fail "/bin/mv" "${coreutils}/bin/mv"
38 patchShebangs build-aux/date.py
39 '';
40
41 postInstall = ''
42 rm --verbose $mu4e/share/emacs/site-lisp/mu4e/*.elc
43 '';
44
45 # move only the mu4e info manual
46 # this has to be after preFixup otherwise the info manual may be moved back by _multioutDocs()
47 # we manually move the mu4e info manual instead of setting
48 # outputInfo to mu4e because we do not want to move the mu-guile
49 # info manual (if it exists)
50 postFixup = ''
51 moveToOutput share/info/mu4e.info.gz $mu4e
52 install-info $mu4e/share/info/mu4e.info.gz $mu4e/share/info/dir
53 if [[ -a ''${!outputInfo}/share/info/mu-guile.info.gz ]]; then
54 install-info --delete $mu4e/share/info/mu4e.info.gz ''${!outputInfo}/share/info/dir
55 else
56 rm --verbose --recursive ''${!outputInfo}/share/info
57 fi
58 '';
59
60 buildInputs = [ cld2 emacs glib gmime3 texinfo xapian ];
61
62 mesonFlags = [
63 "-Dguile=disabled"
64 "-Dreadline=disabled"
65 "-Dlispdir=${placeholder "mu4e"}/share/emacs/site-lisp"
66 ];
67
68 nativeBuildInputs = [ pkg-config meson ninja python3 glibcLocales ];
69
70 doCheck = true;
71
72 # Tests need a UTF-8 aware locale configured
73 env.LANG = "C.UTF-8";
74
75 meta = with lib; {
76 description = "A collection of utilities for indexing and searching Maildirs";
77 license = licenses.gpl3Plus;
78 homepage = "https://www.djcbsoftware.nl/code/mu/";
79 changelog = "https://github.com/djcb/mu/releases/tag/v${version}";
80 maintainers = with maintainers; [ antono chvp peterhoeg ];
81 mainProgram = "mu";
82 platforms = platforms.unix;
83 };
84}