# Copyright     : Obarun
#------------------------
# Maintainer    : Eric Vidal <eric@obarun.org>
# Maintainer    : Jean-Michel T.Dydak <jean-michel@obarun.org>
#----------------
# Obarun PkgSrc : https://git.obarun.org/pkg/obextra/libinput
#--------------------------------------------------------------
# DESCRIPTION ]

pkgname=libinput
pkgver=1.19.3
pkgrel=3
pkgdesc="Input device management and event handling library"
url='https://www.freedesktop.org/wiki/Software/libinput/'

track="$pkgname"
target="$pkgname-$pkgver"
source=(
    "https://freedesktop.org/software/${track}/${target}.tar.xz"{,.sig}
)

#----------------------
# BUILD CONFIGURATION ]

makedepends=(
    'gtk3'
    'meson'
    'wayland-protocols'
    'cmake'
    'gtk4'
)

#------------------------
# INSTALL CONFIGURATION ]

depends=(
    'mtdev'
    'libevdev'
    'libwacom'
)

optdepends=(
    'gtk3: libinput debug-gui'
    'python-pyudev: libinput measure'
    'python-libevdev: libinput measure'
)

#----------------
# BUILD CONTROL ]

_flags=(
    -Dudev-dir=/usr/lib/udev
    -D b_lto=false
    -Dtests=false
    -Ddocumentation=false
)

#--------
# BUILD ]

build() {
    arch-meson "$pkgname-$pkgver" build "${_flags[@]}"
    meson compile -C build
}

#----------
# PACKAGE ]

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

    install -Dvm644 $pkgname-$pkgver/COPYING \
      "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

#--------------------
# ARCH LICENSE AUTH ]

arch=(x86_64)
license=(custom:X11)

validpgpkeys=(
    '3C2C43D9447D5938EF4551EBE23B7E70B467F0BF' ## Peter Hutterer (Who-T) <office@who-t.net>
)

sha512sums=('')
