# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=libei
pkgver=1.2.1
pkgrel=1
pkgdesc="Library for Emulated Input"
url="https://libinput.pages.freedesktop.org/libei/"
arch=(x86_64)
license=(MIT)
depends=(
  libevdev
  systemd
)
makedepends=(
  git
  libxkbcommon
  meson
  python-attrs
  python-dbusmock
  python-jinja
  python-pytest
  python-structlog
  python-yaml
)
checkdepends=(
  python-pytest-xdist
  valgrind
)
provides=(
  lib{ei,eis,oeffis}.so
)
_commit=08f1d41085a6ae4bac7bc52abe2955d3354342cb  # tags/1.2.1^0
source=(
  "git+https://gitlab.freedesktop.org/libinput/libei.git#commit=$_commit"
  "git+https://github.com/nemequ/munit.git"
)
b2sums=('SKIP'
        'SKIP')

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

prepare() {
  cd libei
  ln -sr ../munit subprojects/munit
}

build() {
  arch-meson libei build
  meson compile -C build
}

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

package() {
  meson install -C build --destdir "$pkgdir" --skip-subprojects
  install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 libei/COPYING
}

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