void-packages/srcpkgs/dpdk/template
2021-03-05 19:28:23 +01:00

83 lines
2.7 KiB
Bash

# Template file for 'dpdk'
pkgname=dpdk
version=19.08
revision=5
# no musl - uses error.h, execinfo.h and argp.h
archs="x86_64 aarch64 ppc64le i686 armv7l"
build_style=meson
configure_args="-Denable_kmods=false -Denable_docs=true -Db_lto=false"
hostmakedepends="doxygen python3-Sphinx pkg-config elfutils"
makedepends="libnuma-devel linux-headers jansson-devel libpcap-devel
zlib-devel openssl-devel libbsd-devel libelf libmnl"
depends="python3-pyelftools"
short_desc="Data Plane Development Kit"
maintainer="Hans-J. Schmid <knock@myopendoor.de>"
license="BSD-3-Clause, GPL-2.0-only"
homepage="https://www.dpdk.org/"
distfiles="https://github.com/DPDK/${pkgname}/archive/v${version}.tar.gz"
checksum=1ceff1a6f4f8d5f6f62c1682097249227ac5225ccd9638e0af09f5411c681038
# import py3compat
python_version=3
case "${XBPS_TARGET_MACHINE}" in
armv7l*) configure_args+=" -Dmachine=armv7-a";;
aarch64*) configure_args+=" -Dmachine=armv8-a";;
ppc64le*) configure_args+=" -Dmachine=power8";;
*) configure_args+=" -Dmachine=default"
esac
CFLAGS="-fcommon"
post_install() {
vmkdir usr/lib/modules-load.d
vlicense license/bsd-3-clause.txt
}
dpdk-doc_package() {
short_desc+=" - documentation"
pkg_install() {
vmove usr/share/doc
}
}
do_check() {
:
}
dpdk-devel_package() {
depends="${sourcepkg}>=${version}_${revision} jansson-devel zlib-devel libbsd-devel openssl-devel"
short_desc+=" - development files"
pkg_install() {
vmove usr/bin/dpdk-pdump
vmove usr/bin/dpdk-proc-info
vmove usr/bin/dpdk-test*
vmove usr/include
vmove usr/lib/*.so
vmove usr/lib/*.a
vmove usr/lib/dpdk/pmds-${version}/*.so
vmove usr/lib/pkgconfig
vmove usr/share/dpdk/examples
}
}
dpdk-dkms_package() {
short_desc+=" - DKMS kernel modules"
dkms_modules="dpdk-igb-uio $version dpdk-rte-kni $version"
depends="dkms dpdk-devel"
pkg_install() {
vmkdir usr/src/dpdk-igb-uio-${version}
vmkdir usr/src/dpdk-rte-kni-${version}
vcopy "kernel/linux/igb_uio/*" usr/src/dpdk-igb-uio-${version}
vcopy "kernel/linux/kni/*" usr/src/dpdk-rte-kni-${version}
vcopy ${FILESDIR}/dkms_igb_uio.conf usr/src/dpdk-igb-uio-${version}/dkms.conf
vcopy ${FILESDIR}/dkms_rte_kni.conf usr/src/dpdk-rte-kni-${version}/dkms.conf
sed -i -e "s/@VERSION@/${version}/" ${PKGDESTDIR}/usr/src/dpdk-igb-uio-${version}/dkms.conf
sed -i -e "s/@VERSION@/${version}/" ${PKGDESTDIR}/usr/src/dpdk-rte-kni-${version}/dkms.conf
# load modules at boot time
echo igb_uio > ${DESTDIR}/usr/lib/modules-load.d/igb_uio.conf
echo rte_kni > ${DESTDIR}/usr/lib/modules-load.d/rte_kni.conf
chmod 644 ${DESTDIR}/usr/lib/modules-load.d/igb_uio.conf
chmod 644 ${DESTDIR}/usr/lib/modules-load.d/rte_kni.conf
vmove usr/lib/modules-load.d
}
}