# Maintainer: Brody <archfan at brodix dot de>
# Contributor: Zhang.j.k <zhangjk67 at gmail dian com>

pkgname=konsave
pkgver=2.3.0
pkgrel=1
pkgdesc='Save and apply your KDE Plasma customizations with just one command!'
url=https://github.com/Prayag2/konsave
depends=(
  python-pyaml
  python-setuptools
)
makedepends=(
  python-build
  python-installer
  python-setuptools-scm
  python-wheel
)
license=(GPL-3.0-or-later)
arch=(any)
source=(${pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz)
sha512sums=('b4177024fdc93fd0f9651834bb58a94007762e786363e06b9d605c92d70c95b675553bcc493f7ab2e98bd111e9ee1e5f96bae3f9918006620ff1b7a9ef1ac16c')

build() {
  export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}

  cd ${pkgname}-${pkgver}

  python -m build \
    --wheel \
    --no-isolation
}

package() {
  cd ${pkgname}-${pkgver}

  python -m installer \
    --destdir="${pkgdir}" \
    dist/*.whl

  # Copying configuration files
  local _python_folder
  _python_folder=$(python -c 'import site; print(site.getsitepackages()[0])')

  install -Dm644 -t "${pkgdir}"/${_python_folder}/${pkgname} \
    konsave/conf_{kde,other}.yaml
}

# vim: ts=2 sw=2 et:
