# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=libdrm
pkgver=2.4.122
pkgrel=1
pkgdesc="Userspace interface to kernel DRM services"
url="https://dri.freedesktop.org/"
arch=(x86_64)
license=('MIT')
depends=('libpciaccess' 'glibc')
makedepends=('python-docutils' 'meson')
checkdepends=('cairo')
optdepends=('cairo: needed for modetest tool')
replaces=('libdrm-new' 'libdrm-nouveau')
source=(https://dri.freedesktop.org/$pkgname/$pkgname-$pkgver.tar.xz{,.sig}
        COPYING)
sha512sums=('ea6bac94416d4ba0e9805e142ae62904236bc49f803d4fc10c92968a4df64c818dd42524ad7a4e988062836783a148e27094050bb2754f751a368627f794ad13'
            'SKIP'
            'b0ca349b882a4326b19f81f22804fabdb6fb7aef31cdc7b16b0a7ae191bfbb50c7daddb2fc4e6c33f1136af06d060a273de36f6f3412ea326f16fa4309fda660')

build() {
  arch-meson $pkgname-$pkgver build \
    -D udev=true \
    -D etnaviv=disabled \
    -D freedreno=disabled \
    -D vc4=disabled \
    -D valgrind=disabled \
    -D install-test-programs=true
  meson compile -C build
}

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

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