diff --git a/PKGBUILD b/PKGBUILD index 42f8a6e..fa2b93e 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -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 "\"' "$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 \