# Packager = Tuxcore <dev@tuxcore.org> 
# Enable checks in next release when edid-decode is not required for tests:
# https://gitlab.freedesktop.org/emersion/libdisplay-info/-/issues/35
BUILDENV+=(!check)

pkgname=libdisplay-info
pkgver=0.2.0
pkgrel=1
pkgdesc='EDID and DisplayID library'
url="https://gitlab.freedesktop.org/emersion/$pkgname"
arch=(x86_64)
license=(MIT)
depends=(glibc)
makedepends=(hwdata
             meson
             ninja
             python)
provides=(libdisplay-info.so)
_archive="$pkgname-$pkgver"
source=("$url/-/releases/$pkgver/downloads/$_archive.tar.xz"{,.sig})
sha256sums=('5a2f002a16f42dd3540c8846f80a90b8f4bdcd067a94b9d2087bc2feae974176'
            'SKIP')

build() {
	arch-meson "$_archive" build
	ninja -C build
}

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

package() {
	DESTDIR="$pkgdir" ninja -C build install
	install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" "$_archive/LICENSE"
}
