# Maintainer: FWS <dami.scoot3@gmail.com>
pkgname=fws-diskcleaner
pkgver=$(tr -d '[:space:]' < version)
pkgrel=1
pkgdesc='Visual disk usage analyzer with a treemap view'
arch=('x86_64')
license=('custom')
depends=('qt6-base')
makedepends=('cmake' 'gcc')

# The release workflow builds this tarball with `git archive` next to the
# PKGBUILD, so the source is local and has no upstream checksum to verify.
source=("$pkgname-$pkgver.tar.gz")
sha256sums=('SKIP')

build() {
  cd "$pkgname-$pkgver"
  cmake -B build -S . \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr
  cmake --build build
}

check() {
  cd "$pkgname-$pkgver"
  ctest --test-dir build --output-on-failure
}

package() {
  DESTDIR="$pkgdir" cmake --install "$pkgname-$pkgver/build"
}
