Changes to packaging.

This commit is contained in:
Storm Dragon committed 2026-11-17 21:57:42 -05:00
1 parent 758b038e1a
commit 440400985b
8 files changed
+198 -22

No files matched your search

@@ -5,7 +5,7 @@ pkgbase=cthulhu-git
pkgname=cthulhu-git pkgname=cthulhu-git
_pkgname=cthulhu _pkgname=cthulhu
pkgver=2026.10.31.r588.g9680b58 pkgver=2026.10.31.r588.g9680b58
pkgrel=2 pkgrel=3
pkgdesc="Desktop-agnostic screen reader with speech, Braille, and Tentacle support" pkgdesc="Desktop-agnostic screen reader with speech, Braille, and Tentacle support"
url="https://git.stormux.org/storm/cthulhu" url="https://git.stormux.org/storm/cthulhu"
arch=(x86_64 aarch64 armv7h) arch=(x86_64 aarch64 armv7h)
@@ -91,13 +91,20 @@ build() {
fi fi
} }
check() { check() (
cd "${_pkgname}" cd "${_pkgname}"
export CGO_ENABLED=1 export CGO_ENABLED=1
export GOPATH="${srcdir}/go" export GOPATH="${srcdir}/go"
export GOCACHE="${GOCACHE:-${srcdir}/go-build}" export GOCACHE="${GOCACHE:-${srcdir}/go-build}"
go test -tags brlapi ./... -count=1 # Keep activated services and runtime sockets away from the build desktop.
} local runtimeDir
runtimeDir=$(mktemp -d -t cthulhu-check.XXXXXXXX) || return 1
trap 'rm -rf -- "$runtimeDir"' EXIT
env -u DISPLAY -u WAYLAND_DISPLAY -u AT_SPI_BUS_ADDRESS \
-u DBUS_SESSION_BUS_ADDRESS -u DBUS_STARTER_ADDRESS -u DBUS_STARTER_BUS_TYPE \
XDG_RUNTIME_DIR="$runtimeDir" GOWORK=off \
dbus-run-session -- go test -tags brlapi ./... -count=1
)
package() { package() {
cd "${_pkgname}" cd "${_pkgname}"
+3 -1
View File
@@ -1,7 +1,7 @@
pkgbase = cthulhu pkgbase = cthulhu
pkgdesc = Desktop-agnostic screen reader with speech, Braille, and Tentacle support pkgdesc = Desktop-agnostic screen reader with speech, Braille, and Tentacle support
pkgver = 2026.10.31 pkgver = 2026.10.31
pkgrel = 6 pkgrel = 7
url = https://git.stormux.org/storm/cthulhu url = https://git.stormux.org/storm/cthulhu
arch = x86_64 arch = x86_64
arch = aarch64 arch = aarch64
@@ -37,8 +37,10 @@ pkgbase = cthulhu
options = !lto options = !lto
source = cthulhu::git+https://git.stormux.org/storm/cthulhu.git#tag=2026.10.31 source = cthulhu::git+https://git.stormux.org/storm/cthulhu.git#tag=2026.10.31
source = ocr-descendant-test.patch source = ocr-descendant-test.patch
source = speech-history-test.patch
sha512sums = SKIP sha512sums = SKIP
sha512sums = d733908430bb0de8ce199b44680b9fb38165bd55d0f178f1b9f81cf5b8f9d36dd1c4ab360f6e1fad048a81ba3a52ee3f5f041e0e60aa5aeb0065429623a77a7e sha512sums = d733908430bb0de8ce199b44680b9fb38165bd55d0f178f1b9f81cf5b8f9d36dd1c4ab360f6e1fad048a81ba3a52ee3f5f041e0e60aa5aeb0065429623a77a7e
sha512sums = 1fa70d8bf17a8469ef7dae342634a1d656a91bcdc2608e15ca906c4b3f88252042ec89401f9266372461d1e1e329ff7f3b8ff29d05fb04fc7c1f507c4634237a
optdepends_x86_64 = wine-access: Wine, Proton, NVDA Controller, and Tolk integration optdepends_x86_64 = wine-access: Wine, Proton, NVDA Controller, and Tolk integration
pkgname = cthulhu pkgname = cthulhu
+16 -6
View File
@@ -3,7 +3,7 @@
pkgname=cthulhu pkgname=cthulhu
pkgver=2026.10.31 pkgver=2026.10.31
pkgrel=6 pkgrel=7
pkgdesc="Desktop-agnostic screen reader with speech, Braille, and Tentacle support" pkgdesc="Desktop-agnostic screen reader with speech, Braille, and Tentacle support"
url="https://git.stormux.org/storm/cthulhu" url="https://git.stormux.org/storm/cthulhu"
arch=(x86_64 aarch64 armv7h) arch=(x86_64 aarch64 armv7h)
@@ -55,13 +55,16 @@ makedepends=(
options=(!debug !lto) options=(!debug !lto)
# The release tag must exist upstream before makepkg can fetch this source. # The release tag must exist upstream before makepkg can fetch this source.
source=("${pkgname}::git+https://git.stormux.org/storm/${pkgname}.git#tag=${pkgver}" source=("${pkgname}::git+https://git.stormux.org/storm/${pkgname}.git#tag=${pkgver}"
"ocr-descendant-test.patch") "ocr-descendant-test.patch"
"speech-history-test.patch")
sha512sums=('SKIP' sha512sums=('SKIP'
'd733908430bb0de8ce199b44680b9fb38165bd55d0f178f1b9f81cf5b8f9d36dd1c4ab360f6e1fad048a81ba3a52ee3f5f041e0e60aa5aeb0065429623a77a7e') 'd733908430bb0de8ce199b44680b9fb38165bd55d0f178f1b9f81cf5b8f9d36dd1c4ab360f6e1fad048a81ba3a52ee3f5f041e0e60aa5aeb0065429623a77a7e'
'1fa70d8bf17a8469ef7dae342634a1d656a91bcdc2608e15ca906c4b3f88252042ec89401f9266372461d1e1e329ff7f3b8ff29d05fb04fc7c1f507c4634237a')
prepare() { prepare() {
cd "${pkgname}" cd "${pkgname}"
patch -Np1 -i "${srcdir}/ocr-descendant-test.patch" patch -Np1 -i "${srcdir}/ocr-descendant-test.patch"
patch -Np1 -i "${srcdir}/speech-history-test.patch"
} }
build() { build() {
@@ -83,13 +86,20 @@ build() {
fi fi
} }
check() { check() (
cd "${pkgname}" cd "${pkgname}"
export CGO_ENABLED=1 export CGO_ENABLED=1
export GOPATH="${srcdir}/go" export GOPATH="${srcdir}/go"
export GOCACHE="${GOCACHE:-${srcdir}/go-build}" export GOCACHE="${GOCACHE:-${srcdir}/go-build}"
go test -tags brlapi ./... -count=1 # Keep activated services and runtime sockets away from the build desktop.
} local runtimeDir
runtimeDir=$(mktemp -d -t cthulhu-check.XXXXXXXX) || return 1
trap 'rm -rf -- "$runtimeDir"' EXIT
env -u DISPLAY -u WAYLAND_DISPLAY -u AT_SPI_BUS_ADDRESS \
-u DBUS_SESSION_BUS_ADDRESS -u DBUS_STARTER_ADDRESS -u DBUS_STARTER_BUS_TYPE \
XDG_RUNTIME_DIR="$runtimeDir" GOWORK=off \
dbus-run-session -- go test -tags brlapi ./... -count=1
)
package() { package() {
cd "${pkgname}" cd "${pkgname}"
@@ -0,0 +1,78 @@
diff --git a/internal/app/speech_history_test.go b/internal/app/speech_history_test.go
index d4eb637..d73811c 100644
--- a/internal/app/speech_history_test.go
+++ b/internal/app/speech_history_test.go
@@ -194,12 +194,18 @@ func TestRunRoutesSpeechHistoryCommands(t *testing.T) {
settings := config.DefaultSettings()
settings.EnableSpeech = false
settings.EnableSound = false
- commands := &fakeCommands{commands: make(chan input.CommandEvent, 3)}
+ // An unbuffered command waits for startup before timing callback delivery.
+ commands := &fakeCommands{commands: make(chan input.CommandEvent)}
called := make(chan input.Command, 2)
- done := make(chan error, 1)
+ ctx, cancel := context.WithCancel(t.Context())
+ done := make(chan struct{})
+ var runError error
go func() {
- done <- Run(context.Background(), Options{
+ defer close(done)
+ runError = Run(ctx, Options{
Logger: slog.New(slog.DiscardHandler), Settings: &settings,
+ newSound: func() soundService { return silentSound{} },
+ newSpeaker: func() Speaker { return &fakeSpeaker{} },
newCommands: func() commandListener { return commands },
newAdapter: func() Adapter { return &fakeAdapter{events: make(chan atspi.Event)} },
newInput: func() InputListener { return &fakeInputListener{events: make(chan input.Event)} },
@@ -207,24 +213,44 @@ func TestRunRoutesSpeechHistoryCommands(t *testing.T) {
onSpeechMonitor: func() { called <- input.ToggleSpeechMonitor },
})
}()
+ t.Cleanup(func() {
+ cancel()
+ select {
+ case <-done:
+ if runError != nil {
+ t.Errorf("Run: %v", runError)
+ }
+ case <-time.After(10 * time.Second):
+ t.Error("Run did not stop after cancellation")
+ }
+ })
+ sendCommand := func(command input.Command) {
+ t.Helper()
+ select {
+ case commands.commands <- input.CommandEvent{Command: command}:
+ case <-done:
+ t.Fatalf("Run stopped before accepting %s: %v", command, runError)
+ case <-time.After(10 * time.Second):
+ t.Fatalf("Run was not ready to accept %s", command)
+ }
+ }
for _, command := range []input.Command{input.ShowSpeechHistory, input.ToggleSpeechMonitor} {
- commands.commands <- input.CommandEvent{Command: command}
+ sendCommand(command)
select {
case got := <-called:
if got != command {
t.Fatalf("routed %s, want %s", got, command)
}
+ case <-done:
+ t.Fatalf("Run stopped while routing %s: %v", command, runError)
case <-time.After(time.Second):
t.Fatalf("command %s was not routed", command)
}
}
- commands.commands <- input.CommandEvent{Command: input.Quit}
+ sendCommand(input.Quit)
select {
- case err := <-done:
- if err != nil {
- t.Fatal(err)
- }
- case <-time.After(time.Second):
+ case <-done:
+ case <-time.After(10 * time.Second):
t.Fatal("quit was not handled")
}
}
+36 -10
View File
@@ -194,12 +194,18 @@ func TestRunRoutesSpeechHistoryCommands(t *testing.T) {
settings := config.DefaultSettings() settings := config.DefaultSettings()
settings.EnableSpeech = false settings.EnableSpeech = false
settings.EnableSound = false settings.EnableSound = false
commands := &fakeCommands{commands: make(chan input.CommandEvent, 3)} // An unbuffered command waits for startup before timing callback delivery.
commands := &fakeCommands{commands: make(chan input.CommandEvent)}
called := make(chan input.Command, 2) called := make(chan input.Command, 2)
done := make(chan error, 1) ctx, cancel := context.WithCancel(t.Context())
done := make(chan struct{})
var runError error
go func() { go func() {
done <- Run(context.Background(), Options{ defer close(done)
runError = Run(ctx, Options{
Logger: slog.New(slog.DiscardHandler), Settings: &settings, Logger: slog.New(slog.DiscardHandler), Settings: &settings,
newSound: func() soundService { return silentSound{} },
newSpeaker: func() Speaker { return &fakeSpeaker{} },
newCommands: func() commandListener { return commands }, newCommands: func() commandListener { return commands },
newAdapter: func() Adapter { return &fakeAdapter{events: make(chan atspi.Event)} }, newAdapter: func() Adapter { return &fakeAdapter{events: make(chan atspi.Event)} },
newInput: func() InputListener { return &fakeInputListener{events: make(chan input.Event)} }, newInput: func() InputListener { return &fakeInputListener{events: make(chan input.Event)} },
@@ -207,24 +213,44 @@ func TestRunRoutesSpeechHistoryCommands(t *testing.T) {
onSpeechMonitor: func() { called <- input.ToggleSpeechMonitor }, onSpeechMonitor: func() { called <- input.ToggleSpeechMonitor },
}) })
}() }()
t.Cleanup(func() {
cancel()
select {
case <-done:
if runError != nil {
t.Errorf("Run: %v", runError)
}
case <-time.After(10 * time.Second):
t.Error("Run did not stop after cancellation")
}
})
sendCommand := func(command input.Command) {
t.Helper()
select {
case commands.commands <- input.CommandEvent{Command: command}:
case <-done:
t.Fatalf("Run stopped before accepting %s: %v", command, runError)
case <-time.After(10 * time.Second):
t.Fatalf("Run was not ready to accept %s", command)
}
}
for _, command := range []input.Command{input.ShowSpeechHistory, input.ToggleSpeechMonitor} { for _, command := range []input.Command{input.ShowSpeechHistory, input.ToggleSpeechMonitor} {
commands.commands <- input.CommandEvent{Command: command} sendCommand(command)
select { select {
case got := <-called: case got := <-called:
if got != command { if got != command {
t.Fatalf("routed %s, want %s", got, command) t.Fatalf("routed %s, want %s", got, command)
} }
case <-done:
t.Fatalf("Run stopped while routing %s: %v", command, runError)
case <-time.After(time.Second): case <-time.After(time.Second):
t.Fatalf("command %s was not routed", command) t.Fatalf("command %s was not routed", command)
} }
} }
commands.commands <- input.CommandEvent{Command: input.Quit} sendCommand(input.Quit)
select { select {
case err := <-done: case <-done:
if err != nil { case <-time.After(10 * time.Second):
t.Fatal(err)
}
case <-time.After(time.Second):
t.Fatal("quit was not handled") t.Fatal("quit was not handled")
} }
} }
+2
View File
@@ -133,6 +133,8 @@ func TestQuickSettingsCategoriesReadingAndKeyboard(t *testing.T) {
applied = append(applied, next) applied = append(applied, next)
return nil return nil
})) }))
// Category navigation must not query the build machine's speech service.
worker.catalog = speech.Catalog{"": {{Name: "default", Language: "en"}}}
worker.live = &liveSettings{} worker.live = &liveSettings{}
worker.live.Store(settings) worker.live.Store(settings)
var messages []string var messages []string
+1 -1
View File
@@ -21,7 +21,7 @@ import "strings"
const Name = "Cthulhu" const Name = "Cthulhu"
const Version = "2026.11.16" const Version = "2026.11.17"
const Channel = "testing" const Channel = "testing"
var Build = Version var Build = Version
+51
View File
@@ -25,6 +25,57 @@ target.chmod(0o755)
class PackageBinaryTests(unittest.TestCase): class PackageBinaryTests(unittest.TestCase):
def test_checks_use_private_session_and_preserve_failure_status(self):
root = Path(__file__).resolve().parents[1]
recipes = sorted((root / "distro-packages").rglob("PKGBUILD"))
for recipe in recipes:
for exit_code in (0, 7):
with self.subTest(recipe=recipe.parent.name, exit_code=exit_code), \
tempfile.TemporaryDirectory() as tmp:
work = Path(tmp)
(work / "cthulhu").mkdir()
desktop_runtime = work / "desktop-runtime"
desktop_runtime.mkdir()
canary = desktop_runtime / "canary"
canary.write_text("preserve\n")
runtime_record = work / "test-runtime"
tools = work / "tools"
tools.mkdir()
go = tools / "go"
go.write_text('''#!/usr/bin/env python3
import os
from pathlib import Path
import stat
import sys
assert sys.argv[1:] == ["test", "-tags", "brlapi", "./...", "-count=1"]
assert os.environ["GOWORK"] == "off"
for name in ("DISPLAY", "WAYLAND_DISPLAY", "AT_SPI_BUS_ADDRESS",
"DBUS_STARTER_ADDRESS", "DBUS_STARTER_BUS_TYPE"):
assert name not in os.environ, name
assert os.environ["DBUS_SESSION_BUS_ADDRESS"] != "unix:path=/nonexistent-desktop-bus"
runtime = Path(os.environ["XDG_RUNTIME_DIR"])
assert runtime != Path(os.environ["DESKTOP_RUNTIME"])
assert stat.S_IMODE(runtime.stat().st_mode) == 0o700
Path(os.environ["RUNTIME_RECORD"]).write_text(str(runtime))
sys.exit(int(os.environ["CHECK_EXIT_CODE"]))
''')
go.chmod(0o755)
environment = dict(
os.environ, PATH=f"{tools}:{os.environ['PATH']}", srcdir=str(work),
XDG_RUNTIME_DIR=str(desktop_runtime), DESKTOP_RUNTIME=str(desktop_runtime),
DISPLAY=":9999", WAYLAND_DISPLAY="wayland-fixture",
AT_SPI_BUS_ADDRESS="unix:path=/nonexistent-atspi-bus",
DBUS_SESSION_BUS_ADDRESS="unix:path=/nonexistent-desktop-bus",
DBUS_STARTER_ADDRESS="unix:path=/nonexistent-starter-bus",
DBUS_STARTER_BUS_TYPE="session", GOWORK="/nonexistent/go.work",
RUNTIME_RECORD=str(runtime_record), CHECK_EXIT_CODE=str(exit_code))
result = subprocess.run(
["bash", "-ec", 'source "$1"\ncheck', "package-test", str(recipe)],
cwd=work, env=environment, capture_output=True, text=True, check=False)
self.assertEqual(result.returncode, exit_code, result.stderr)
self.assertFalse(Path(runtime_record.read_text()).exists())
self.assertEqual(canary.read_text(), "preserve\n")
def test_build_and_install_source_supported_helpers(self): def test_build_and_install_source_supported_helpers(self):
root = Path(__file__).resolve().parents[1] root = Path(__file__).resolve().parents[1]
recipes = sorted((root / "distro-packages").rglob("PKGBUILD")) recipes = sorted((root / "distro-packages").rglob("PKGBUILD"))