Fixed some packaging problems.

This commit is contained in:
Storm Dragon
2026-09-03 14:54:04 -04:00
parent e779ba20ff
commit d4bec38c18
10 changed files with 55 additions and 41 deletions
+34 -22
View File
@@ -46,26 +46,21 @@ class ArchPkgbuildOptionalWineTests(unittest.TestCase):
}
self.assertNotIn("wine", dependencyLines)
def test_main_packages_advertise_matching_optional_helper(self) -> None:
stableContents = self.pkgbuilds[0].read_text(encoding="utf-8")
self.assertIn(
"'cthulhu-wine-access: Wine, Proton, NVDA Controller, and Tolk integration'",
self._array_contents(stableContents, "optdepends_x86_64"),
)
self.assertNotIn(
"cthulhu-wine-access",
self._array_contents(stableContents, "optdepends"),
)
gitContents = self.pkgbuilds[1].read_text(encoding="utf-8")
self.assertIn(
"'cthulhu-wine-access-git: Wine, Proton, NVDA Controller, and Tolk integration'",
self._array_contents(gitContents, "optdepends_x86_64"),
)
self.assertNotIn(
"cthulhu-wine-access-git",
self._array_contents(gitContents, "optdepends"),
def test_main_packages_advertise_interchangeable_optional_helper(self) -> None:
helperDescription = (
"'cthulhu-wine-access: Wine, Proton, NVDA Controller, and Tolk integration'"
)
for pkgbuild in self.pkgbuilds:
with self.subTest(pkgbuild=pkgbuild):
contents = pkgbuild.read_text(encoding="utf-8")
self.assertIn(
helperDescription,
self._array_contents(contents, "optdepends_x86_64"),
)
self.assertNotIn(
"cthulhu-wine-access",
self._array_contents(contents, "optdepends"),
)
def test_stable_packages_use_current_release_version(self) -> None:
for pkgbuild in (self.pkgbuilds[0], self.helperPkgbuilds[0]):
@@ -105,14 +100,31 @@ class ArchPkgbuildOptionalWineTests(unittest.TestCase):
def test_stable_helper_has_release_contract(self) -> None:
contents = self.helperPkgbuilds[0].read_text(encoding="utf-8")
self.assertRegex(contents, r"(?m)^arch=\(x86_64\)$")
self.assertRegex(contents, r'(?m)^ "cthulhu=\$\{pkgver\}"$')
def test_optional_helper_packages_own_the_wine_dependency(self) -> None:
def test_optional_helpers_do_not_depend_on_main_package(self) -> None:
for pkgbuild in self.helperPkgbuilds:
with self.subTest(pkgbuild=pkgbuild):
contents = pkgbuild.read_text(encoding="utf-8")
self.assertIn("-Dwine-access=enabled", contents)
dependencies = self._array_contents(contents, "depends")
self.assertNotRegex(
dependencies,
r"(?m)^\s*['\"]?cthulhu(?:-git)?(?:[<>=].*)?['\"]?\s*$",
)
def test_git_helper_provides_stable_helper_name(self) -> None:
contents = self.helperPkgbuilds[1].read_text(encoding="utf-8")
self.assertRegex(contents, r"(?m)^provides=\(cthulhu-wine-access\)$")
self.assertRegex(contents, r"(?m)^conflicts=\(cthulhu-wine-access\)$")
def test_optional_helper_packages_build_only_the_helper(self) -> None:
for pkgbuild in self.helperPkgbuilds:
with self.subTest(pkgbuild=pkgbuild):
contents = pkgbuild.read_text(encoding="utf-8")
self.assertIn('/scripts/build-wine-access.sh"', contents)
self.assertNotIn("arch-meson", contents)
self.assertRegex(contents, r"(?m)^ wine$")
makeDependencies = self._array_contents(contents, "makedepends")
self.assertNotRegex(makeDependencies, r"(?m)^\s*meson\s*$")
def test_optional_helper_packages_disable_lto(self) -> None:
for pkgbuild in self.helperPkgbuilds: