# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=libwnck3
pkgver=43.0
pkgrel=3
pkgdesc="Library to manage X windows and workspaces (via pagers, tasklists, etc.)"
url="https://gitlab.gnome.org/GNOME/libwnck"
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
license=(LGPL)
depends=(gtk3 startup-notification libxres)
makedepends=(gobject-introspection gtk-doc git meson)
_commit=6147abd0c1fe35b96e1fbb63fa94d23f91fb2934  # tags/43.0^0
source=("git+https://gitlab.gnome.org/GNOME/libwnck.git#commit=$_commit"
        0001-handle-avoid-segfault-in-invalidate_icons.patch
        0002-handle-init-XRes-extension.patch
        0003-xutils-move-XRes-code-to-separate-function.patch
        0004-xutils-use-WnckScreen-in-_wnck_get_pid.patch
        0005-xutils-check-if-XRes-is-available-before-using-XResQ.patch)
b2sums=('SKIP'
        'f7c2c5261aab62e424cdb84c1a10b831423c82725472adcec8c41b9e6e55f65bf8705451ee7774824d8c05af3332ba6d34a0be7649e389f8942b759f9849fa68'
        'a186d046e8dc1c8103f9f9a843e0a426d5b11ab3d022a69a9ed7837cf18bc043056ce82f2ca23781d4514996c329f1837a77c6a6d2edf2282b5cac1ec6a03853'
        '148b4ecaffadd8b6fc916ad1b744d4588bd4185dd84a1ea476c845db39af45a0e6461d4dd2301d34fba4e386c0f0142cae3f480bfa8076769a303132252c509b'
        'c93d4308e4f60647225f01b75309b2f795ed8d3eb4285948f131ac7b3c60337f7502ba4dd455dddfc9634e177cecca43b4c1e0af428a197df33ea857258e2866'
        '02bfef6c46edb6af7ca82500bcb0e23a1838c9e843b6f524d0d570a0a1ae59af00497bf5a2ab1ac7ef9ffdf2b0d2d1a4e74084d8edaa6a39182e909e168bd164')

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

prepare() {
  cd libwnck

  # https://bugs.archlinux.org/task/76007
  git apply -3 ../0001-handle-avoid-segfault-in-invalidate_icons.patch

  # https://bugs.archlinux.org/task/76564
  git apply -3 ../0002-handle-init-XRes-extension.patch
  git apply -3 ../0003-xutils-move-XRes-code-to-separate-function.patch
  git apply -3 ../0004-xutils-use-WnckScreen-in-_wnck_get_pid.patch
  git apply -3 ../0005-xutils-check-if-XRes-is-available-before-using-XResQ.patch
}

build() {
  arch-meson libwnck build -D gtk_doc=true
  meson compile -C build
}

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

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

# vim:set sw=2 sts=-1 et:
