#!/usr/bin/bash
# JOBoRun		: Jwm OpenBox Obarun RUNit
# Maintainer	: Joe Bo Run <joborun@disroot.org>
# PkgSource		: url="https://gittea.disroot.org/joborun-pkg/jobextra/$pkgname"
# Website		: https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------

#pkgbase=gcr
#pkgname=(gcr gcr-docs)
pkgname=gcr
pkgver=3.41.1
pkgrel=02
pkgdesc="A library for bits of crypto UI and parsing w/o systemd"
url="https://gitlab.gnome.org/GNOME/gcr"
arch=(x86_64)
depends=(gtk3 libgcrypt p11-kit openssh libsecret)
makedepends=(gobject-introspection vala libxslt git gi-docgen meson)
# options=(debug)  ###  remove this to have the debug pkg produced
_commit=664f8d8619cc6d661bd863107824efbac383a9bf  # tags/3.41.1^0
source=("git+https://gitlab.gnome.org/GNOME/gcr.git#commit=$_commit")

pkgver() {
  cd gcr
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd gcr
}

build() {
  arch-meson gcr build -D systemd=disabled
  meson compile -C build
}

check() {
  # Secure memory tests fail
  dbus-run-session meson test -C build --print-errorlogs || :
}

#package_gcr() {
package() {
  provides=(libgck-1.so libgcr-{base,ui}-3.so)
#  install=gcr.install   ##  enables systemd ssh sockets for systemctl

  meson install -C build --destdir "$pkgdir"

  mkdir -p doc/usr/share
  mv {"$pkgdir",doc}/usr/share/doc
}

#package_gcr-docs() {
#  pkgdesc+=" (documentation)"
#  depends=()
#
#  mv doc/* "$pkgdir"
#}

#---- license gpg-key sha256sums ----

license=(GPL2)

sha256sums=(SKIP)
