# Maintainer: Lucien Cartier-Tilet <lucien@phundrak.com>
# Original Maintainer: Sanjay Pavan <withercubes@protonmail.com>

_pkgname=nsxiv
pkgname="${_pkgname}-bepo-git"
pkgver=29.r13.g6922d5d
pkgrel=1
pkgdesc='New Simple X Image Viewer'
arch=('x86_64')
license=('GPL2')
conflicts=("$_pkgname" "${_pkgname}-git")
provides=('sxiv')
url="https://github.com/${_pkgname}/${_pkgname}"
depends=('imlib2' 'desktop-file-utils' 'xdg-utils' 'hicolor-icon-theme' 'libexif' 'libxft' 'giflib' 'libwebp')
makedepends=(git)
source=("${_pkgname}::git+$url" config.h)
sha512sums=('SKIP'
            'fc4d8327b2de66f90af245d8670c4fd0169ba172fcdd0344d3ba6d72b13f54583b7042b4f7bfc891645675c3a0771c0144a6c0486a8380af93b7d090f990c6aa')

pkgver() {
  cd "$srcdir/${_pkgname}"
  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "$srcdir/${_pkgname}"
  [[ -f $srcdir/config.h ]] && cp $srcdir/config.h .
}

build() {
  make -C "$_pkgname"
}

package() {
  cd "$srcdir/${_pkgname}"
  make PREFIX=/usr DESTDIR="$pkgdir" install-all
  ln -s /usr/bin/nsxiv "${pkgdir}/usr/bin/sxiv"
}

# vim:set ts=2 sw=2 et: