Files
2026-11-07 13:14:22 -05:00

113 lines
3.0 KiB
Bash

# Maintainer: Storm Dragon <storm_dragon@stormux.org>
# shellcheck shell=bash disable=SC2034,SC2154,SC2164
pkgbase=cthulhu-git
pkgname=cthulhu-git
_pkgname=cthulhu
pkgver=2026.10.31.r588.g9680b58
pkgrel=2
pkgdesc="Desktop-agnostic screen reader with speech, Braille, and Tentacle support"
url="https://git.stormux.org/storm/cthulhu"
arch=(x86_64 aarch64 armv7h)
license=(GPL-3.0-or-later)
provides=("${_pkgname}=${pkgver}")
conflicts=("${_pkgname}")
depends=(
# Native accessibility and user interface
glibc
at-spi2-core
glib2
gdk-pixbuf2
gtk3
# Audio and speech
speech-dispatcher
gstreamer
gst-plugins-base # playbin, audiotestsrc, basic decoders
gst-plugins-good # pulsesink, more decoders
# Braille support
brltty
liblouis
# Xorg input, window capture, and clipboard operations
libx11
libxres
libxtst
libxi
libxfixes
libxkbcommon
xclip
# Private D-Bus services
dbus
)
optdepends=(
'git: Discover and update Tentacle repositories'
'tesseract: OCR engine for text recognition'
'tesseract-data-eng: English OCR language data'
)
optdepends_x86_64=(
# Wine accessibility helpers are supported on x86_64.
'wine-access: Wine, Proton, NVDA Controller, and Tolk integration'
)
makedepends=(
git
go
pkgconf
)
options=(!debug !lto)
source=("${_pkgname}::git+https://git.stormux.org/storm/${_pkgname}.git#branch=master")
sha512sums=('SKIP')
pkgver() {
cd "${_pkgname}"
local projectVersion revisionCount commitHash
projectVersion=$(sed -n 's/^const Version = "\([^"]*\)"/\1/p' internal/version/version.go)
[[ -n "${projectVersion}" ]] || return 1
revisionCount=$(git rev-list --count HEAD)
commitHash=$(git rev-parse --short=7 HEAD)
echo "${projectVersion}.r${revisionCount}.g${commitHash}"
}
build() {
cd "${_pkgname}"
export CGO_ENABLED=1
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
export GOPATH="${srcdir}/go"
export GOCACHE="${GOCACHE:-${srcdir}/go-build}"
export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
go build -o build/cthulhu ./cmd/cthulhu
go build -tags brlapi -o build/cthulhu-braille ./cmd/cthulhu-braille
# Include the helper once incoming Remote keyboard support reaches master.
if [[ -d cmd/cthulhu-input-helper ]]; then
go build -o build/cthulhu-input-helper ./cmd/cthulhu-input-helper
fi
}
check() {
cd "${_pkgname}"
export CGO_ENABLED=1
export GOPATH="${srcdir}/go"
export GOCACHE="${GOCACHE:-${srcdir}/go-build}"
go test -tags brlapi ./... -count=1
}
package() {
cd "${_pkgname}"
install -Dm755 build/cthulhu "${pkgdir}/usr/bin/cthulhu"
install -Dm755 build/cthulhu-braille "${pkgdir}/usr/bin/cthulhu-braille"
if [[ -d cmd/cthulhu-input-helper ]]; then
install -Dm755 build/cthulhu-input-helper "${pkgdir}/usr/bin/cthulhu-input-helper"
fi
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
install -Dm644 AUTHORS "${pkgdir}/usr/share/doc/${pkgname}/AUTHORS"
}
# vim:set sw=2 sts=-1 et: