# Contributor: Alex Laskin <alex@lask.in>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=ddcutil
pkgver=2.1.4
pkgrel=1
pkgdesc="Query and change Linux monitor settings using DDC/CI and USB"
url="https://github.com/rockowitz/ddcutil"
arch="all"
license="GPL-2.0-only"
makedepends="
	autoconf
	automake
	eudev-dev
	glib-dev
	i2c-tools-dev
	jansson-dev
	kmod-dev
	libtool
	libusb-dev
	libxrandr-dev
	linux-headers
	"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/rockowitz/ddcutil/archive/v$pkgver.tar.gz
	$pkgname-$pkgver-time_t.patch::https://github.com/rockowitz/ddcutil/commit/7e05872d3fcbab53123fe2b46e0697d0031b2464.patch
	$pkgname-$pkgver-print-time_t.patch::https://github.com/rockowitz/ddcutil/commit/441ee0fef8729a3b0d2dbf080bf238faf0f8c844.patch
	"

prepare() {
	default_prepare
	NOCONFIGURE=1 ./autogen.sh
}

build() {
	./configure \
		--prefix=/usr \
		--mandir=/usr/share/man
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
8c352bfacc2a5cdd22b8d84f2facd58de6d425d0d3f98de543cf36a3e6b15aa10fc86e87780c82f872f0bf0db984e1cc800aaff914bafe4dbf17602e2a7caeb0  ddcutil-2.1.4.tar.gz
49102cb9e59a33b08f247a1ab4c08e2de01b5b31e477ca659c8734a184cb64cf2243c9bbefe0f1548ca9d0eb0be954c21dea187ae9497e44f8e8389e16106445  ddcutil-2.1.4-time_t.patch
1f380e8507bce2dce3b0229850a54e18769f187026623e287ede461034c66c425aa5748f9e30fc0325409e68eff9d3034fdd9139c60ac963006dd3eea205dd51  ddcutil-2.1.4-print-time_t.patch
"
