PKGBUILD: patch nim-dbus dtBool, bump pkgrel

This commit is contained in:
Niko Marmeladkov 2026-05-30 10:48:55 +03:00
parent fecb6d0746
commit 8b727b6633
Signed by untrusted user who does not match committer: Niko
GPG key ID: E3B955F9442D44E3

View file

@ -2,7 +2,7 @@
# Для разработки: nimble build && sudo cp nbt nimbt-daemon /usr/bin/
pkgname=nimbt
pkgver=0.1.0
pkgrel=2
pkgrel=3
pkgdesc="Lightweight Bluetooth manager for Linux (daemon + CLI)"
arch=('x86_64' 'aarch64')
url="https://git.n1kt.ru/Niko/nim-bt"
@ -14,10 +14,24 @@ sha256sums=('SKIP')
_repodir=nim-bt
build() {
prepare() {
cd "$srcdir/$_repodir"
nimble install -y --depsOnly --nimbleDir:"$srcdir/nimble" 2>/dev/null || true
export NIMBLE_DIR="$srcdir/nimble"
# patch nim-dbus: add dtBool to getPrimitive, nil-safe $ for DbusType
local dbus_val="$NIMBLE_DIR/pkgs2"/dbus-*/dbus/private/value.nim
local dbus_typ="$NIMBLE_DIR/pkgs2"/dbus-*/dbus/private/types.nim
if ! grep -q 'of dtBool:' "$dbus_val" 2>/dev/null; then
sed -i '/^ of dtDouble:/i\ of dtBool:\n return addr val.boolValue' "$dbus_val"
fi
if ! grep -q 'isNil' "$dbus_typ" 2>/dev/null; then
sed -i '/^proc `\$`\*(t: DbusType): string =/a\ if t.isNil:\n return "\<nil\>"' "$dbus_typ"
fi
}
build() {
cd "$srcdir/$_repodir"
export NIMBLE_DIR="$srcdir/nimble"
nim c \
--path:"$NIMBLE_DIR/pkgs2" \
--mm:orc -d:release --opt:speed --hints:off \