aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/dpdk/portfile.cmake
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/dpdk/portfile.cmake
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/dpdk/portfile.cmake')
-rw-r--r--vcpkg/ports/dpdk/portfile.cmake94
1 files changed, 94 insertions, 0 deletions
diff --git a/vcpkg/ports/dpdk/portfile.cmake b/vcpkg/ports/dpdk/portfile.cmake
new file mode 100644
index 0000000..3731661
--- /dev/null
+++ b/vcpkg/ports/dpdk/portfile.cmake
@@ -0,0 +1,94 @@
+if(VCPKG_TARGET_IS_LINUX)
+ execute_process(
+ COMMAND uname --kernel-release
+ OUTPUT_VARIABLE KERNEL_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if(KERNEL_VERSION VERSION_LESS 4.4)
+ message(
+ WARNING
+ " Kernel version requires >= 4.4 on Linux (current version: ${KERNEL_VERSION})\n"
+ " Building may fail or have functional defects. See\n"
+ " https://doc.dpdk.org/guides/linux_gsg/sys_reqs.html#system-software"
+ )
+ endif()
+
+ execute_process(
+ COMMAND sh -c "ldd --version | head -n1 | rev | cut -d' ' -f 1 | rev"
+ OUTPUT_VARIABLE GLIBC_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ if(GLIBC_VERSION VERSION_LESS 2.7)
+ message(
+ FATAL_ERROR
+ "glibc version requires >= 2.7 (for features related to cpuset)")
+ endif()
+endif()
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO DPDK/dpdk
+ REF "v${VERSION}"
+ SHA512 0d0ee4eb70e8021882a1d6548cf757972388c0a561ee71bb0e4b330be61f1463f4eaec55202d7a35eef8b392ecf0b3888713692ba8cd88f850e7b9072504733e
+ HEAD_REF main
+ PATCHES
+ 0001-enable-either-static-or-shared-build.patch
+ 0002-fix-dependencies.patch
+ 0003-remove-examples-src-from-datadir.patch
+ 0004-stop-building-apps.patch
+ 0005-no-absolute-driver-path.patch
+)
+
+macro(append_bool_option feature_name option_name)
+ if("${feature_name}" IN_LIST FEATURES)
+ list(APPEND DPDK_OPTIONS -D${option_name}=true)
+ else()
+ list(APPEND DPDK_OPTIONS -D${option_name}=false)
+ endif()
+endmacro()
+
+set(DPDK_OPTIONS "")
+append_bool_option("docs" "enable_docs")
+append_bool_option("kmods" "enable_kmods")
+append_bool_option("tests" "tests")
+append_bool_option("trace" "enable_trace_fp")
+string(REPLACE "-Denable_docs=true" "-Denable_docs=false" DPDK_OPTIONS_DEBUG "${DPDK_OPTIONS}")
+
+list(APPEND PYTHON_PACKAGES pyelftools)
+if("docs" IN_LIST FEATURES)
+ list(APPEND PYTHON_PACKAGES packaging sphinx)
+endif()
+x_vcpkg_get_python_packages(PYTHON_VERSION "3" PACKAGES ${PYTHON_PACKAGES})
+
+vcpkg_configure_meson(SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -Ddisable_drivers=regex/cn9k
+ -Dexamples=
+ OPTIONS_RELEASE
+ ${DPDK_OPTIONS}
+ OPTIONS_DEBUG
+ ${DPDK_OPTIONS_DEBUG}
+)
+vcpkg_install_meson()
+
+set(tools
+ dpdk-cmdline-gen.py
+ dpdk-devbind.py
+ dpdk-pmdinfo.py
+ dpdk-telemetry.py
+ dpdk-hugepages.py
+ dpdk-rss-flows.py
+ dpdk-telemetry-exporter.py
+)
+vcpkg_copy_tools(TOOL_NAMES ${tools} AUTO_CLEAN)
+
+vcpkg_fixup_pkgconfig()
+
+if("docs" IN_LIST FEATURES)
+ file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/dpdk")
+ file(RENAME "${CURRENT_PACKAGES_DIR}/share/doc/dpdk" "${CURRENT_PACKAGES_DIR}/share/dpdk/doc")
+endif()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/share/doc")
+
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/license/README")