flectar-mail-git
LOW
maintainer liveopt
0 votes
scanned 2026-09-13 19:15:06.142757
Why flagged
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
Triggered rules
Low
Few votes, recently uploaded
zero_votes_recent
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
PKGBUILD
1
# Maintainer: Yubo Cao <cao2006721@gmail.com>
2
3
# Unofficial packaging of an unmodified Flectar Mail source build. Flectar does
4
# not produce or support this package; see TRADEMARKS.md upstream.
5
6
pkgname=flectar-mail-git
7
_srcname=mail
8
pkgver=0.1.0alpha.5.r7.g9f062a8
9
pkgrel=1
10
pkgdesc='Native email client built with Rust and Slint (unofficial build from git main)'
11
arch=('x86_64')
12
url='https://github.com/flectar/mail'
13
license=('AGPL-3.0-only')
14
depends=('dbus' 'fontconfig' 'gcc-libs' 'glibc' 'hicolor-icon-theme' 'libx11'
15
'libxcursor' 'libxi' 'libxkbcommon' 'libxkbcommon-x11' 'wayland'
16
'xdg-utils')
17
# rust >= 1.92 and python >= 3.11 (tomllib) are required by the upstream
18
# manifest and by scripts/stage-linux-metadata.py respectively.
19
makedepends=('git' 'rust' 'python' 'pkgconf')
20
optdepends=('xdg-desktop-portal: OAuth sign-in through the system browser and native file dialogs'
21
'gnome-keyring: Secret Service provider for storing account credentials'
22
'kwallet: alternative Secret Service provider'
23
'gnupg: OpenPGP signing and encryption'
24
'pinentry: passphrase prompts for GnuPG')
25
provides=("flectar-mail=$pkgver")
26
conflicts=('flectar-mail' 'flectar-mail-bin')
27
# makepkg's `lto` option hands the C dependencies (aws-lc-sys, libsqlite3-sys)
28
# -flto=auto while giving rustc -C linker-plugin-lto; rust-lld then cannot read
29
# GCC's LTO bytecode and every symbol in those archives comes out undefined.
30
# The release profile in Cargo.toml already asks for thin LTO anyway.
31
options=('!lto')
32
33
# PDFium is a pinned, checksum-verified prebuilt in upstream's own packaging
34
# (scripts/stage-pdfium.py). Fetch it as a declared source instead of letting
35
# that script download during build(); prepare() fails loudly if upstream moves
36
# the pin so this never silently ships a different runtime than upstream tested.
37
_pdfium_release=8044
38
source=("git+$url.git"
39
"pdfium-linux-x64-$_pdfium_release.tgz::https://github.com/bblanchon/pdfium-binaries/releases/download/chromium/$_pdfium_release/pdfium-linux-x64.tgz")
40
noextract=("pdfium-linux-x64-$_pdfium_release.tgz")
41
sha256sums=('SKIP'
42
'eb142f416aed3a72fc5a02dbd5884868a16cb99dc0cf53e6bdd64afbf67b05f4')
43
44
pkgver() {
45
cd "$_srcname"
46
local tag commits
47
tag=$(git describe --tags --abbrev=0)
48
commits=$(git rev-list --count "$tag..HEAD")
49
# Upstream tags carry a SemVer prerelease hyphen (v0.1.0-alpha.5). Dropping
50
# it keeps the version legal for pacman and sorts prereleases before the
51
# eventual final 0.1.0, matching the scheme flectar-mail-bin uses.
52
printf '%s.r%s.g%s' "${tag#v}" "$commits" "$(git rev-parse --short=7 HEAD)" | sed 's/-//'
53
}
54
55
prepare() {
56
cd "$_srcname"
57
58
local pinned_release pinned_sha
59
pinned_release=$(sed -n 's|^RELEASE = "chromium/\([0-9]\+\)"$|\1|p' scripts/stage-pdfium.py)
60
pinned_sha=$(sed -n 's/^ *"linux-x64": ("\([0-9a-f]\{64\}\)".*/\1/p' scripts/stage-pdfium.py)
61
if [[ $pinned_release != "$_pdfium_release" || $pinned_sha != "${sha256sums[1]}" ]]; then
62
error "Upstream now pins PDFium chromium/%s (%s)." "$pinned_release" "$pinned_sha"
63
error "Update _pdfium_release and sha256sums in this PKGBUILD."
64
return 1
65
fi
66
67
mkdir -p "$srcdir/pdfium"
68
bsdtar -xf "$srcdir/pdfium-linux-x64-$_pdfium_release.tgz" -C "$srcdir/pdfium"
69
70
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
71
}
72
73
build() {
74
cd "$_srcname"
75
export RUSTUP_TOOLCHAIN=stable
76
export CARGO_TARGET_DIR=target
77
# The checked-in .cargo/config.toml pins `jobs = 1` because this dependency
78
# graph (Slint's generated UI plus stylo/blitz at codegen-units=1) can
79
# exhaust a 16 GiB host. Scale with the builder instead of crawling, but
80
# budget ~8 GiB of RAM per job: on a big core count, `nproc` jobs is what
81
# actually runs the machine out of memory, not the CPU count.
82
local memory_gib jobs
83
memory_gib=$(($(awk '/^MemTotal:/ { print $2 }' /proc/meminfo) / 1048576))
84
jobs=$((memory_gib / 8))
85
(( jobs < 1 )) && jobs=1
86
(( jobs > $(nproc) )) && jobs=$(nproc)
87
export CARGO_BUILD_JOBS="$jobs"
88
msg2 "Building with %s parallel job(s) for %s GiB of RAM" "$jobs" "$memory_gib"
89
# The same feature set upstream ships in its Linux packages
90
# (scripts/build-deb.sh): software rendering, no WGPU.
91
cargo build --frozen --release --bin flectar-mail \
92
--no-default-features --features remote-content
93
}
94
95
check() {
96
cd "$_srcname"
97
# Upstream's own packaging gate: drive the sandboxed PDF worker against a
98
# generated fixture. It resolves PDFium relative to the executable, so the
99
# installed layout has to be mirrored in a scratch root.
100
local root="$srcdir/check-root"
101
rm -rf "$root"
102
install -Dm755 target/release/flectar-mail "$root/usr/bin/flectar-mail"
103
install -Dm644 "$srcdir/pdfium/lib/libpdfium.so" "$root/usr/lib/flectar-mail/libpdfium.so"
104
python scripts/test-pdf-preview.py "$root/usr/bin/flectar-mail"
105
}
106
107
package() {
108
cd "$_srcname"
109
110
install -Dm755 target/release/flectar-mail "$pkgdir/usr/bin/flectar-mail"
111
112
# src/pdf_preview.rs looks for PDFium at <exe dir>/../lib/flectar-mail,
113
# which is where upstream's own .deb and .rpm put it too.
114
install -Dm644 "$srcdir/pdfium/lib/libpdfium.so" \
115
"$pkgdir/usr/lib/flectar-mail/libpdfium.so"
116
install -Dm644 "$srcdir/pdfium/LICENSE" \
117
"$pkgdir/usr/lib/flectar-mail/pdfium-licenses/LICENSE"
118
install -Dm644 "$srcdir"/pdfium/licenses/* \
119
-t "$pkgdir/usr/lib/flectar-mail/pdfium-licenses/licenses/"
120
121
# Stamps the desktop entry and AppStream metainfo with the Cargo version.
122
# makepkg exports SOURCE_DATE_EPOCH, so the release date stays reproducible.
123
python scripts/stage-linux-metadata.py "$pkgdir"
124
125
install -Dm644 resources/app-icon/flectar-mail-masked-512.png \
126
"$pkgdir/usr/share/icons/hicolor/512x512/apps/com.flectar.mail.png"
127
install -Dm644 resources/app-icon/flectar-mail-masked.svg \
128
"$pkgdir/usr/share/icons/hicolor/scalable/apps/com.flectar.mail.svg"
129
130
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
131
install -Dm644 THIRD_PARTY_NOTICES.md \
132
"$pkgdir/usr/share/licenses/$pkgname/THIRD_PARTY_NOTICES.md"
133
install -Dm644 LICENSES/*.txt -t "$pkgdir/usr/share/licenses/$pkgname/LICENSES/"
134
install -Dm644 resources/fonts/google-sans-flex/OFL.txt \
135
"$pkgdir/usr/share/licenses/$pkgname/google-sans-flex-OFL.txt"
136
}
137
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-09-13 19:15:06 | Low | 1 |