# Maintainer:  Ionut Biru <ibiru@archlinux.org>
# Contributor: uastasi <uastasi@archlinux.us>

pkgname=gnote
pkgver=3.34.0
pkgrel=1
pkgdesc="A note taking application"
url="https://wiki.gnome.org/Apps/Gnote"
arch=(x86_64)
license=(GPL3)
depends=(gtkmm3 gspell libxslt dconf libsecret)
makedepends=(intltool yelp-tools autoconf-archive git)
_commit=93d29902f9d14f2a0c3f7e70103f9cbfca16a173  # tags/3.34.0^0
source=("git+https://gitlab.gnome.org/GNOME/gnote.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --libexecdir=/usr/lib \
    --disable-schemas-compile \
    --disable-static
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  cd $pkgname
  make check
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
