# $Id$
# Maintainer (Arch): Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor (Arch): Jan de Groot <jgc@archlinux.org>
# Contributor (Arch): Tobias Kieslich <tobias@justdreams.de>
# Contributor: Andreas Grapentin <andreas@grapentin.org>
# Contributor: André Silva <emulatorman@hyperbola.info>
# Contributor: Márcio Silva <coadde@hyperbola.info>

# parabola changes and rationale:
#  - removed support for possibly unsafe protocols

pkgname=gthumb
pkgver=3.8.3
pkgrel=1
pkgrel+=.nonprism1
pkgdesc="Image browser and viewer for the GNOME Desktop, without support for unsafe and dangerous for privacy protocols"
url="https://wiki.gnome.org/Apps/gthumb"
arch=(x86_64 i686 armv7h)
license=(GPL)
depends=(dconf librsvg clutter-gtk gst-plugins-base-libs gsettings-desktop-schemas libwebp
         libsecret libsoup webkit2gtk json-glib gtk3-print-backends)
makedepends=(libchamplain exiv2 brasero libraw liboauth docbook-xsl yelp-tools meson git)
optdepends=('libraw: read RAW files'
            'exiv2: metadata support'
            'libchamplain: map viewer'
            'brasero: burn discs'
            'liboauth: web albums')
_commit=ca8f528209ab78935c30e42fe53bdf1a24f3cb44  # tags/3.8.3^0
source=("git+https://gitlab.gnome.org/GNOME/gthumb.git#commit=$_commit"
        nonprism.patch)
sha256sums=('SKIP'
            'ec0e5fdf9b7d48b90821e9ce9f7fdacc60fd843183c27479854d33f457805796')

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

prepare() {
  cd $pkgname
  patch --verbose -Np1 -i ../nonprism.patch			# Set meson_options to build without webservices
  rm ./data/icons/private/hicolor/16x16/actions/site-*.png   	# Get rid of the logos 
}

build() {
  arch-meson $pkgname build -D libchamplain=true
  ninja -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  DESTDIR="$pkgdir" meson install -C build
}
