# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Tobias Bohrmann (PlainTextField) <honeypot.carbage@aechelon.de>
# Contributor: Bernd Prünster (JesusMcCloud) <aur@berndpruenster.org>

pkgname=gnome-latex
pkgver=3.38.0+13+g703c2c9
pkgrel=1
pkgdesc="LaTeX editor for the GNOME desktop"
arch=(x86_64)
url="https://wiki.gnome.org/Apps/GNOME-LaTeX"
license=(GPL3)
depends=(gsettings-desktop-schemas gspell libgee tepl)
makedepends=(gobject-introspection intltool itstool vala git gtk-doc yelp-tools
             autoconf-archive appstream-glib)
optdepends=('texlive-core: build LaTeX documents')
replaces=(latexila)
_commit=703c2c969accfcc9342a05397aa05de138fe27fc  # master
source=("git+https://gitlab.gnome.org/GNOME/gnome-latex.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 --enable-gtk-doc
  make
}

check() {
  make -C $pkgname check
}

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