Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
dpdk: add a new build system and version (spack#35647)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoklee authored and jmcarcell committed Apr 13, 2023
1 parent a172342 commit c7d0c57
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions var/spack/repos/builtin/packages/dpdk/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)

0 comments on commit c7d0c57

Please sign in to comment.