# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=ddcutil
pkgver=2.1.4
pkgrel=2
pkgdesc='Query and change Linux monitor settings using DDC/CI and USB.'
url='http://ddcutil.com/'
arch=('x86_64')
license=('GPL2')
depends=('glib2' 'i2c-tools' 'libusb' 'libdrm' 'jansson')
makedepends=('git' 'systemd')
source=(git+https://github.com/rockowitz/ddcutil.git#tag=v$pkgver)
sha512sums=('42cbfa968c40ed36746db592b3cb6225292e5f39c6ca5697b25cde10cf5b40296a0d4ede25370d6b3e4ab80d93bcd3bde425ad4cc0a4fdb28a32c08a4ae52d3c')

prepare() {
  cd ddcutil
  # do not install data/usr/lib/udev/rules.d/60-ddcutil-usb.rules
  git cherry-pick -n 093802343bb5963cc4b3084ecd79c5b86392e360
  git cherry-pick -n 5a3b257f783a14e1da80ed8e0101060e93027d0d
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd ddcutil
  ./configure --prefix=/usr
  make
}

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

# vim: ft=sh ts=2 sw=2 et
