# Description: Seahorse is a GNOME application for managing encryption keys and passwords in the GNOME Keyring
# URL: https://wiki.gnome.org/Apps/Seahorse/
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: gcr gnome-keyring gpgme libhandy libpwquality libsoup3
# Optional: avahi gpgme openldap

name=seahorse
version=47.0.1
release=2
source=(https://gitlab.gnome.org/GNOME/seahorse/-/archive/$version/seahorse-$version.tar.bz2)

build() {
  prt-get isinst avahi || PKGMK_SEAHORSE+=' -D key-sharing=false'
  prt-get isinst gpgme || PKGMK_SEAHORSE+=' -D pgp-support=false -D check-compatible-gpg=false'
  prt-get isinst openldap || PKGMK_SEAHORSE+=' -D ldap-support=false -D hkp-support=false'

  sed -i -r 's:"(/apps):"/org/gnome\1:' $name-$version/data/*.xml
  sed -i '/GPGME_EVENT_NEXT_TRUSTITEM/d' $name-$version/pgp/seahorse-gpgme.c

  meson setup $name-$version build $PKGMK_SEAHORSE \
    --prefix=/usr \
    --libexecdir=/usr/lib/$name \
    --buildtype=plain \
    --wrap-mode nodownload \
    --auto-features disabled \
    -D b_lto=true \
    -D b_pie=true \
    -D help=false
  meson compile -C build
  DESTDIR=$PKG meson install -C build

  rm -r $PKG/usr/share/locale
}
