This repository has been archived by the owner on Apr 19, 2023. It is now read-only.
forked from spack/spack
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dpdk: add a new build system and version (spack#35647)
- Loading branch information
Showing
1 changed file
with
29 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,16 +3,23 @@ | |
# | ||
# SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||
|
||
from spack.build_systems.makefile import MakefileBuilder | ||
from spack.build_systems.meson import MesonBuilder | ||
from spack.package import * | ||
|
||
|
||
class Dpdk(MakefilePackage): | ||
class Dpdk(MakefilePackage, MesonPackage): | ||
"""DPDK is a set of libraries and drivers for fast packet processing. | ||
It supports many processor architectures and both FreeBSD and Linux.""" | ||
|
||
homepage = "https://github.com/DPDK/dpdk" | ||
url = "https://github.com/DPDK/dpdk/archive/v19.11.tar.gz" | ||
url = "https://github.com/DPDK/dpdk/archive/v22.11.tar.gz" | ||
git = "https://github.com/DPDK/dpdk" | ||
|
||
maintainers("hyoklee") | ||
|
||
version("main", branch="main") | ||
version("22.11", sha256="ed8b2a2b153f0311ffa065d35af29a098367af44a22b3c33e191e1a74211f2e3") | ||
version("20.02", sha256="29e56ea8e47e30110ecb881fa5a37125a865dd2d45b61f68e93e334caaab16b7") | ||
version("19.11", sha256="ce1befb20a5e5c5399b326a39cfa23314a5229c0ced2553f53b09b1ae630706b") | ||
version("19.08", sha256="1ceff1a6f4f8d5f6f62c1682097249227ac5225ccd9638e0af09f5411c681038") | ||
|
@@ -21,11 +28,29 @@ class Dpdk(MakefilePackage): | |
|
||
conflicts("target=aarch64:", msg="DPDK is not supported on aarch64.") | ||
|
||
# Build system | ||
build_system( | ||
conditional("meson", when="@22.11:"), | ||
conditional("makefile", when="@:20.02"), | ||
default="meson", | ||
) | ||
|
||
with when("build_system=meson"): | ||
depends_on("[email protected]:", type="build") | ||
depends_on("ninja", type="build") | ||
depends_on("py-pyelftools", when="@22.11:") | ||
depends_on("numactl") | ||
|
||
def build(self, spec, prefix): | ||
|
||
class MesonBuilder(MesonBuilder): | ||
def meson_args(self): | ||
return ["--warnlevel=3"] | ||
|
||
|
||
class MakefileBuilder(MakefileBuilder): | ||
def build(self, pkg, spec, prefix): | ||
make("defconfig") | ||
make() | ||
|
||
def install(self, spec, prefix): | ||
def install(self, pkg, spec, prefix): | ||
install_tree(".", prefix) |