# Maintainer: oldherl
# Contributor: Chris Severance aur.severach aATt spamgourmet dott com
# Contributor: ajs124

# Tested on linux 6.13.6 with 03f0:0867 HP USB-C Universal Dock
pkgname='evdi-dkms'
pkgver=1.15.0
_pkgver=$pkgver
pkgrel=1
pkgdesc='kernel module that enables management of multiple screens, primarily for DisplayLink USB VGA DVI HDMI DisplayPort video'
arch=('x86_64')
url='https://github.com/DisplayLink/evdi'
license=('GPL-2.0-only AND LGPL-2.1-only AND MIT')
depends=('dkms' 'libdrm')
makedepends=('git')
provides=("evdi=${_pkgver}")
conflicts=('evdi' 'evdi-git')
_srcdir="evdi"
source=(
  "git+https://github.com/DisplayLink/evdi#tag=v${pkgver}"
)
sha256sums=('e1f8caed7efc412063361f8771f7c011918d6d0ac75238ba0c565d02016ad471')

build() {
  cd "${_srcdir}"
  make -C 'library'
}

package() {
  cd "${_srcdir}"
  make -C 'library' install DESTDIR="${pkgdir}" PREFIX='/usr'

  local _DKMS="${pkgdir}/usr/src/evdi-${_pkgver}"
  install -d "${_DKMS}/"
  cp -pr 'module/'* "${_DKMS}/"
  make -C "${_DKMS}" clean
  rm -f "${_DKMS}/evdi.mod"
}
