File PKGBUILD of Package alpm_octopi_utils
# Maintainer: James Ed Randson <jimedrand@disroot.org>
# Contributor: Mark Wagie <mark dot wagie at proton dot me>
# Contributor: MatMoul <matmoul at the google email domain which is .com>
pkgname="alpm_octopi_utils"
pkgver=master
pkgrel=1
pkgdesc="ALPM utilities library for Octopi"
url="https://github.com/aarnt/alpm_octopi_utils"
license=('GPL-2.0-or-later')
arch=('x86_64')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/aarnt/alpm_octopi_utils/archive/refs/heads/${pkgver}.tar.gz")
sha256sums=('SKIP')
depends=('pacman' 'glib2' 'bubblewrap')
makedepends=('cmake' 'ninja' 'vala' 'pkgconf')
prepare() {
cd "$pkgname-$pkgver"
# Fix potential Vala version detection issues
if [ -f "cmake/FindVala.cmake" ]; then
# Patch FindVala.cmake to handle empty version strings
sed -i 's/string(STRIP \${VALA_VERSION} VALA_VERSION)/if(VALA_VERSION)\n string(STRIP "${VALA_VERSION}" VALA_VERSION)\nendif()/' cmake/FindVala.cmake || true
fi
}
build() {
# Set Vala version explicitly to avoid detection issues
export VALA_VERSION=$(vala --version 2>/dev/null | cut -d' ' -f2 || echo "0.56.0")
local _cmake_options=(
-B build
-S "$pkgname-$pkgver"
-G Ninja
-DCMAKE_BUILD_TYPE=None
-DCMAKE_INSTALL_PREFIX='/usr'
-DCMAKE_VERBOSE_MAKEFILE=ON
-Wno-dev
)
cmake "${_cmake_options[@]}"
cmake --build build
}
package() {
DESTDIR="$pkgdir" cmake --install build
rm -rf "$pkgdir/usr/share/licenses/"
}