Files
VoiceStudio/tests/test_aur_package.py
T
Palash Debnath 5bfbda3688 feat(packaging): add voicestudio-git for Arch Linux (#3771)
* feat(packaging): add an Arch Linux development source package

* fix(ci): check first-run setup for the Arch source package

* fix(packaging): resolve Arch compiler flags and SSH URL validation

* fix(packaging): avoid incompatible GCC LTO in the Rust helper

* fix(packaging): align the Arch launcher with Electron app identity

* docs: point app licensing proposals at checkout release gates
2026-11-02 21:07:38 +05:30

29 lines
1.1 KiB
Python

"""Arch launchers must identify the same app as Electron's canonical brand."""
import json
import re
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def _desktop_entry():
recipe = (ROOT / "packaging/aur/voicestudio-git/PKGBUILD").read_text(encoding="utf-8")
match = re.search(r"applications/([^\"]+)[^\n]*<<'EOF'\n(.*?)\nEOF", recipe, re.S)
assert match, "Missing installed desktop entry"
fields = dict(line.split("=", 1) for line in match[2].splitlines() if "=" in line)
return match[1], fields
def test_desktop_entry_matches_app_identity():
name = json.loads((ROOT / "config/app.json").read_text(encoding="utf-8"))["productName"]
filename, fields = _desktop_entry()
assert filename == f"{name}.desktop"
assert fields["Name"] == name
assert fields["StartupWMClass"] == name
def test_ci_validates_the_installed_desktop_entry():
filename, _ = _desktop_entry()
workflow = (ROOT / ".github/workflows/aur-package.yml").read_text(encoding="utf-8")
assert f"desktop-file-validate pkg/voicestudio-git/usr/share/applications/{filename}" in workflow