# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: NicoHood <archlinux {cat} nicohood {dog} de>
# Contributor: Matthew Sexton <wsdmatty (at) _gmail_ (dot) _com_>

pkgname=notes-up
pkgver=2.0.2
pkgrel=4
pkgdesc='Write beautiful notes fast and easy using Markdown'
arch=('x86_64')
url='https://github.com/Philip-Scott/Notes-up'
license=('GPL')
depends=('discount' 'granite' 'gtksourceview3' 'gtkspell3' 'webkit2gtk')
makedepends=('cmake' 'ninja' 'vala')
source=("https://github.com/Philip-Scott/Notes-up/archive/$pkgver/Notes-up-$pkgver.tar.gz"
        'fix-build.patch'
        '0001-Add-missing-icon.patch')
sha256sums=('35eb1df71034a118e66e6e00f5394c68423cfba7ceac035bde156d77da933b17'
            'a0187a27ddf8a2203da65c63eff62c3dcd0beaa4ac10f2ed604951706f3db1e3'
            '8f3dfb0f410b34a79b24a129e75e954414b06853519b000a4efc4be312d8c2fd')

prepare() {
  patch -d Notes-up-$pkgver -Np1 -i ../fix-build.patch
  patch -d Notes-up-$pkgver -Np1 -i ../0001-Add-missing-icon.patch
}

build() {
  cmake -S Notes-up-$pkgver -B build -G Ninja -DCMAKE_INSTALL_PREFIX='/usr' -Dnoele=1
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
  ln -s com.github.philip-scott.notes-up "$pkgdir/usr/bin/$pkgname"
}
