From 36733cfb75f49d31f4b419ce35eac3b73edfade0 Mon Sep 17 00:00:00 2001 From: komaruworld Date: Wed, 12 Aug 2026 13:31:15 +0300 Subject: [PATCH] make better pkgbuild thx strz --- packaging/aur/mocktail-git/.SRCINFO | 5 +---- packaging/aur/mocktail-git/PKGBUILD | 14 +++++--------- packaging/aur/mocktail/.SRCINFO | 7 ++----- packaging/aur/mocktail/PKGBUILD | 16 ++++++---------- tests/native_packaging_test.sh | 13 +++++++++++++ 5 files changed, 27 insertions(+), 28 deletions(-) diff --git a/packaging/aur/mocktail-git/.SRCINFO b/packaging/aur/mocktail-git/.SRCINFO index 74e753a..5745fff 100644 --- a/packaging/aur/mocktail-git/.SRCINFO +++ b/packaging/aur/mocktail-git/.SRCINFO @@ -10,6 +10,7 @@ pkgbase = mocktail-git makedepends = ninja makedepends = nlohmann-json makedepends = pkgconf + makedepends = vulkan-headers depends = capstone depends = curl depends = fontconfig @@ -38,10 +39,6 @@ pkgbase = mocktail-git conflicts = mocktail-bin options = !debug source = mocktail::git+https://github.com/komaruworld/mocktail.git#branch=main - source = libjnivm::git+https://github.com/ChristopherHX/libjnivm.git - source = vulkan-headers::git+https://github.com/KhronosGroup/Vulkan-Headers.git - sha256sums = SKIP - sha256sums = SKIP sha256sums = SKIP pkgname = mocktail-git diff --git a/packaging/aur/mocktail-git/PKGBUILD b/packaging/aur/mocktail-git/PKGBUILD index add62bd..ef5d4d2 100644 --- a/packaging/aur/mocktail-git/PKGBUILD +++ b/packaging/aur/mocktail-git/PKGBUILD @@ -37,6 +37,7 @@ makedepends=( 'ninja' 'nlohmann-json' 'pkgconf' + 'vulkan-headers' ) optdepends=('gamemode: Feral GameMode integration') provides=('mocktail') @@ -44,13 +45,9 @@ conflicts=('mocktail' 'mocktail-bin') options=('!debug') source=( 'mocktail::git+https://github.com/komaruworld/mocktail.git#branch=main' - 'libjnivm::git+https://github.com/ChristopherHX/libjnivm.git' - 'vulkan-headers::git+https://github.com/KhronosGroup/Vulkan-Headers.git' ) sha256sums=( 'SKIP' - 'SKIP' - 'SKIP' ) pkgver() { @@ -69,11 +66,9 @@ pkgver() { prepare() { cd mocktail - git submodule init - git config submodule.third_party/libjnivm.url "${srcdir}/libjnivm" - git config submodule.third_party/Vulkan-Headers.url \ - "${srcdir}/vulkan-headers" - git -c protocol.file.allow=always submodule update + sed -i \ + 's|add_subdirectory(third_party/Vulkan-Headers EXCLUDE_FROM_ALL)|find_package(VulkanHeaders CONFIG REQUIRED)|' \ + CMakeLists.txt } build() { @@ -83,6 +78,7 @@ build() { -DCMAKE_INSTALL_LIBDIR=lib \ -DMOCKTAIL_DEFAULT_COMPATIBILITY_MANIFEST=/usr/share/mocktail/metadata/roblox_compatibility.json \ -DMOCKTAIL_DEFAULT_SIGNING_TRUST_MANIFEST=/usr/share/mocktail/metadata/roblox_signing_certificates.json \ + -DMOCKTAIL_ENABLE_UPSTREAM_JNIVM=OFF \ -DBUILD_TESTING=OFF cmake --build build } diff --git a/packaging/aur/mocktail/.SRCINFO b/packaging/aur/mocktail/.SRCINFO index 5ccfd30..ed81ce3 100644 --- a/packaging/aur/mocktail/.SRCINFO +++ b/packaging/aur/mocktail/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = mocktail pkgdesc = Android x86-64 Roblox compatibility runtime for Linux pkgver = 0.1.0 - pkgrel = 1 + pkgrel = 2 url = https://github.com/komaruworld/mocktail arch = x86_64 license = Apache-2.0 @@ -10,6 +10,7 @@ pkgbase = mocktail makedepends = ninja makedepends = nlohmann-json makedepends = pkgconf + makedepends = vulkan-headers depends = capstone depends = curl depends = fontconfig @@ -37,10 +38,6 @@ pkgbase = mocktail conflicts = mocktail-git options = !debug source = mocktail::git+https://github.com/komaruworld/mocktail.git#tag=0.1.0 - source = libjnivm::git+https://github.com/ChristopherHX/libjnivm.git - source = vulkan-headers::git+https://github.com/KhronosGroup/Vulkan-Headers.git - sha256sums = SKIP - sha256sums = SKIP sha256sums = SKIP pkgname = mocktail diff --git a/packaging/aur/mocktail/PKGBUILD b/packaging/aur/mocktail/PKGBUILD index f699981..9ba3186 100644 --- a/packaging/aur/mocktail/PKGBUILD +++ b/packaging/aur/mocktail/PKGBUILD @@ -2,7 +2,7 @@ pkgname=mocktail pkgver=0.1.0 -pkgrel=1 +pkgrel=2 pkgdesc='Android x86-64 Roblox compatibility runtime for Linux' arch=('x86_64') url='https://github.com/komaruworld/mocktail' @@ -37,29 +37,24 @@ makedepends=( 'ninja' 'nlohmann-json' 'pkgconf' + 'vulkan-headers' ) optdepends=('gamemode: Feral GameMode integration') conflicts=('mocktail-bin' 'mocktail-git') options=('!debug') source=( "mocktail::git+https://github.com/komaruworld/mocktail.git#tag=${pkgver}" - 'libjnivm::git+https://github.com/ChristopherHX/libjnivm.git' - 'vulkan-headers::git+https://github.com/KhronosGroup/Vulkan-Headers.git' ) sha256sums=( 'SKIP' - 'SKIP' - 'SKIP' ) prepare() { cd mocktail - git submodule init - git config submodule.third_party/libjnivm.url "${srcdir}/libjnivm" - git config submodule.third_party/Vulkan-Headers.url \ - "${srcdir}/vulkan-headers" - git -c protocol.file.allow=always submodule update + sed -i \ + 's|add_subdirectory(third_party/Vulkan-Headers EXCLUDE_FROM_ALL)|find_package(VulkanHeaders CONFIG REQUIRED)|' \ + CMakeLists.txt } build() { @@ -69,6 +64,7 @@ build() { -DCMAKE_INSTALL_LIBDIR=lib \ -DMOCKTAIL_DEFAULT_COMPATIBILITY_MANIFEST=/usr/share/mocktail/metadata/roblox_compatibility.json \ -DMOCKTAIL_DEFAULT_SIGNING_TRUST_MANIFEST=/usr/share/mocktail/metadata/roblox_signing_certificates.json \ + -DMOCKTAIL_ENABLE_UPSTREAM_JNIVM=OFF \ -DBUILD_TESTING=OFF cmake --build build } diff --git a/tests/native_packaging_test.sh b/tests/native_packaging_test.sh index a61df26..e7a1280 100755 --- a/tests/native_packaging_test.sh +++ b/tests/native_packaging_test.sh @@ -46,6 +46,8 @@ grep -Fq 'pkgname=mocktail' "${AUR_STABLE_PKGBUILD}" || Fail 'AUR source package name is not stable' grep -Fq '#tag=${pkgver}' "${AUR_STABLE_PKGBUILD}" || Fail 'AUR source package does not pin its Git tag' +grep -Fq "'vulkan-headers'" "${AUR_STABLE_PKGBUILD}" || + Fail 'AUR source package does not use the packaged Vulkan headers' grep -Fq 'pkgbase = mocktail' "${AUR_STABLE_SRCINFO}" || Fail 'AUR source package has no generated .SRCINFO metadata' grep -Fq 'pkgname=mocktail-bin' "${AUR_BIN_PKGBUILD}" || @@ -58,6 +60,17 @@ grep -Fq -- \ Fail 'AUR package does not build from the upstream Git repository' grep -Fq "provides=('mocktail')" "${AUR_PKGBUILD}" || Fail 'AUR VCS package does not provide the stable package name' +grep -Fq "'vulkan-headers'" "${AUR_PKGBUILD}" || + Fail 'AUR VCS package does not use the packaged Vulkan headers' +for aur_pkgbuild in "${AUR_STABLE_PKGBUILD}" "${AUR_PKGBUILD}"; do + if grep -Eq \ + 'libjnivm::git\+|vulkan-headers::git\+|git submodule (init|update)' \ + "${aur_pkgbuild}"; then + Fail "AUR package downloads build-only submodules: ${aur_pkgbuild}" + fi + grep -Fq -- '-DMOCKTAIL_ENABLE_UPSTREAM_JNIVM=OFF' "${aur_pkgbuild}" || + Fail "AUR package enables the unused upstream JNI test library: ${aur_pkgbuild}" +done grep -Fq -- \ '-DMOCKTAIL_DEFAULT_COMPATIBILITY_MANIFEST=/usr/share/mocktail/metadata/' \ "${AUR_PKGBUILD}" ||