Split the wine helper into it's own package.
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
# shellcheck shell=bash disable=SC2034,SC2154,SC2164
|
||||
|
||||
pkgbase=cthulhu-git
|
||||
pkgname=(cthulhu-git cthulhu-wine-access-git)
|
||||
pkgname=cthulhu-git
|
||||
_pkgname=cthulhu
|
||||
pkgver=2026.05.25.r423.g0576b6f
|
||||
pkgrel=2
|
||||
pkgver=2026.07.18.r465.g050ae25
|
||||
pkgrel=1
|
||||
pkgdesc="Desktop-agnostic screen reader with plugin system, forked from Orca"
|
||||
url="https://git.stormux.org/storm/cthulhu"
|
||||
arch=(x86_64 aarch64 armv7h)
|
||||
@@ -73,10 +73,6 @@ makedepends=(
|
||||
git
|
||||
meson
|
||||
)
|
||||
makedepends_x86_64=(
|
||||
cmake
|
||||
wine
|
||||
)
|
||||
source=("${_pkgname}::git+https://git.stormux.org/storm/${_pkgname}.git#branch=master")
|
||||
sha512sums=('SKIP')
|
||||
|
||||
@@ -96,35 +92,19 @@ pkgver() {
|
||||
|
||||
build() {
|
||||
cd "${_pkgname}"
|
||||
arch-meson _build
|
||||
arch-meson _build -Dwine-access=disabled
|
||||
meson compile -C _build
|
||||
}
|
||||
|
||||
package_cthulhu-git() {
|
||||
package() {
|
||||
arch=(any)
|
||||
provides=("cthulhu=${pkgver}")
|
||||
conflicts=(cthulhu)
|
||||
cd "${_pkgname}"
|
||||
meson install -C _build --destdir "$pkgdir"
|
||||
|
||||
rm -rf "$pkgdir/usr/libexec/cthulhu/wine"
|
||||
|
||||
# Remove icon cache - it will be generated by post-install hooks
|
||||
rm -f "$pkgdir/usr/share/icons/hicolor/icon-theme.cache"
|
||||
}
|
||||
|
||||
package_cthulhu-wine-access-git() {
|
||||
pkgdesc="Wine and Proton accessibility bridge for Cthulhu"
|
||||
arch=(x86_64)
|
||||
depends=("cthulhu-git=${pkgver}" glib2 wine)
|
||||
provides=(cthulhu-wine-access)
|
||||
conflicts=(cthulhu-wine-access)
|
||||
|
||||
cd "${_pkgname}"
|
||||
install -Dm755 _build/cthulhu-wine-access.exe \
|
||||
"$pkgdir/usr/libexec/cthulhu/wine/cthulhu-wine-access.exe"
|
||||
install -Dm755 _build/cthulhu-wine-access.exe.so \
|
||||
"$pkgdir/usr/libexec/cthulhu/wine/cthulhu-wine-access.exe.so"
|
||||
}
|
||||
|
||||
# vim:set sw=2 sts=-1 et:
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
# Maintainer: Storm Dragon <storm_dragon@stormux.org>
|
||||
# shellcheck shell=bash disable=SC2034,SC2154,SC2164
|
||||
|
||||
pkgname=cthulhu-wine-access-git
|
||||
_pkgname=cthulhu
|
||||
pkgver=2026.07.18.r465.g050ae25
|
||||
pkgrel=1
|
||||
pkgdesc="Optional Wine and Proton accessibility bridge for Cthulhu"
|
||||
url="https://git.stormux.org/storm/cthulhu"
|
||||
arch=(x86_64)
|
||||
license=(LGPL-2.1-or-later)
|
||||
depends=(
|
||||
"cthulhu-git=${pkgver}"
|
||||
glib2
|
||||
wine
|
||||
)
|
||||
makedepends=(
|
||||
cmake
|
||||
git
|
||||
meson
|
||||
)
|
||||
provides=(cthulhu-wine-access)
|
||||
conflicts=(cthulhu-wine-access)
|
||||
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/^[[:space:]]*version: '\([^']*\)'.*/\1/p" meson.build)
|
||||
projectVersion=${projectVersion%-master}
|
||||
projectVersion=${projectVersion//-/.}
|
||||
[[ -n "${projectVersion}" ]] || return 1
|
||||
|
||||
revisionCount=$(git rev-list --count HEAD)
|
||||
commitHash=$(git rev-parse --short=7 HEAD)
|
||||
printf "%s.r%s.g%s\n" "${projectVersion}" "${revisionCount}" "${commitHash}"
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "${_pkgname}"
|
||||
arch-meson _build -Dwine-access=enabled
|
||||
meson compile -C _build
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "${_pkgname}"
|
||||
install -Dm755 _build/cthulhu-wine-access.exe \
|
||||
"$pkgdir/usr/libexec/cthulhu/wine/cthulhu-wine-access.exe"
|
||||
install -Dm755 _build/cthulhu-wine-access.exe.so \
|
||||
"$pkgdir/usr/libexec/cthulhu/wine/cthulhu-wine-access.exe.so"
|
||||
}
|
||||
|
||||
# vim:set sw=2 sts=-1 et:
|
||||
@@ -0,0 +1,37 @@
|
||||
# Maintainer: Storm Dragon <storm_dragon@stormux.org>
|
||||
# shellcheck shell=bash disable=SC2034,SC2154,SC2164
|
||||
|
||||
pkgname=cthulhu-wine-access
|
||||
pkgver=2026.07.18
|
||||
pkgrel=1
|
||||
pkgdesc="Optional Wine and Proton accessibility bridge for Cthulhu"
|
||||
url="https://git.stormux.org/storm/cthulhu"
|
||||
arch=(x86_64)
|
||||
license=(LGPL-2.1-or-later)
|
||||
depends=(
|
||||
"cthulhu=${pkgver}"
|
||||
glib2
|
||||
wine
|
||||
)
|
||||
makedepends=(
|
||||
cmake
|
||||
meson
|
||||
)
|
||||
source=("git+https://git.stormux.org/storm/cthulhu.git#tag=${pkgver}")
|
||||
sha512sums=('SKIP')
|
||||
|
||||
build() {
|
||||
cd cthulhu
|
||||
arch-meson _build -Dwine-access=enabled
|
||||
meson compile -C _build
|
||||
}
|
||||
|
||||
package() {
|
||||
cd cthulhu
|
||||
install -Dm755 _build/cthulhu-wine-access.exe \
|
||||
"$pkgdir/usr/libexec/cthulhu/wine/cthulhu-wine-access.exe"
|
||||
install -Dm755 _build/cthulhu-wine-access.exe.so \
|
||||
"$pkgdir/usr/libexec/cthulhu/wine/cthulhu-wine-access.exe.so"
|
||||
}
|
||||
|
||||
# vim:set sw=2 sts=-1 et:
|
||||
@@ -2,7 +2,7 @@
|
||||
# shellcheck shell=bash disable=SC2034,SC2154,SC2164
|
||||
|
||||
pkgbase=cthulhu
|
||||
pkgname=(cthulhu cthulhu-wine-access)
|
||||
pkgname=cthulhu
|
||||
pkgver=2026.07.18
|
||||
pkgrel=1
|
||||
pkgdesc="Desktop-agnostic screen reader with plugin system, forked from Orca"
|
||||
@@ -70,44 +70,24 @@ makedepends=(
|
||||
git
|
||||
meson
|
||||
)
|
||||
makedepends_x86_64=(
|
||||
cmake
|
||||
wine
|
||||
)
|
||||
source=("git+https://git.stormux.org/storm/cthulhu.git#tag=${pkgver}")
|
||||
sha512sums=('SKIP')
|
||||
|
||||
build() {
|
||||
cd cthulhu
|
||||
arch-meson _build
|
||||
arch-meson _build -Dwine-access=disabled
|
||||
meson compile -C _build
|
||||
}
|
||||
|
||||
package_cthulhu() {
|
||||
package() {
|
||||
arch=(any)
|
||||
provides=("cthulhu=${pkgver}")
|
||||
conflicts=(cthulhu)
|
||||
cd cthulhu
|
||||
meson install -C _build --destdir "$pkgdir"
|
||||
|
||||
rm -rf "$pkgdir/usr/libexec/cthulhu/wine"
|
||||
|
||||
# Remove icon cache - it will be generated by post-install hooks
|
||||
rm -f "$pkgdir/usr/share/icons/hicolor/icon-theme.cache"
|
||||
}
|
||||
|
||||
package_cthulhu-wine-access() {
|
||||
pkgdesc="Wine and Proton accessibility bridge for Cthulhu"
|
||||
arch=(x86_64)
|
||||
depends=("cthulhu=${pkgver}" glib2 wine)
|
||||
provides=(cthulhu-wine-access)
|
||||
conflicts=(cthulhu-wine-access)
|
||||
|
||||
cd cthulhu
|
||||
install -Dm755 _build/cthulhu-wine-access.exe \
|
||||
"$pkgdir/usr/libexec/cthulhu/wine/cthulhu-wine-access.exe"
|
||||
install -Dm755 _build/cthulhu-wine-access.exe.so \
|
||||
"$pkgdir/usr/libexec/cthulhu/wine/cthulhu-wine-access.exe.so"
|
||||
}
|
||||
|
||||
# vim:set sw=2 sts=-1 et:
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
class ArchPkgbuildOptionalWineTests(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
repository = Path(__file__).resolve().parents[1]
|
||||
cls.pkgbuilds = [
|
||||
repository / "distro-packages" / "Arch-Linux" / name / "PKGBUILD"
|
||||
for name in ("cthulhu", "cthulhu-git")
|
||||
]
|
||||
cls.helperPkgbuilds = [
|
||||
repository / "distro-packages" / "Arch-Linux" / name / "PKGBUILD"
|
||||
for name in ("cthulhu-wine-access", "cthulhu-wine-access-git")
|
||||
]
|
||||
|
||||
def test_main_packages_disable_wine_helper_build(self):
|
||||
for pkgbuild in self.pkgbuilds:
|
||||
with self.subTest(pkgbuild=pkgbuild):
|
||||
contents = pkgbuild.read_text(encoding="utf-8")
|
||||
self.assertIn("-Dwine-access=disabled", contents)
|
||||
|
||||
def test_main_packages_do_not_depend_on_wine(self):
|
||||
for pkgbuild in self.pkgbuilds:
|
||||
with self.subTest(pkgbuild=pkgbuild):
|
||||
contents = pkgbuild.read_text(encoding="utf-8")
|
||||
dependencySection = contents.split("source=(", 1)[0]
|
||||
dependencyLines = {
|
||||
line.strip().strip("'")
|
||||
for line in dependencySection.splitlines()
|
||||
if line.strip() and not line.lstrip().startswith("#")
|
||||
}
|
||||
self.assertNotIn("wine", dependencyLines)
|
||||
|
||||
def test_optional_helper_packages_own_the_wine_dependency(self):
|
||||
for pkgbuild in self.helperPkgbuilds:
|
||||
with self.subTest(pkgbuild=pkgbuild):
|
||||
contents = pkgbuild.read_text(encoding="utf-8")
|
||||
self.assertIn("-Dwine-access=enabled", contents)
|
||||
self.assertRegex(contents, r"(?m)^ wine$")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -5,6 +5,18 @@ from cthulhu.wine_access_manager import PrefixProcess, WineAccessManager
|
||||
|
||||
|
||||
class WineAccessManagerTest(unittest.TestCase):
|
||||
@mock.patch.object(WineAccessManager, "_find_helper", return_value=None)
|
||||
@mock.patch.object(WineAccessManager, "discover_prefixes")
|
||||
def test_poll_without_installed_helper_is_a_no_op(
|
||||
self, discover_prefixes, _find_helper
|
||||
):
|
||||
manager = WineAccessManager(helperPath=None)
|
||||
|
||||
self.assertIsNone(manager.helperPath)
|
||||
self.assertTrue(manager.poll())
|
||||
discover_prefixes.assert_not_called()
|
||||
self.assertEqual(manager.prefixes, {})
|
||||
|
||||
def test_prefix_prefers_explicit_wineprefix(self):
|
||||
environment = {
|
||||
"WINEPREFIX": "/tmp/custom-prefix",
|
||||
|
||||
Reference in New Issue
Block a user