#!/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 |---------------------------------------

pkgname=xf86-input-wacom
pkgver=1.1.0
pkgrel=01
pkgdesc="X.Org Wacom tablet driver w/o systemd"
arch=(x86_64)
url="https://github.com/linuxwacom/xf86-input-wacom"
depends=(libxi libxinerama libxrandr)
makedepends=('xorg-server-devel' 'X-ABI-XINPUT_VERSION=24.4' 'meson'
 	'gobject-introspection')
	# for tests
checkdepends=('python-libevdev' 'python-pytest' 'python-yaml' 'python-gobject' 'attr')

conflicts=('xorg-server<21.1.1' 'X-ABI-XINPUT_VERSION<24' 'X-ABI-XINPUT_VERSION>=25')
source=(https://github.com/linuxwacom/xf86-input-wacom/releases/download/$pkgname-$pkgver/$pkgname-$pkgver.tar.bz2{,.sig})
# check at https://github.com/linuxwacom/xf86-input-wacom/releases

build() {

  arch-meson $pkgname-$pkgver build \
    -D xorg-conf-dir=/usr/share/X11/xorg.conf.d/ \
    -D systemd-unit-dir=FALSE \
    -D unittests=enabled

  # Print config
  meson configure build
  ninja -C build
}

check() {
  meson test -C build # || /bin/true
}

package() {
  DESTDIR="$pkgdir" ninja -C build install
}

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

license=(GPL)

#validpgpkeys=('9A12ECCC5383CA2AF5B42CDCA6DC66911B2127D5') # Jason Gerecke <killertofu@gmail.com>
validpgpkeys+=('3C2C43D9447D5938EF4551EBE23B7E70B467F0BF') #  "Peter Hutterer (Who-T) <office@who-t.net>"
#validpgpkeys+=('5222AA87620F928D2C16F62BDB4ABF7C3424190B') # "Aaron Armstrong Skomra <skomra@gmail.com>"
#validpgpkeys+=('FBE078781106933D3DDCF93E5B4EA609784983CA') # "Jason Gerecke <jason.gerecke@wacom.com>"

sha256sums=(23b674067f344de22bcbb4bac885c43df54c5e841f6dade7c9d18ba7ce297a12 # xf86-input-wacom-1.1.0.tar.bz2
	d11758b2279799fe912aa0165166eed988163b42a6e5c129052c3dec039c6043) # xf86-input-wacom-1.1.0.tar.bz2.sig
