# Maintainer: Vladislav Nepogodin <nepogodin.vlad@gmail.com>

pkgname=cachyos-packageinstaller
pkgver=1.1.0
pkgrel=1
pkgdesc="Simple Software Application Package Installer for CachyOS which helps setting up & installing applications"
arch=(aarch64 x86_64 x86_64_v3)
url="https://github.com/cachyos/packageinstaller"
license=(GPLv3)
depends=('qt5-base' 'polkit')
makedepends=('cmake' 'ninja' 'git' 'polkit-qt5' 'qt5-tools')
groups=('cachyos')
source=("packageinstaller-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('5af2e10b7889b51a77ae5e578d20f8fe0eb2f1d9017746102c4288a3f991a399')
provides=('cachyos-packageinstaller')
conflicts=('cachyos-packageinstaller')
options=(strip)

build() {
  cd ${srcdir}/packageinstaller-${pkgver}

  _cpuCount=$(grep -c -w ^processor /proc/cpuinfo)

  cmake -S . -Bbuild \
        -GNinja \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_INSTALL_LIBDIR=lib
  cmake --build build --parallel $_cpuCount
}

package() {
  cd ${srcdir}/packageinstaller-${pkgver}
  DESTDIR="${pkgdir}" cmake --build build --target install

  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

# vim:set sw=2 sts=2 et:
