You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

144 lines
4.4 KiB

  1. # meli
  2. For a quick start, build and install locally:
  3. ```sh
  4. PREFIX=~/.local make install
  5. ```
  6. Available subcommands:
  7. - meli (builds meli with optimizations in `$CARGO_TARGET_DIR`)
  8. - install (installs binary in `$BINDIR` and documentation to `$MANDIR`)
  9. - uninstall
  10. Secondary subcommands:
  11. - clean (cleans build artifacts)
  12. - check-deps (checks dependencies)
  13. - install-bin (installs binary to `$BINDIR`)
  14. - install-doc (installs manpages to `$MANDIR`)
  15. - help (prints this information)
  16. - dist (creates release tarball named `meli-VERSION.tar.gz` in this directory)
  17. - deb-dist (builds debian package in the parent directory)
  18. - distclean (cleans distribution build artifacts)
  19. The Makefile *should* be portable and not require a specific `make` version.
  20. # Documentation
  21. After installing meli, see `meli(1)` and `meli.conf(5)` for documentation. Sample configuration and theme files can be found in the `samples/` subdirectory.
  22. # Building
  23. meli requires rust 1.39 and rust's package manager, Cargo. Information on how
  24. to get it on your system can be found here: <https://doc.rust-lang.org/cargo/getting-started/installation.html>
  25. With Cargo available, the project can be built with
  26. ```sh
  27. make
  28. ```
  29. The resulting binary will then be found under `target/release/meli`
  30. Run:
  31. ```sh
  32. make install
  33. ```
  34. to install the binary and man pages. This requires root, so I suggest you override the default paths and install it in your `$HOME`:
  35. ```sh
  36. make PREFIX=$HOME/.local install
  37. ```
  38. See `meli(1)` and `meli.conf(5)` for documentation.
  39. You can build and run meli with one command:
  40. ```sh
  41. cargo run --release
  42. ```
  43. While the project is in early development, meli will only be developed for the
  44. linux kernel and respected linux distributions. Support for more UNIX-like OSes
  45. is on the roadmap.
  46. ## Features
  47. Some functionality is held behind "feature gates", or compile-time flags. The following list explains each feature's purpose:
  48. - `notmuch` provides support for using a notmuch database as a mail backend
  49. - `jmap` provides support for connecting to a jmap server and use it as a mail backend
  50. - `sqlite3` provides support for builting fast search indexes in local sqlite3 databases
  51. - `cli-docs` includes the manpage documentation compiled by either `mandoc` or `man` binary to plain text in `meli`'s command line. Embedded documentation can be viewed with the subcommand `meli man [PAGE]`
  52. - `svgscreenshot` provides support for taking screenshots of the current view of meli and saving it as SVG files. Its only purpose is taking screenshots for the official meli webpage.
  53. - `debug-tracing` enables various trace debug logs from various places around the meli code base. The trace log is printed in `stderr`.
  54. ## Building in Debian
  55. Building with Debian's packaged cargo might require the installation of these
  56. two packages: `librust-openssl-sys-dev librust-libdbus-sys-dev`
  57. A `*.deb` package can be built with `make deb-dist`
  58. # Using notmuch
  59. To use the optional notmuch backend feature, you must have `libnotmuch5` installed in your system. In Debian-like systems, install the `libnotmuch5` packages. meli detects the library's presence on runtime.
  60. # Building with JMAP
  61. To build with JMAP support, prepend the environment variable `MELI_FEATURES='jmap'` to your make invocation:
  62. ```sh
  63. MELI_FEATURES="jmap" make
  64. ```
  65. or if building directly with cargo, use the flag `--features="jmap"'.
  66. # Development
  67. Development builds can be built and/or run with
  68. ```
  69. cargo build
  70. cargo run
  71. ```
  72. There is a debug/tracing log feature that can be enabled by using the flag
  73. `--feature debug-tracing` after uncommenting the features in `Cargo.toml`. The logs
  74. are printed in stderr, thus you can run meli with a redirection (i.e `2> log`)
  75. Code style follows the default rustfmt profile.
  76. # Configuration
  77. meli by default looks for a configuration file in this location: `$XDG_CONFIG_HOME/meli/config.toml`
  78. You can run meli with arbitrary configuration files by setting the `$MELI_CONFIG`
  79. environment variable to their locations, ie:
  80. ```sh
  81. MELI_CONFIG=./test_config cargo run
  82. ```
  83. # Testing
  84. How to run specific tests:
  85. ```sh
  86. cargo test -p {melib, meli} (-- --nocapture) (--test test_name)
  87. ```
  88. # Profiling
  89. ```sh
  90. perf record -g target/debug/bin
  91. perf script | stackcollapse-perf | rust-unmangle | flamegraph > perf.svg
  92. ```
  93. # Running fuzz targets
  94. Note: `cargo-fuzz` requires the nightly toolchain.
  95. ```sh
  96. cargo +nightly fuzz run envelope_parse -- -dict=fuzz/envelope_tokens.dict
  97. ```