# 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.22
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')
source=("https://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz")
sha256sums=('1821c0a92b66f6e246270e379e717d6080a5607eefb8e459506767afd70c9a26')

build() {
  cd $pkgname-$pkgver
  python setup.py build
}

package() {
  cd $pkgname-$pkgver
  export PYTHONHASHSEED=0 
  python setup.py install --root="$pkgdir" --optimize=1 --skip-build

  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
}
