# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: SanskritFritz (gmail)
# Contributor: Eugenio M. Vigo <emvigo@gmail.com>
# Contributor: FadeMind <fademind@gmail.com>
# Contributor: Dmitry Korzhevin <dkorzhevin at gmail dot com>
# Contributor: 4javier <4javier4@gmail.com>
# Contributor: G_Syme <demichan(at)mail(dot)upb(dot)de>
# Contributor: cameel <cameel2/gmail/com>
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>

pkgname=rednotebook
pkgver=2.39
pkgrel=1
pkgdesc='Modern desktop diary and personal journaling tool that lets you format, tag and search your entries'
arch=('any')
url='https://rednotebook.sourceforge.io/'
license=('GPL')
depends=('gtksourceview3' 'python-gobject' 'python-pyenchant' 'python-yaml' 'webkit2gtk-4.1')
makedepends=('python-build' 'python-installer' 'python-setuptools')
source=("https://github.com/jendrikseipp/rednotebook/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha256sums=('c84a25af4cbbb9db7971fbb0ba0120452f7d779a5cbfd2bcd4dee7e8dcc306ee')

build() {
  cd $pkgname-$pkgver
  python -m build --wheel --no-isolation
}

package() {
  cd $pkgname-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl

  for _res in 16 22 32 48 64 128 192 256; do
    install -Dm644 rednotebook/images/rednotebook-icon/rn-$_res.png \
      "$pkgdir/usr/share/icons/hicolor/${_res}x${_res}/apps/$pkgname.png"
  done
}
