# Maintainer: Valeria Fadeeva <valeria@fadeeva.me>

_gitname="RoundedSBE"
pkgname=("roundedsbe")
pkgver=1.232
pkgrel=1
pkgdesc="A fork of SierraBreezeEnhanced with integrated corner rounding effect CornersShader (reworked version of what used to be called LightlyShaders) and shared configuration"
arch=("i686" "x86_64")
url="https://github.com/a-parhom/RoundedSBE"
license=("GPL3")

depends=(kwin kdecoration)

makedepends=(git make cmake gcc gettext extra-cmake-modules qt5-tools kcrash kglobalaccel kde-dev-utils kio knotifications kinit kwin kdecoration qt5-declarative qt5-x11extras)

optdepends=()

backup=()
provides=("${pkgname}")
conflicts=("${pkgname}")
options=(!strip !emptydirs)
source=("git+$url.git")
sha256sums=("SKIP")
validpgpkeys=("95F48000540A4DB146583A47C49B5E77FD80302D")

# pkgver() {
#       cd "$srcdir/$_gitname"
#       printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
# }

pkgver() {
        cd "${srcdir}/${_gitname}"
        printf "1.%s" "$(git rev-list --count HEAD)"
}

build() {
  rm -rf "${_gitname}/build/*"

  mkdir -p "${_gitname}/build"

  cmake -B "${_gitname}/build" -S "${_gitname}" \
      -DCMAKE_INSTALL_PREFIX=/usr \
      -DCMAKE_BUILD_TYPE=Debug \
      -DBUILD_TESTING=ON \
      -DKDE_INSTALL_USE_QT_SYS_PATHS=ON

  export DESTDIR="${_gitname}/build"
  make -j $(nproc) -C "${_gitname}/build"
}



package() {
  make -C "${srcdir}/${_gitname}/build" DESTDIR="${pkgdir}" install
}
