# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Tobias Kieslich <tobias@justdreams.de>

pkgname=gthumb-light
_pkgname=gthumb
pkgver=3.4.5
#pkgver=3.2.8
pkgrel=1
pkgdesc="Image browser and viewer for the GNOME Desktop"
url="https://wiki.gnome.org/Apps/gthumb"
arch=(i686 x86_64)
license=(GPL)
#depends=(dconf librsvg clutter-gtk gst-plugins-base-libs gsettings-desktop-schemas libwebp
#         libsecret libsoup webkit2gtk json-glib gtk3-print-backends)
depends=(dconf librsvg libwebp          libsecret libsoup  json-glib )
makedepends=(intltool  exiv2 itstool  libraw liboauth    yelp-tools flex gnome-common git)
optdepends=('libraw: read RAW files'
            'exiv2: metadata support'
            'libchamplain: map viewer'
            'brasero: burn discs'
            'liboauth: web albums')
#_commit=2e6cb187cac9cfa56aee1dbb37319acbd5570b26  # tags/3.5.3^0
#source=("git+https://git.gnome.org/browse/gthumb#commit=$_commit")
source=("https://git.gnome.org/browse/gthumb/snapshot/gthumb-$pkgver.zip")
sha256sums=('SKIP')

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

prepare() {
  cd $_pkgname-$pkgver
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $_pkgname-$pkgver
  ./configure --prefix=/usr --sysconfdir=/etc \
      --localstatedir=/var --disable-static \
#      --enable-libchamplain
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  cd $_pkgname-$pkgver
  make check
}

package() {
  cd $_pkgname-$pkgver
  make DESTDIR="$pkgdir" install
}
