arch-ppa/src/evdi-git/PKGBUILD

88 lines
2.2 KiB
Bash
Raw Normal View History

2019-07-27 10:40:51 -04:00
# Maintainer: Chris Severance aur.severach aATt spamgourmet dott com
# Contributor: ajs124
2017-08-27 13:02:19 -04:00
2019-07-27 10:40:51 -04:00
# Tested with Kernel 4.16, Dell D3000 SuperSpeed USB 3.0 Docking Station, 17e9:4318 DisplayLink
pkgname='evdi-git'
2021-12-12 12:01:11 -05:00
pkgver=1.9.1.r48.gd6b2841
2019-07-27 10:40:51 -04:00
_pkgver="${pkgver%%.r*}"
2017-08-27 13:02:19 -04:00
pkgrel=1
2019-07-27 10:40:51 -04:00
pkgdesc='kernel module that enables management of multiple screens, primarily for DisplayLink USB VGA DVI HDMI DisplayPort video'
2017-08-27 13:02:19 -04:00
arch=('i686' 'x86_64')
2019-07-27 10:40:51 -04:00
url='https://github.com/DisplayLink/evdi'
2017-08-27 13:02:19 -04:00
license=('GPL')
2019-07-27 10:40:51 -04:00
depends=('dkms')
makedepends=('git' 'libdrm')
2021-12-12 12:01:11 -05:00
makedepends+=('linux-headers')
2019-07-27 10:40:51 -04:00
provides=("evdi=${_pkgver}")
conflicts=('evdi')
_srcdir="${pkgname%-git}"
source=(
2021-12-12 12:01:11 -05:00
'git+https://github.com/DisplayLink/evdi'
2019-07-27 10:40:51 -04:00
)
2021-12-12 12:01:11 -05:00
source[0]+='#branch=devel'
md5sums=('SKIP')
sha256sums=('SKIP')
2017-08-27 13:02:19 -04:00
pkgver() {
2019-07-27 10:40:51 -04:00
cd "${_srcdir}"
2021-12-12 12:01:11 -05:00
local _modver _rev
#_modver="$(awk -F '=' '/MODVER=/ {print $2}' module/Makefile)"
_rev="$(git describe --long --tags | sed -e 's/^v//' -e 's/\([^-]*-g\)/r\1/' -e 's/-/./g')"
if [ -z "${_modver:-}" ]; then
printf '%s\n' "${_rev}"
else
printf '%s.r%s\n' "${_modver}" "${_rev##*.r}"
fi
2019-07-27 10:40:51 -04:00
}
prepare() {
cd "${_srcdir}"
local _src
2021-12-12 12:01:11 -05:00
for _src in "${source[@]%%::*}"; do
2019-07-27 10:40:51 -04:00
_src="${_src##*/}"
if [[ "${_src}" = *.patch ]]; then
2021-12-12 12:01:11 -05:00
msg2 "Patch ${_src}"
2019-07-27 10:40:51 -04:00
patch -Np1 -i "../${_src}"
fi
done
2021-12-12 12:01:11 -05:00
# Fix build for kernel 5.4
#sed -E -e 's:SUBDIRS=([^ ]+) :M=\1 &:g' -i 'module/Makefile'
sed -e 's:-Werror::g' -i 'Makefile'
2017-08-27 13:02:19 -04:00
}
build() {
2019-07-27 10:40:51 -04:00
cd "${_srcdir}"
2021-12-12 12:01:11 -05:00
# DKMS builds are hard to debug. We can build it here to debug the errors.
if :; then
# We only need to build the library in this step, dmks will build the module
cd 'library'
fi
CFLAGS="${CFLAGS/-fno-plt/}"
2019-07-27 10:40:51 -04:00
make
2017-08-27 13:02:19 -04:00
}
package() {
2019-07-27 10:40:51 -04:00
cd "${_srcdir}"
2021-12-12 12:01:11 -05:00
install -Dpm755 "library/lib${pkgname%-git}.so"* -t "${pkgdir}/usr/lib/"
pushd "${pkgdir}/usr/lib/" > /dev/null
local _libs=(*.so.*)
if [ "${#_libs[@]}" -ne 1 ]; then
echo "Too many libs"
false
fi
_libs="${_libs[0]}"
local _libase="${_libs%.so*}.so"
ln -sf "${_libs}" "${_libase}"
ln -sf "${_libs}" "${_libase}.0" # bad soname
popd > /dev/null
2017-08-27 13:02:19 -04:00
2019-07-27 10:40:51 -04:00
local _DKMS="${pkgdir}/usr/src/${pkgname%-git}-${_pkgver}"
install -Dpm644 module/* -t "${_DKMS}/"
make -j1 -C "${_DKMS}" clean
2021-12-12 12:01:11 -05:00
rm -f "${_DKMS}/evdi.mod"
2019-07-27 10:40:51 -04:00
}