# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgname=gnome-notes
pkgver=3.34.0
pkgrel=1
pkgdesc="Write out notes, every detail matters"
url="https://wiki.gnome.org/Apps/Notes"
arch=(x86_64)
license=(GPL)
depends=(tracker webkit2gtk gnome-online-accounts evolution-data-server)
makedepends=(evolution python appstream-glib yelp-tools git meson)
provides=("bijiben=$pkgver")
conflicts=(bijiben)
replaces=(bijiben)
_commit=7b140dba081ef6d99609b2ce4ddce90457153ee6  # tags/BIJIBEN_3_34_0^0
source=("git+https://gitlab.gnome.org/GNOME/gnome-notes.git#commit=$_commit"
        "git+https://gitlab.gnome.org/GNOME/libgd.git")
sha256sums=('SKIP'
            'SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^BIJIBEN_//;s/_/./g;s/-/+/g'
}

prepare() {
  cd $pkgname

  git submodule init
  git config --local submodule.subprojects/libgd.url "$srcdir/libgd"
  git submodule update
}

build() {
  arch-meson $pkgname build -D update_mimedb=false
  ninja -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  DESTDIR="$pkgdir" meson install -C build
}
