# Maintainer: Bruno Pagani <archange@archlinux.org>
# Contributor: Eli Schwartz <eschwartz@archlinux.org>
# Contributor: Alex Filgueira <alexfilgueira (at antergos.com)>
# Contributor: Nate Simon <aurpkg (at natesimon.net)>

# Included in Slint by Didier Spaier didieratslintdotfr

pkgname=xapp
pkgver=2.8.2
pkgrel=1slint
slackdesc=" $pkgname (Common library for X-Apps project)"
arch=(x86_64)
url="https://github.com/linuxmint/${pkgname}"
license=(GPL)
depends=(libdbusmenu-gtk3 libgnomekbd)
optdepends=('python: for mate-desktop status applet')
makedepends=(meson samurai gobject-introspection python-gobject vala)
provides=(xapps)
conflicts=(xapps)
replaces=(xapps)
source=(https://github.com/linuxmint/${pkgname}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('07b00d02d2bdd93c043e370305071df80f21ded6404f7309b590a8f896e635b2')
b2sums=('1e2fb92b976196c2e9f36e322656ee40252e4c358a13361a054ead88e6fa3df35a53f1b0ee594df4189a68c1739c4a040558fac533ace095536fcc1dca76954b')

build() {
  arch-meson ${pkgname}-${pkgver} build \
    --buildtype=debugoptimized
# https://github.com/linuxmint/xapp/issues/169
  samu -C build
  DESTDIR="$PKG" samu -C build install

  # byte-compile python modules since meson does not implement autotools’ py-compile.
  local site_packages=$(python3 -c "import site; print(site.getsitepackages()[0])")
  echo
  echo $site_packages
  echo
  python3 -m compileall -o 0 -o 1 -o 2 --hardlink-dupes -s "$PKG" "$PKG"${site_packages}
}
