Enable "static" build for C library dependencies by default

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
pull/314/head
Manos Pitsidianakis 2023-11-22 15:26:16 +02:00
parent af241d25cb
commit 7387b67eee
Signed by: Manos Pitsidianakis
GPG Key ID: 7729C7707F7E09D0
4 changed files with 27 additions and 11 deletions

View File

@ -0,0 +1,2 @@
[env]
PCRE2_SYS_STATIC = "1"

6
Cargo.lock generated
View File

@ -1138,6 +1138,7 @@ version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06085512b750d640299b79be4bad3d2fa90a9c00b1fd9e1b46364f66f0485c72"
dependencies = [
"cc",
"pkg-config",
]
@ -1272,6 +1273,7 @@ dependencies = [
"futures",
"indexmap",
"libc",
"libz-sys",
"linkify",
"melib",
"nix",
@ -1495,9 +1497,9 @@ dependencies = [
[[package]]
name = "notify-rust"
version = "4.9.0"
version = "4.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d7b75c8958cb2eab3451538b32db8a7b74006abc33eb2e6a9a56d21e4775c2b"
checksum = "827c5edfa80235ded4ab3fe8e9dc619b4f866ef16fe9b1c6b8a7f8692c0f2226"
dependencies = [
"dbus",
"log",

View File

@ -76,6 +76,7 @@ and editor of your choice to replace the defaults.
- `cargo install --git https://git.meli.delivery/meli/meli.git meli`
- [Download and install pre-built debian package, static linux binary](https://github.com/meli/meli/releases/ "github releases for meli"), or
- Install with [Nix](https://search.nixos.org/packages?show=meli&query=meli&from=0&size=30&sort=relevance&channel=unstable#disabled "nixos package search results for 'meli'").
## Documentation
See a comprehensive tour of `meli` in the manual page [`meli(7)`](./meli/docs/meli.7).
@ -123,6 +124,11 @@ Some functionality is held behind "feature gates", or compile-time flags. The fo
- `jmap` provides support for connecting to a jmap server and use it as a mail backend (on by default)
- `sqlite3` provides support for builting fast search indexes in local sqlite3 databases (on by default)
- `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]` (on by default).
- `regexp` provides experimental support for theming some e-mail fields based
on regular expressions.
It uses the `pcre2` library.
Since it's actual use in the code is very limited, it is not recommended to use this (off by default).
- `static` and `*-static` bundle C libraries in dependencies so that you don't need them installed in your system (on by default).
### Build Debian package (*deb*)

View File

@ -4,7 +4,6 @@ version = "0.8.2"
authors = ["Manos Pitsidianakis <manos@pitsidianak.is>"]
edition = "2021"
rust-version = "1.65.0"
license = "GPL-3.0-or-later"
readme = "README.md"
description = "terminal mail client"
@ -30,13 +29,12 @@ flate2 = { version = "1", optional = true }
futures = "0.3.5"
indexmap = { version = "^1.6", features = ["serde-1"] }
libc = { version = "0.2.125", default-features = false, features = ["extra_traits"] }
libz-sys = { version = "1.1", features = ["static"], optional = true }
linkify = { version = "^0.8", default-features = false }
melib = { path = "../melib", version = "0.8.2" }
nix = { version = "^0.24", default-features = false }
notify = { version = "4.0.1", default-features = false } # >:c
num_cpus = "1.12.0"
pcre2 = { version = "0.2.3", optional = true }
serde = "1.0.71"
serde_derive = "1.0.71"
serde_json = "1.0"
@ -49,6 +47,12 @@ termion = { version = "1.5.1", default-features = false }
toml = { version = "0.5.6", default-features = false, features = ["preserve_order"] }
xdg = "2.1.0"
[dependencies.pcre2]
# An [env] entry in .cargo/config.toml should force a static build instead of
# looking for a system library.
version = "0.2.3"
optional = true
[target.'cfg(target_os="linux")'.dependencies]
notify-rust = { version = "^4", default-features = false, features = ["dbus"], optional = true }
@ -65,23 +69,25 @@ regex = "1"
tempfile = "3.3"
[features]
default = ["sqlite3", "notmuch", "smtp", "dbus-notifications", "gpgme", "cli-docs", "jmap", "text-processing"]
default = ["sqlite3", "notmuch", "smtp", "dbus-notifications", "gpgme", "cli-docs", "jmap", "text-processing", "static"]
notmuch = ["melib/notmuch"]
jmap = ["melib/jmap"]
sqlite3 = ["melib/sqlite3"]
smtp = ["melib/smtp"]
smtp-trace = ["smtp", "melib/smtp-trace"]
regexp = ["pcre2"]
dbus-notifications = ["notify-rust"]
cli-docs = ["flate2"]
svgscreenshot = ["svg_crate"]
regexp = ["dep:pcre2"]
dbus-notifications = ["dep:notify-rust"]
cli-docs = ["dep:flate2"]
svgscreenshot = ["dep:svg_crate"]
text-processing = ["melib/unicode-algorithms"]
gpgme = ["melib/gpgme"]
# Static / vendoring features.
tls-static = ["melib/tls-static"]
http-static = ["melib/http-static"]
sqlite3-static = ["melib/sqlite3-static"]
static = ["tls-static", "http-static", "sqlite3-static"]
dbus-static = ["dep:notify-rust", "notify-rust/d_vendored"]
libz-static = ["dep:libz-sys", "libz-sys/static"]
static = ["tls-static", "http-static", "sqlite3-static", "dbus-static", "libz-static"]
# Print tracing logs as meli runs in stderr
# enable for debug tracing logs: build with --features=debug-tracing and export MELI_DEBUG_STDERR