void-packages/srcpkgs/dpdk/template
Đoàn Trần Công Danh b6bcd8cd34 srcpkgs/d*: convert patches to -Np1
* daemontools and dmraid is kept at -Np0

```sh

git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

83 lines
2.6 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 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
}
}