mechrevo-console
LOW
maintainer lightjunction
0 votes
scanned 2026-11-02 08:02:24.858082
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
# shellcheck shell=bash
2
# makepkg consumes these metadata variables and supplies srcdir/pkgdir.
3
# shellcheck disable=SC2034,SC2154
4
# Maintainer: LIghtJUNction <lightjunction.me@gmail.com>
5
# The Rust console is independent of DKMS and the legacy tools.
6
7
pkgname=mechrevo-console
8
pkgver=0.1.0.r1535.gcee10ec
9
pkgrel=2
10
pkgdesc='Native MECHREVO system and OEM device control console'
11
arch=('x86_64')
12
url='https://github.com/LIghtJUNction/mechrevo-drivers'
13
license=('GPL-2.0-or-later' 'OFL-1.1')
14
depends=('glibc' 'libgcc' 'fontconfig' 'libxkbcommon' 'libxkbcommon-x11'
15
'wayland' 'libx11' 'libxcursor' 'libxi' 'libxrandr' 'libglvnd' 'polkit'
16
'python' 'systemd')
17
# Cargo enforces the GUI's Rust 1.95 minimum; rustup also provides `rust`.
18
makedepends=('git' 'rust' 'pkgconf' 'desktop-file-utils' 'libxml2')
19
optdepends=('noto-fonts-cjk: Chinese system font fallback')
20
options=('!strip' '!debug' '!lto')
21
22
# Always build the reviewed commit, including when using an existing local repo.
23
_source_commit=cee10ecbf7e86582e2e0f7ba887c13385c96c50d
24
_source_url=${MECHREVO_CONSOLE_SOURCE:-"${url}.git"}
25
source=("mechrevo-drivers::git+${_source_url}#commit=${_source_commit}"
26
'best.lmm.mechrevo-console.desktop'
27
'mechrevo-console.install')
28
sha256sums=('SKIP'
29
'bca48b9200f8aa66b34f357c3b8cce4f679bba998b6e777afec047bf601576a5'
30
'8778bbd1244d414adafe79a7d2187765a7e9a5da1f4efdd3d6e49c3688f52e20')
31
install=mechrevo-console.install
32
33
prepare() {
34
cd "${srcdir}/mechrevo-drivers" || return 1
35
if [[ $(git rev-parse HEAD) != "$_source_commit" ]] ||
36
! git diff-index --quiet HEAD --; then
37
printf '%s\n' 'Source must be an unchanged checkout of the pinned console commit.' >&2
38
return 1
39
fi
40
local file
41
for file in console/Cargo.toml console/Cargo.lock \
42
console/crates/cli/Cargo.toml console/crates/cli/src/main.rs \
43
console/crates/cli/src/oem_helper.rs console/crates/core/src/privilege.rs \
44
console/crates/gui/src/main.rs \
45
console/resources/org.mechrevo.console.oem.policy \
46
scripts/mechrevo_control.py scripts/mechrevo-gaming-hotkey.service \
47
console/crates/gui/assets/fonts/Cormorant-OFL.txt \
48
console/crates/gui/assets/fonts/Manrope-OFL.txt \
49
docs/MECHREVO-CONSOLE.md docs/PERFORMANCE-PROFILES.md LICENSE; do
50
if [[ ! -f $file || -L $file ]] ||
51
! git ls-files --error-unmatch -- "$file" >/dev/null 2>&1; then
52
printf 'Required tracked regular source file missing: %s\n' "$file" >&2
53
return 1
54
fi
55
done
56
# Populate a first-time builder's cache before the strictly offline build.
57
# --locked fails rather than changing the reviewed dependency graph.
58
cargo fetch --manifest-path console/Cargo.toml --locked \
59
--target "${CARCH}-unknown-linux-gnu"
60
}
61
62
build() {
63
cd "${srcdir}/mechrevo-drivers" || return 1
64
cargo build --manifest-path console/Cargo.toml \
65
--target-dir "${CARGO_TARGET_DIR:-${srcdir}/cargo-target}" \
66
--release --workspace --all-features --locked --offline
67
}
68
69
check() {
70
desktop-file-validate "${srcdir}/best.lmm.mechrevo-console.desktop" || return 1
71
local policy="${srcdir}/mechrevo-drivers/console/resources/org.mechrevo.console.oem.policy"
72
xmllint --nonet --noout "$policy" || return 1
73
if [[ $(xmllint --nonet --xpath \
74
'boolean(count(/policyconfig/action)=1 and /policyconfig/action[@id="org.mechrevo.console.oem"]/annotate[@key="org.freedesktop.policykit.exec.path"]="/usr/lib/mechrevo-console/oem-helper" and /policyconfig/action/defaults/allow_any="no" and /policyconfig/action/defaults/allow_inactive="auth_admin" and /policyconfig/action/defaults/allow_active="auth_admin_keep")' \
75
"$policy") != true ]]; then
76
printf '%s\n' 'OEM policy action, helper path or authorization defaults do not match the package contract.' >&2
77
return 1
78
fi
79
}
80
81
package() {
82
cd "${srcdir}/mechrevo-drivers" || return 1
83
local binary candidate
84
for binary in mechrevo-console mechrevo-console-gui; do
85
candidate="${CARGO_TARGET_DIR:-${srcdir}/cargo-target}/release/${binary}"
86
if [[ ! -f $candidate || -L $candidate || ! -x $candidate ]]; then
87
printf 'Required regular executable missing: %s\n' "$candidate" >&2
88
return 1
89
fi
90
install -Dm755 "$candidate" "${pkgdir}/usr/bin/${binary}" || return 1
91
done
92
candidate="${CARGO_TARGET_DIR:-${srcdir}/cargo-target}/release/mechrevo-console-oem-helper"
93
if [[ ! -f $candidate || -L $candidate || ! -x $candidate ]]; then
94
printf 'Required regular executable missing: %s\n' "$candidate" >&2
95
return 1
96
fi
97
local helper="${pkgdir}/usr/lib/mechrevo-console/oem-helper"
98
local policy=console/resources/org.mechrevo.console.oem.policy
99
local installed_policy="${pkgdir}/usr/share/polkit-1/actions/org.mechrevo.console.oem.policy"
100
if [[ ! -f $policy || -L $policy ]]; then
101
printf '%s\n' 'Required regular OEM policy is missing.' >&2
102
return 1
103
fi
104
install -Dm755 "$candidate" "$helper" || return 1
105
install -Dm644 "$policy" "$installed_policy" || return 1
106
if ! cmp -s "$candidate" "$helper" || ! cmp -s "$policy" "$installed_policy" ||
107
[[ $(stat -c '%a' "$helper") != 755 || $(stat -c '%a' "$installed_policy") != 644 ]]; then
108
printf '%s\n' 'Installed OEM helper or policy bytes/modes do not match the package contract.' >&2
109
return 1
110
fi
111
install -Dm644 "${srcdir}/best.lmm.mechrevo-console.desktop" \
112
"${pkgdir}/usr/share/applications/best.lmm.mechrevo-console.desktop"
113
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
114
install -Dm644 console/crates/gui/assets/fonts/Cormorant-OFL.txt \
115
"${pkgdir}/usr/share/licenses/${pkgname}/Cormorant-OFL.txt"
116
install -Dm644 console/crates/gui/assets/fonts/Manrope-OFL.txt \
117
"${pkgdir}/usr/share/licenses/${pkgname}/Manrope-OFL.txt"
118
install -Dm755 scripts/mechrevo_control.py "${pkgdir}/usr/bin/mechrevo-control"
119
install -Dm644 scripts/mechrevo-gaming-hotkey.service \
120
"${pkgdir}/usr/lib/systemd/user/mechrevo-gaming-hotkey.service"
121
install -Dm644 docs/MECHREVO-CONSOLE.md \
122
"${pkgdir}/usr/share/doc/${pkgname}/MECHREVO-CONSOLE.md"
123
install -Dm644 docs/PERFORMANCE-PROFILES.md \
124
"${pkgdir}/usr/share/doc/${pkgname}/PERFORMANCE-PROFILES.md"
125
}
126
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-11-02 08:02:24 | Low | 1 |