# Maintainer (arch): Jan Alexander Steffens (heftig) heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Tobias Kieslich <tobias@justdreams.de>
# Contributor: Andreas Grapentin <andreas@grapentin.org>
# Contributor: André Silva <emulatorman@hyperbola.info>
# Contributor: Márcio Silva <coadde@hyperbola.info>
# Maintainer: Parabola Hackers <dev@lists.parabola.nu>


# parabola changes and rationale:
# privacy:
# - removed support for possibly unsafe protocols
# technical:
# - use upstream source-ball rather than VCS sources


pkgname=gthumb
pkgver=3.12.4
pkgrel=1
pkgrel+=.nonprism1
pkgdesc="Image browser and viewer for the GNOME Desktop"
pkgdesc+=", without support for unsafe and dangerous for privacy protocols"
url="https://wiki.gnome.org/Apps/gthumb"
arch=(x86_64)
arch+=(armv7h i686)
license=(GPL)
depends=(
  clutter-gtk
  dconf
  gsettings-desktop-schemas
  gst-plugin-gtk
  gst-plugins-base-libs
  json-glib
  libheif
  libjxl
  librsvg
  libsecret
  libsoup
  libwebp
  webkit2gtk
)
makedepends=(
  brasero
  docbook-xsl
  exiv2
  git
  liboauth
  libraw
  meson
  yelp-tools
)
optdepends=(
  'brasero: burn discs'
  'exiv2: metadata support'
  'liboauth: web albums'
  'libraw: read RAW files'
)
# we use source-ball
source=(
  https://gitlab.gnome.org/GNOME/gthumb/-/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz
)
source+=( nonprism.patch )
b2sums=('be952a6ce111137c35501252459e884307e2e43962cf877b30c9fae7ab8af3c8e9341fd0a331201e4eeff829319362362f12079a108ef8f6b1b40adf5304d51c')
b2sums+=('83f8e250b1483ff88ba1d6f12230fb7c3c23b51b9716855192263400c89136d33f513673763ef3e1a53effba3416f0513e96e0a747ccfcc0398280a6a6560270')


prepare() {
  ln -s ${pkgname}-${pkgver} $pkgname # minimize diff

  cd $pkgname

  echo "applying nonprism.patch"
  patch --verbose -Np1 -i ../nonprism.patch                # disable webservices build
  rm ./data/icons/private/hicolor/16x16/actions/site-*.png # delete logos
}

build() {
  arch-meson gthumb build
  meson compile -C build
}

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

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