#!/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-4
#pkgname=(gcr-4 gcr-4-docs)
pkgname=(gcr-4)
pkgver=4.1.0
pkgrel=01
pkgdesc="A library for bits of crypto UI and parsing w/o systemd"
url="https://gitlab.gnome.org/GNOME/gcr"
depends=(glib2 libgcrypt p11-kit libsecret openssh)
makedepends=(gobject-introspection vala git gi-docgen meson gtk4)
_commit=3376d13fd57215a6a75d83edce0b010c7483342a  # tags/4.1.0^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-4() {
  optdepends=('gtk4: gcr-viewer-gtk4')
  provides=(libgck-2.so libgcr-4.so)
#  install=gcr-4.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-4-docs() {
#  pkgdesc+=" (documentation)"
#  depends=()
#
#  mv doc/* "$pkgdir"
#}

#---- arch license gpg-key & sha256sums ----

arch=(x86_64)

license=(GPL2)

sha256sums=(SKIP)

##  9ce5a0b83c02c8eca10d482ea70155de9b228d8446d8069cbf0c602dc14e26b2  gcr-4-4.1.0-01-x86_64.pkg.tar.lz

