#Maintainer: Thorsten Muehlfelder <thenktor(at)gmx.de>

pkgname=viewnior
pkgver=1.7
pkgrel=1gv
source=(
	"https://github.com/hellosiyan/Viewnior/archive/viewnior-$pkgver.tar.gz"
	"fix-appdata.patch"
)
url=http://siyanpanayotov.com/project/viewnior/
docs=('AUTHORS' 'COPYING' 'ChangeLog' 'NEWS' 'README' 'TODO')

doinst() {
if [ -x /usr/bin/update-desktop-database ]; then
  /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi

if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
  if [ -x /usr/bin/gtk-update-icon-cache ]; then
    /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
  fi
fi

if [ -e usr/share/glib-2.0/schemas ]; then
  if [ -x /usr/bin/glib-compile-schemas ]; then
    /usr/bin/glib-compile-schemas usr/share/glib-2.0/schemas >/dev/null 2>&1
  fi
fi
}

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"$pkgname (image viewer)"
"This is Viewnior, an image viewer program. Created to be simple, fast"
"and elegant. It's minimalistic interface provides more screenspace for"
"your images."
)

build() {
	cd $startdir/src/Viewnior-viewnior-${pkgver}
	
	patch -p1 < $startdir/src/fix-appdata.patch || exit 1

	mkdir meson-build
	cd meson-build
	meson setup --prefix=/usr ..
	ninja -j $numjobs
	DESTDIR=$startdir/pkg ninja install
}
