diff --git a/.github/workflows/portage-stable-packages-list b/.github/workflows/portage-stable-packages-list index ac9d6f8e2ce..35786e26e3f 100644 --- a/.github/workflows/portage-stable-packages-list +++ b/.github/workflows/portage-stable-packages-list @@ -291,6 +291,7 @@ dev-libs/openssl dev-libs/popt dev-libs/protobuf dev-libs/raft +dev-libs/rapidjson dev-libs/tree-sitter dev-libs/tree-sitter-bash dev-libs/userspace-rcu diff --git a/sdk_container/src/third_party/coreos-overlay/app-containers/accelerated-container-image/Manifest b/sdk_container/src/third_party/coreos-overlay/app-containers/accelerated-container-image/Manifest new file mode 100644 index 00000000000..8e0073ba89c --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-containers/accelerated-container-image/Manifest @@ -0,0 +1,2 @@ +DIST accelerated-container-image-1.3.0-vendor.tar.xz 3202404 BLAKE2B bb7a8e54bb5c959be80b6db88f59885c1e5b4cd88c1faceb647381879cdfab0383bc747d12521d52dc8e977574c14069bee41b98ce302b9c39d1c8ff02799476 SHA512 39514193018fc55629c660b22d1935cbbd31f56492276aa34cefe2679baba6e705183f6322981bdd1ace28d003c2912b47c9a85a703383afffa399d69d81caf3 +DIST accelerated-container-image-1.3.0.tar.gz 607982 BLAKE2B 544e17c76f4f8787713cfedd6416df2008c7282b66d1ab3987f952a5c8341edaaa7c58c56c8c37c3e331e491bb679356802b523aa58b2df03a4344f19e6ef645 SHA512 0b24970baf3d2ca38bb3860498320a05d134fb6e36c5d59c115e8331bb483e0fc14c261950e08de9aad9fe056028b850cba78a964ba06b6c7f601b3a937f3b07 diff --git a/sdk_container/src/third_party/coreos-overlay/app-containers/accelerated-container-image/accelerated-container-image-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/app-containers/accelerated-container-image/accelerated-container-image-9999.ebuild index ad12a62f36b..f49fca02e3e 100644 --- a/sdk_container/src/third_party/coreos-overlay/app-containers/accelerated-container-image/accelerated-container-image-9999.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/app-containers/accelerated-container-image/accelerated-container-image-9999.ebuild @@ -3,31 +3,27 @@ EAPI=8 -inherit git-r3 go-module systemd tmpfiles +inherit go-module systemd tmpfiles DESCRIPTION="Remote container image format (overlaybd) and snapshotter based on block-device" HOMEPAGE="https://github.com/containerd/accelerated-container-image" -EGIT_REPO_URI="https://github.com/containerd/accelerated-container-image.git" if [[ ${PV} == 9999* ]]; then - KEYWORDS="~amd64 ~arm64" + EGIT_REPO_URI="https://github.com/containerd/accelerated-container-image.git" + inherit git-r3 else - EGIT_COMMIT="v${PV}" + SRC_URI="https://github.com/containerd/accelerated-container-image/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz + https://dev.gentoo.org/~chewi/distfiles/${P}-vendor.tar.xz" KEYWORDS="amd64 arm64" fi LICENSE="Apache-2.0" SLOT="0" -# FIXME HACK ALERT: the build pulls go modules during src_compile. -# This fails if network sandbox is enabled. -RESTRICT="${RESTRICT} network-sandbox" - - RDEPEND="sys-fs/overlaybd" src_unpack() { - git-r3_src_unpack + [[ ${PV} == 9999* ]] && git-r3_src_unpack go-module_src_unpack } @@ -40,9 +36,9 @@ src_install() { sed -i 's,/opt/overlaybd,/usr/local/overlaybd,' \ "${ED}/usr/local/overlaybd/snapshotter/overlaybd-snapshotter.service" || die - # tmpfiles will take care of symlinking /usr/local/overlaybd/snapshotter - # to /opt/overlaybd/snapshotter, where upstream expects the binaries. - # (we need them in /usr to be used in a sysext) + # tmpfiles will take care of symlinking /usr/local/overlaybd/snapshotter + # to /opt/overlaybd/snapshotter, where upstream expects the binaries. + # (we need them in /usr to be used in a sysext) dotmpfiles "${FILESDIR}/10-overlaybd-snapshotter.conf" systemd_dounit "${ED}/usr/local/overlaybd/snapshotter/overlaybd-snapshotter.service" diff --git a/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/package.use.mask b/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/package.use.mask index 552f28f5805..b635b4660b8 100644 --- a/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/package.use.mask +++ b/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/package.use.mask @@ -28,3 +28,6 @@ app-emulation/qemu X # disable all tools for NVIDIA driver, keep just kmods x11-drivers/nvidia-drivers tools X static-libs x11-drivers/old-nvidia-drivers tools X static-libs + +# We don't maintain the tarballs needed to build these features offline. + -Date: Fri, 7 Nov 2025 12:06:05 +0100 -Subject: [PATCH 2/2] Patch yaml-cpp after fetching to fix cmake issues - -Signed-off-by: Krzesimir Nowak ---- - CMakeLists.txt | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 753b081..03b2ab9 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -53,6 +53,7 @@ if (NOT yaml-cpp_FOUND) - yaml-cpp - GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git - GIT_TAG 0.8.0 -+ PATCH_COMMAND patch -p1 -i @FILESDIR@/yaml-cpp-cmake-4.0.patch - ) - FetchContent_MakeAvailable(yaml-cpp) - endif() --- -2.51.0 - diff --git a/sdk_container/src/third_party/coreos-overlay/sys-fs/overlaybd/files/overlaybd-offline-build.patch b/sdk_container/src/third_party/coreos-overlay/sys-fs/overlaybd/files/overlaybd-offline-build.patch new file mode 100644 index 00000000000..b79909d5ac4 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/sys-fs/overlaybd/files/overlaybd-offline-build.patch @@ -0,0 +1,312 @@ +diff --git a/CMake/Findcurl.cmake b/CMake/FindCURL.cmake +similarity index 95% +rename from CMake/Findcurl.cmake +rename to CMake/FindCURL.cmake +index de370a5..041bd5e 100644 +--- a/CMake/Findcurl.cmake ++++ b/CMake/FindCURL.cmake +@@ -14,10 +14,8 @@ if(${BUILD_CURL_FROM_SOURCE}) + # In libcurl, CMakeLists build static lib is broken add build command via + # make + if(NOT TARGET libcurl_static_build) +- if (NOT curl_bundle_POPULATED) +- FetchContent_Populate(curl_bundle) +- endif() +- find_package(openssl) ++ FetchContent_MakeAvailable(curl_bundle) ++ find_package(OpenSSL) + add_custom_command( + OUTPUT ${curl_bundle_BINARY_DIR}/lib/libcurl.a + WORKING_DIRECTORY ${curl_bundle_SOURCE_DIR} +diff --git a/CMake/Findopenssl.cmake b/CMake/FindOpenSSL.cmake +similarity index 96% +rename from CMake/Findopenssl.cmake +rename to CMake/FindOpenSSL.cmake +index 02e55b9..dbe1d54 100644 +--- a/CMake/Findopenssl.cmake ++++ b/CMake/FindOpenSSL.cmake +@@ -14,9 +14,7 @@ if(${BUILD_CURL_FROM_SOURCE}) + FetchContent_GetProperties(openssl102) + + if(NOT TARGET openssl102_static_build) +- if(NOT openssl102_POPULATED) +- FetchContent_Populate(openssl102) +- endif() ++ FetchContent_MakeAvailable(openssl102) + add_custom_command( + OUTPUT ${openssl102_BINARY_DIR}/lib/libssl.a + WORKING_DIRECTORY ${openssl102_SOURCE_DIR} +diff --git a/CMake/FindRapidJSON.cmake b/CMake/FindRapidJSON.cmake +new file mode 100644 +index 0000000..f142f5c +--- /dev/null ++++ b/CMake/FindRapidJSON.cmake +@@ -0,0 +1,19 @@ ++find_package(PkgConfig) ++if (PKG_CONFIG_FOUND) ++ pkg_check_modules(RAPIDJSON RapidJSON) ++endif() ++ ++if (NOT RAPIDJSON_FOUND) ++ if (NOT rapidjson_POPULATED) ++ FetchContent_Populate( ++ rapidjson ++ GIT_REPOSITORY https://github.com/Tencent/rapidjson.git ++ GIT_TAG 80b6d1c83402a5785c486603c5611923159d0894 ++ GIT_SUBMODULES "" ++ ) ++ endif() ++ FetchContent_GetProperties(rapidjson) ++ set(RAPIDJSON_INCLUDE_DIRS "${rapidjson_SOURCE_DIR}/include") ++endif() ++ ++add_definitions("-DRAPIDJSON_HAS_STDSTRING=1") +diff --git a/CMake/Finde2fs.cmake b/CMake/Finde2fs.cmake +index 15c58fd..e5615a2 100644 +--- a/CMake/Finde2fs.cmake ++++ b/CMake/Finde2fs.cmake +@@ -9,9 +9,7 @@ if(NOT ORIGIN_EXT2FS) + FetchContent_GetProperties(e2fsprogs) + + if(NOT TARGET libext2fs_build) +- if (NOT e2fsprogs_POPULATED) +- FetchContent_Populate(e2fsprogs) +- endif() ++ FetchContent_MakeAvailable(e2fsprogs) + set(LIBEXT2FS_INSTALL_DIR ${e2fsprogs_SOURCE_DIR}/build/libext2fs CACHE STRING "") + + add_custom_command( +diff --git a/CMake/Findphoton.cmake b/CMake/Findphoton.cmake +index c905bd9..cdc72d2 100644 +--- a/CMake/Findphoton.cmake ++++ b/CMake/Findphoton.cmake +@@ -17,8 +17,8 @@ else() + endif() + + if (BUILD_CURL_FROM_SOURCE) +- find_package(openssl REQUIRED) +- find_package(curl REQUIRED) ++ find_package(OpenSSL REQUIRED) ++ find_package(CURL REQUIRED) + add_dependencies(photon_obj CURL::libcurl OpenSSL::SSL OpenSSL::Crypto) + endif() + +diff --git a/CMake/Findrapidjson.cmake b/CMake/Findrapidjson.cmake +deleted file mode 100644 +index 79bc3d7..0000000 +--- a/CMake/Findrapidjson.cmake ++++ /dev/null +@@ -1,12 +0,0 @@ +-FetchContent_Declare( +- rapidjson +- GIT_REPOSITORY https://github.com/Tencent/rapidjson.git +- GIT_TAG 80b6d1c83402a5785c486603c5611923159d0894 +- GIT_SUBMODULES "" +-) +-FetchContent_GetProperties(rapidjson) +-if (NOT rapidjson_POPULATED) +- FetchContent_Populate(rapidjson) +-endif() +- +-add_definitions("-DRAPIDJSON_HAS_STDSTRING=1") +\ No newline at end of file +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 753b081..f6beb46 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -44,19 +44,23 @@ set(CMAKE_CXX_STANDARD_REQUIRED on) + set(ENABLE_MIMIC_VDSO off) + + option(BUILD_CURL_FROM_SOURCE "Compile static libcurl" off) ++option(BUILD_STREAM_CONVERTOR "Build the stream convertor" on) + option(ORIGIN_EXT2FS "Use original libext2fs" off) ++ + find_package(photon REQUIRED) + find_package(tcmu REQUIRED) +-find_package(yaml-cpp) +-if (NOT yaml-cpp_FOUND) +- FetchContent_Declare( +- yaml-cpp +- GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git +- GIT_TAG 0.8.0 +- ) +- FetchContent_MakeAvailable(yaml-cpp) +-endif() + ++if(BUILD_STREAM_CONVERTOR) ++ find_package(yaml-cpp) ++ if (NOT yaml-cpp_FOUND) ++ FetchContent_Declare( ++ yaml-cpp ++ GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git ++ GIT_TAG 0.8.0 ++ ) ++ FetchContent_MakeAvailable(yaml-cpp) ++ endif() ++endif() + + if(BUILD_TESTING) + enable_testing() +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 4d0e696..69652f3 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -1,7 +1,7 @@ +-find_package(curl REQUIRED) +-find_package(openssl REQUIRED) ++find_package(CURL REQUIRED) ++find_package(OpenSSL REQUIRED) + find_package(aio REQUIRED) +-find_package(rapidjson REQUIRED) ++find_package(RapidJSON REQUIRED MODULE) + + link_libraries(rt pthread resolv) + +@@ -19,7 +19,7 @@ add_library(overlaybd_image_lib + target_include_directories(overlaybd_image_lib PUBLIC + ${CURL_INCLUDE_DIRS} + ${OPENSSL_INCLUDE_DIR} +- ${rapidjson_SOURCE_DIR}/include ++ ${RAPIDJSON_INCLUDE_DIRS} + ${PHOTON_INCLUDE_DIR} + ) + +@@ -39,7 +39,7 @@ target_include_directories(overlaybd-tcmu PUBLIC + ${TCMU_INCLUDE_DIR} + ${CURL_INCLUDE_DIRS} + ${OPENSSL_INCLUDE_DIR} +- ${rapidjson_SOURCE_DIR}/include ++ ${RAPIDJSON_INCLUDE_DIRS} + ${PHOTON_INCLUDE_DIR} + ) + target_link_libraries(overlaybd-tcmu +diff --git a/src/overlaybd/CMakeLists.txt b/src/overlaybd/CMakeLists.txt +index 1c5a912..af095b7 100644 +--- a/src/overlaybd/CMakeLists.txt ++++ b/src/overlaybd/CMakeLists.txt +@@ -6,7 +6,10 @@ add_subdirectory(cache) + add_subdirectory(tar) + add_subdirectory(gzip) + add_subdirectory(gzindex) +-add_subdirectory(stream_convertor) ++ ++if(BUILD_STREAM_CONVERTOR) ++ add_subdirectory(stream_convertor) ++endif() + + add_library(overlaybd_lib INTERFACE) + target_include_directories(overlaybd_lib INTERFACE +diff --git a/src/overlaybd/cache/ocf_cache/test/CMakeLists.txt b/src/overlaybd/cache/ocf_cache/test/CMakeLists.txt +index 6c629cc..9476e11 100644 +--- a/src/overlaybd/cache/ocf_cache/test/CMakeLists.txt ++++ b/src/overlaybd/cache/ocf_cache/test/CMakeLists.txt +@@ -1,7 +1,7 @@ + include_directories($ENV{GFLAGS}/include) + link_directories($ENV{GFLAGS}/lib) + +-find_package(curl REQUIRED) ++find_package(CURL REQUIRED) + + add_executable(ocf_perf_test ocf_perf_test.cpp) + target_include_directories( +diff --git a/src/overlaybd/registryfs/CMakeLists.txt b/src/overlaybd/registryfs/CMakeLists.txt +index 7ce30ab..a7f59e1 100644 +--- a/src/overlaybd/registryfs/CMakeLists.txt ++++ b/src/overlaybd/registryfs/CMakeLists.txt +@@ -1,10 +1,10 @@ + file(GLOB SOURCE_REGISTRYFS "*.cpp") + +-find_package(curl REQUIRED) ++find_package(CURL REQUIRED) + + add_library(registryfs_lib STATIC ${SOURCE_REGISTRYFS}) + target_include_directories(registryfs_lib PUBLIC + ${CURL_INCLUDE_DIRS} +- ${rapidjson_SOURCE_DIR}/include ++ ${RAPIDJSON_INCLUDE_DIRS} + ${PHOTON_INCLUDE_DIR} + ) +diff --git a/src/overlaybd/stream_convertor/CMakeLists.txt b/src/overlaybd/stream_convertor/CMakeLists.txt +index d0465e5..19f1acd 100644 +--- a/src/overlaybd/stream_convertor/CMakeLists.txt ++++ b/src/overlaybd/stream_convertor/CMakeLists.txt +@@ -3,7 +3,7 @@ file(GLOB SOURCE_SERV "*.cpp") + add_executable(overlaybd-streamConv ${SOURCE_SERV}) + target_include_directories(overlaybd-streamConv PUBLIC + ${PHOTON_INCLUDE_DIR} +- ${rapidjson_SOURCE_DIR}/include ++ ${RAPIDJSON_INCLUDE_DIRS} + ) + target_link_libraries(overlaybd-streamConv + photon_static +diff --git a/src/overlaybd/tar/erofs/test/CMakeLists.txt b/src/overlaybd/tar/erofs/test/CMakeLists.txt +index db03d8b..0c10f34 100644 +--- a/src/overlaybd/tar/erofs/test/CMakeLists.txt ++++ b/src/overlaybd/tar/erofs/test/CMakeLists.txt +@@ -12,7 +12,7 @@ target_link_libraries(erofs_simple_test gtest gtest_main pthread photon_static + + target_include_directories(erofs_simple_test PUBLIC + ${PHOTON_INCLUDE_DIR} +- ${rapidjson_SOURCE_DIR}/include ++ ${RAPIDJSON_INCLUDE_DIRS} + ) + + add_test( +@@ -28,7 +28,7 @@ target_link_libraries(erofs_stress_test gtest gtest_main pthread photon_static + + target_include_directories(erofs_stress_test PUBLIC + ${PHOTON_INCLUDE_DIR} +- ${rapidjson_SOURCE_DIR}/include ++ ${RAPIDJSON_INCLUDE_DIRS} + ) + + add_test( +diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt +index f613a09..15336c9 100644 +--- a/src/test/CMakeLists.txt ++++ b/src/test/CMakeLists.txt +@@ -7,7 +7,7 @@ link_directories($ENV{GTEST}/lib) + add_executable(image_service_test image_service_test.cpp) + target_include_directories(image_service_test PUBLIC + ${PHOTON_INCLUDE_DIR} +- ${rapidjson_SOURCE_DIR}/include ++ ${RAPIDJSON_INCLUDE_DIRS} + ) + target_link_libraries(image_service_test gtest gtest_main gflags pthread photon_static overlaybd_lib overlaybd_image_lib) + +@@ -34,14 +34,14 @@ gtest + + target_include_directories(simple_credsrv_test PUBLIC + ${PHOTON_INCLUDE_DIR} +- ${rapidjson_SOURCE_DIR}/include ++ ${RAPIDJSON_INCLUDE_DIRS} + $ENV{GTEST}/googletest/include + ) + + add_executable(trace_test trace_test.cpp ../tools/comm_func.cpp) + target_include_directories(trace_test PUBLIC + ${PHOTON_INCLUDE_DIR} +- ${rapidjson_SOURCE_DIR}/include ++ ${RAPIDJSON_INCLUDE_DIRS} + ) + target_link_libraries(trace_test gtest gtest_main gflags pthread photon_static overlaybd_lib overlaybd_image_lib) + +diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt +index b551b84..ecf5c32 100644 +--- a/src/tools/CMakeLists.txt ++++ b/src/tools/CMakeLists.txt +@@ -17,12 +17,12 @@ target_include_directories(overlaybd-zfile PUBLIC ${PHOTON_INCLUDE_DIR}) + target_link_libraries(overlaybd-zfile photon_static overlaybd_lib) + + add_executable(overlaybd-apply overlaybd-apply.cpp) +-target_include_directories(overlaybd-apply PUBLIC ${PHOTON_INCLUDE_DIR} ${rapidjson_SOURCE_DIR}/include) ++target_include_directories(overlaybd-apply PUBLIC ${PHOTON_INCLUDE_DIR} ${RAPIDJSON_INCLUDE_DIRS}) + target_link_libraries(overlaybd-apply photon_static overlaybd_lib overlaybd_image_lib checksum_lib) + set_target_properties(overlaybd-apply PROPERTIES INSTALL_RPATH "/opt/overlaybd/lib") + + add_executable(turboOCI-apply turboOCI-apply.cpp) +-target_include_directories(turboOCI-apply PUBLIC ${PHOTON_INCLUDE_DIR} ${rapidjson_SOURCE_DIR}/include) ++target_include_directories(turboOCI-apply PUBLIC ${PHOTON_INCLUDE_DIR} ${RAPIDJSON_INCLUDE_DIRS}) + target_link_libraries(turboOCI-apply photon_static overlaybd_lib overlaybd_image_lib) + set_target_properties(turboOCI-apply PROPERTIES INSTALL_RPATH "/opt/overlaybd/lib") + diff --git a/sdk_container/src/third_party/coreos-overlay/sys-fs/overlaybd/files/yaml-cpp-cmake-4.0.patch b/sdk_container/src/third_party/coreos-overlay/sys-fs/overlaybd/files/yaml-cpp-cmake-4.0.patch deleted file mode 100644 index 65bc465f0fb..00000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-fs/overlaybd/files/yaml-cpp-cmake-4.0.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 10a573aa85db4eeb13df9e9cfa7047a0dc55d334 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= -Date: Mon, 24 Mar 2025 08:32:25 +0100 -Subject: [PATCH] [cmake] Require minimum CMake version 3.5 - -Soon CMake 4.0 will be released. It requires that projects -set a minimum required CMake version of 3.5. There is a -workaround with an additional flag, but it would is better -to increase the minimum required version. ---- - CMakeLists.txt | 5 +++-- - test/CMakeLists.txt | 1 - - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 46dc180..ee04e75 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,5 +1,6 @@ --# 3.5 is actually available almost everywhere, but this a good minimum --cmake_minimum_required(VERSION 3.4) -+# 3.5 is actually available almost everywhere. -+# 3.30 as the upper policy limit avoids CMake deprecation warnings. -+cmake_minimum_required(VERSION 3.5...3.30) - - # enable MSVC_RUNTIME_LIBRARY target property - # see https://cmake.org/cmake/help/latest/policy/CMP0091.html -diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt -index 351b03f..210e629 100644 ---- a/test/CMakeLists.txt -+++ b/test/CMakeLists.txt -@@ -2,7 +2,6 @@ find_package(Threads REQUIRED) - - set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) - set(BUILD_MOCK ON CACHE BOOL "" FORCE) --set(CMAKE_POLICY_DEFAULT_CMP0048 NEW) - - add_subdirectory( - "${CMAKE_CURRENT_SOURCE_DIR}/gtest-1.11.0" --- -2.51.0 - diff --git a/sdk_container/src/third_party/coreos-overlay/sys-fs/overlaybd/metadata.xml b/sdk_container/src/third_party/coreos-overlay/sys-fs/overlaybd/metadata.xml index 74fd16aaef1..45f1aa97d4c 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-fs/overlaybd/metadata.xml +++ b/sdk_container/src/third_party/coreos-overlay/sys-fs/overlaybd/metadata.xml @@ -7,6 +7,7 @@ Accelerate CRC calculations with Intel Data Streaming Accelerator + Accelerate CRC calculations with Intel Intelligent Storage Acceleration Library Accelerate compression with Intel QuickAssist Technology diff --git a/sdk_container/src/third_party/coreos-overlay/sys-fs/overlaybd/overlaybd-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-fs/overlaybd/overlaybd-9999.ebuild index 94e9e0e0ad6..6845197f670 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-fs/overlaybd/overlaybd-9999.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sys-fs/overlaybd/overlaybd-9999.ebuild @@ -3,31 +3,39 @@ EAPI=8 -inherit cmake git-r3 systemd tmpfiles +inherit cmake systemd tmpfiles DESCRIPTION="Novel layering block-level image format for containers" HOMEPAGE="https://containerd.github.io/overlaybd" -EGIT_REPO_URI="https://github.com/containerd/overlaybd.git" if [[ ${PV} == 9999* ]]; then - KEYWORDS="~amd64 ~arm64" + EGIT_REPO_URI="https://github.com/containerd/overlaybd.git" + inherit git-r3 + RESTRICT="network-sandbox" else - EGIT_COMMIT="v${PV}" + EROFS_UTILS_COMMIT="eec6f7a2755dfccc8f655aa37cf6f26db9164e60" + PHOTON_COMMIT="v0.6.17" + TCMU_COMMIT="813fd65361bb2f348726b9c41478a44211847614" + OCF_COMMIT="c2dd2259e47c2e5e72dc77f99d0150a5d05496d7" + SRC_URI="https://github.com/containerd/overlaybd/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz + https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/snapshot/erofs-utils-${EROFS_UTILS_COMMIT}.tar.gz + https://github.com/alibaba/PhotonLibOS/archive/${PHOTON_COMMIT}.tar.gz -> PhotonLibOS-${PHOTON_COMMIT}.tar.gz + https://github.com/data-accelerator/photon-libtcmu/archive/${TCMU_COMMIT}.tar.gz -> photon-libtcmu-${TCMU_COMMIT}.tar.gz + https://github.com/Open-CAS/ocf/archive/${OCF_COMMIT}.tar.gz -> ocf-${OCF_COMMIT}.tar.gz" KEYWORDS="amd64 arm64" fi LICENSE="Apache-2.0" SLOT="0" -IUSE="cpu_flags_x86_avx2 dsa qat isal" -REQUIRED_USE="dsa? ( cpu_flags_x86_avx2 )" -RESTRICT="test" - -# FIXME HACK ALERT: overlaybd build pulls sources during src_configure. -# (https://github.com/alibaba/PhotonLibOS.git/ -# This fails if network sandbox is enabled. -RESTRICT="${RESTRICT} network-sandbox" +IUSE="cpu_flags_x86_avx2 cpu_flags_x86_avx512f dsa isal qat test" +REQUIRED_USE=" + dsa? ( cpu_flags_x86_avx2 ) + isal? ( cpu_flags_x86_avx512f ) +" +RESTRICT+=" test" # Mostly fails with operation not supported? +PROPERTIES="test_network" -DEPEND=" +RDEPEND=" app-arch/zstd:= dev-libs/libaio dev-libs/libnl:3 @@ -38,38 +46,64 @@ DEPEND=" dsa? ( sys-apps/pciutils ) qat? ( sys-apps/pciutils ) " - -RDEPEND=" - ${DEPEND} +DEPEND=" + ${RDEPEND} + dev-libs/rapidjson + test? ( + dev-cpp/gflags + dev-cpp/gtest + ) +" +BDEPEND=" + virtual/pkgconfig " PATCHES=( "${FILESDIR}"/0001-Patch-Photon-after-fetching-to-fix-cross-issues.patch - "${FILESDIR}"/0002-Patch-yaml-cpp-after-fetching-to-fix-cmake-issues.patch + "${FILESDIR}"/${PN}-offline-build.patch ) src_prepare() { cmake_src_prepare - sed -i "s:@FILESDIR@:${FILESDIR}:g" CMakeLists.txt CMake/Findphoton.cmake || die + sed -i "s:@FILESDIR@:${FILESDIR}:g" CMake/Findphoton.cmake || die + + if [[ ${PV} != 9999* ]]; then + rmdir src/overlaybd/cache/ocf_cache/ocf || die + ln -sr "${WORKDIR}/ocf-${OCF_COMMIT#v}" src/overlaybd/cache/ocf_cache/ocf || die + + mkdir -p "${BUILD_DIR}"/_deps || die + cd "${BUILD_DIR}"/_deps || die + + ln -sr "${WORKDIR}/erofs-utils-${EROFS_UTILS_COMMIT}" erofs-utils-src || die + ln -sr "${WORKDIR}/PhotonLibOS-${PHOTON_COMMIT#v}" photon-src || die + ln -sr "${WORKDIR}/photon-libtcmu-${TCMU_COMMIT#v}" tcmu-src || die + + cd photon-src || die + eapply "${FILESDIR}"/photon-cross.patch + fi } src_configure() { # crc32c.cpp explicitly uses special instructions but checks for them at - # runtime. Only DSA hard requires at least AVX2. However, the code doesn't - # try especially hard to avoid these instructions from being implicitly used - # outside these runtime checks. :( - # ISAL similarly leads to "illegal instruction" termination on QEMU. + # runtime. However, the code doesn't try especially hard to avoid these + # instructions from being implicitly used outside these runtime checks. :( local mycmakeargs=( -DBUILD_SHARED_LIBS=no - -DBUILD_TESTING=no + -DBUILD_STREAM_CONVERTOR=no + -DBUILD_TESTING=$(usex test) -DENABLE_DSA=$(usex dsa) -DENABLE_ISAL=$(usex isal) -DENABLE_QAT=$(usex qat) -DORIGIN_EXT2FS=yes ) + # Ensure we're building offline. + [[ ${PV} == 9999* ]] || mycmakeargs+=( -DFETCHCONTENT_FULLY_DISCONNECTED=yes ) + # Make erofs-utils configure work when cross-compiling. + # Set dummy gflags/gtest dirs because they are in standard dirs anyway. host_alias="${CHOST}" build_alias="${CBUILD:-${CHOST}}" \ + GFLAGS=/no/where GTEST=/no/where \ cmake_src_configure } diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/Manifest b/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/Manifest new file mode 100644 index 00000000000..b922188e51c --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/Manifest @@ -0,0 +1 @@ +DIST rapidjson-1.1.0.tar.gz 1019402 BLAKE2B e1564b3cfa020f76437b0a35048a42ff2cd98b5ce285e63f228e158885182e5cecda13407cdf30c03fa39b47cbc579ff0065f6c2682d04b806e8f9ea8d36fc4e SHA512 2e82a4bddcd6c4669541f5945c2d240fb1b4fdd6e239200246d3dd50ce98733f0a4f6d3daa56f865d8c88779c036099c52a9ae85d47ad263686b68a88d832dff diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/files/rapidjson-1.1.0-cmake4.patch b/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/files/rapidjson-1.1.0-cmake4.patch new file mode 100644 index 00000000000..dc28481a239 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/files/rapidjson-1.1.0-cmake4.patch @@ -0,0 +1,19 @@ +https://bugs.gentoo.org/951839 +https://github.com/Tencent/rapidjson/issues/2159 fixed in git already + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-CMAKE_MINIMUM_REQUIRED(VERSION 2.8) ++CMAKE_MINIMUM_REQUIRED(VERSION 3.5) + if(POLICY CMP0025) + # detect Apple's Clang + cmake_policy(SET CMP0025 NEW) +--- a/example/CMakeLists.txt ++++ b/example/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 2.8) ++cmake_minimum_required(VERSION 3.5) + + if(POLICY CMP0054) + cmake_policy(SET CMP0054 NEW) diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/files/rapidjson-1.1.0-doc-build.patch b/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/files/rapidjson-1.1.0-doc-build.patch new file mode 100644 index 00000000000..6e5f70c72c5 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/files/rapidjson-1.1.0-doc-build.patch @@ -0,0 +1,41 @@ +https://github.com/Tencent/rapidjson/commit/bbdf5d1d4b40891c82e5c1946d32dfc841926066 + +From bbdf5d1d4b40891c82e5c1946d32dfc841926066 Mon Sep 17 00:00:00 2001 +From: Christopher Warrington +Date: Tue, 5 Sep 2017 16:58:09 -0700 +Subject: [PATCH] Fix Windows doc build MSBuild error MSB6001 + +When using a MSBuild-based CMake generator like 'Visual Studio 15 2017 +Win64', the doc build was failing with the error 'MSB6001: Invalid +command line switch for "cmd.exe". Illegal characters in path.' + +This was due to the dependency on Doxyfile*, which wasn't expanded by +CMake. + +The fix is to expand this glob in CMake before specifying the custom +command's dependencies. + +Partial fix for https://github.com/miloyip/rapidjson/issues/622 + +diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt +index c1f165a3..c5345ba6 100644 +--- a/doc/CMakeLists.txt ++++ b/doc/CMakeLists.txt +@@ -10,11 +10,13 @@ ELSE() + CONFIGURE_FILE(Doxyfile.in Doxyfile @ONLY) + CONFIGURE_FILE(Doxyfile.zh-cn.in Doxyfile.zh-cn @ONLY) + ++ file(GLOB DOXYFILES ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile*) ++ + add_custom_command(OUTPUT html + COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile + COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.zh-cn + COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/html +- DEPENDS ${MARKDOWN_DOC} ${SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile* ++ DEPENDS ${MARKDOWN_DOC} ${SOURCES} ${DOXYFILES} + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../ + ) + +-- +2.45.2 + diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/files/rapidjson-1.1.0-gcc-7.patch b/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/files/rapidjson-1.1.0-gcc-7.patch new file mode 100644 index 00000000000..925d175a899 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/files/rapidjson-1.1.0-gcc-7.patch @@ -0,0 +1,46 @@ +From fe19b7b6016d446722621fb407738209d1a911e8 Mon Sep 17 00:00:00 2001 +From: Harry Wong +Date: Thu, 4 May 2017 10:08:48 +0800 +Subject: [PATCH 1/2] Supress implicit fallthrough in GCC + +--- + include/rapidjson/internal/regex.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/include/rapidjson/internal/regex.h b/include/rapidjson/internal/regex.h +index 1369ea266..6d110bdbd 100644 +--- a/include/rapidjson/internal/regex.h ++++ b/include/rapidjson/internal/regex.h +@@ -29,6 +29,7 @@ RAPIDJSON_DIAG_OFF(implicit-fallthrough) + #ifdef __GNUC__ + RAPIDJSON_DIAG_PUSH + RAPIDJSON_DIAG_OFF(effc++) ++RAPIDJSON_DIAG_OFF(implicit-fallthrough) + #endif + + #ifdef _MSC_VER + +From cba45fe9de6923b858edb0780e257b7257aa4f7b Mon Sep 17 00:00:00 2001 +From: Harry Wong +Date: Thu, 4 May 2017 10:32:45 +0800 +Subject: [PATCH 2/2] Onley apply to GCC 7 + +--- + include/rapidjson/internal/regex.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/include/rapidjson/internal/regex.h b/include/rapidjson/internal/regex.h +index 6d110bdbd..e1a2faae5 100644 +--- a/include/rapidjson/internal/regex.h ++++ b/include/rapidjson/internal/regex.h +@@ -29,8 +29,10 @@ RAPIDJSON_DIAG_OFF(implicit-fallthrough) + #ifdef __GNUC__ + RAPIDJSON_DIAG_PUSH + RAPIDJSON_DIAG_OFF(effc++) ++#if __GNUC__ >= 7 + RAPIDJSON_DIAG_OFF(implicit-fallthrough) + #endif ++#endif + + #ifdef _MSC_VER + RAPIDJSON_DIAG_PUSH diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/files/rapidjson-1.1.0-gcc14-const.patch b/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/files/rapidjson-1.1.0-gcc14-const.patch new file mode 100644 index 00000000000..0bc9e73b568 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/files/rapidjson-1.1.0-gcc14-const.patch @@ -0,0 +1,20 @@ +https://bugs.gentoo.org/914583 +https://github.com/Tencent/rapidjson/commit/3b2441b87f99ab65f37b141a7b548ebadb607b96 +https://github.com/Tencent/rapidjson/issues/718 + +From 3b2441b87f99ab65f37b141a7b548ebadb607b96 Mon Sep 17 00:00:00 2001 +From: Janusz Chorko +Date: Fri, 26 Aug 2016 21:17:38 +0200 +Subject: [PATCH] Removed non-compiling assignment operator. Fixed #718 + +--- a/include/rapidjson/document.h ++++ b/include/rapidjson/document.h +@@ -316,8 +316,6 @@ struct GenericStringRef { + + GenericStringRef(const GenericStringRef& rhs) : s(rhs.s), length(rhs.length) {} + +- GenericStringRef& operator=(const GenericStringRef& rhs) { s = rhs.s; length = rhs.length; } +- + //! implicit conversion to plain CharType pointer + operator const Ch *() const { return s; } + diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/files/rapidjson-1.1.0-system_gtest.patch b/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/files/rapidjson-1.1.0-system_gtest.patch new file mode 100644 index 00000000000..a952a076dc4 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/files/rapidjson-1.1.0-system_gtest.patch @@ -0,0 +1,44 @@ +--- a/CMakeModules/FindGTestSrc.cmake ++++ b/CMakeModules/FindGTestSrc.cmake +@@ -1,30 +1,9 @@ +- +-SET(GTEST_SEARCH_PATH +- "${GTEST_SOURCE_DIR}" +- "${CMAKE_CURRENT_LIST_DIR}/../thirdparty/gtest/googletest") +- +-IF(UNIX) +- IF(RAPIDJSON_BUILD_THIRDPARTY_GTEST) +- LIST(APPEND GTEST_SEARCH_PATH "/usr/src/gtest") +- ELSE() +- LIST(INSERT GTEST_SEARCH_PATH 1 "/usr/src/gtest") +- ENDIF() +-ENDIF() +- +-FIND_PATH(GTEST_SOURCE_DIR +- NAMES CMakeLists.txt src/gtest_main.cc +- PATHS ${GTEST_SEARCH_PATH}) +- +- + # Debian installs gtest include directory in /usr/include, thus need to look + # for include directory separately from source directory. + FIND_PATH(GTEST_INCLUDE_DIR + NAMES gtest/gtest.h +- PATH_SUFFIXES include +- HINTS ${GTEST_SOURCE_DIR} +- PATHS ${GTEST_SEARCH_PATH}) ++ PATH_SUFFIXES include) + + INCLUDE(FindPackageHandleStandardArgs) + find_package_handle_standard_args(GTestSrc DEFAULT_MSG +- GTEST_SOURCE_DIR + GTEST_INCLUDE_DIR) +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -8,7 +8,6 @@ + set(gtest_force_shared_crt ON) + endif() + +- add_subdirectory(${GTEST_SOURCE_DIR} ${CMAKE_BINARY_DIR}/googletest) + include_directories(SYSTEM ${GTEST_INCLUDE_DIR}) + + set(TEST_LIBRARIES gtest gtest_main) diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/files/rapidjson-1.1.0-valgrind_optional.patch b/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/files/rapidjson-1.1.0-valgrind_optional.patch new file mode 100644 index 00000000000..772eabe8c6d --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/files/rapidjson-1.1.0-valgrind_optional.patch @@ -0,0 +1,21 @@ +https://github.com/Tencent/rapidjson/issues/1808 + +--- a/test/unittest/CMakeLists.txt ++++ b/test/unittest/CMakeLists.txt +@@ -77,12 +77,15 @@ + COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin) + +-if(NOT MSVC) ++find_program(VALGRIND_EXECUTABLE valgrind) ++if(VALGRIND_EXECUTABLE) + # Not running SIMD.* unit test cases for Valgrind + add_test(NAME valgrind_unittest + COMMAND valgrind --leak-check=full --error-exitcode=1 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest --gtest_filter=-SIMD.* + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin) ++endif(VALGRIND_EXECUTABLE) + ++if(NOT MSVC) + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + add_test(NAME symbol_check + COMMAND sh -c "objdump -t -C libnamespacetest.a | grep rapidjson ; test $? -ne 0" diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/files/rapidjson-1.1.1-valgrind_optional.patch b/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/files/rapidjson-1.1.1-valgrind_optional.patch new file mode 100644 index 00000000000..e05c2800087 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/files/rapidjson-1.1.1-valgrind_optional.patch @@ -0,0 +1,21 @@ +https://github.com/Tencent/rapidjson/issues/1808 + +--- a/test/unittest/CMakeLists.txt ++++ b/test/unittest/CMakeLists.txt +@@ -78,12 +78,15 @@ + COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin) + +-if(NOT MSVC) ++find_program(VALGRIND_EXECUTABLE valgrind) ++if(VALGRIND_EXECUTABLE) + # Not running SIMD.* unit test cases for Valgrind + add_test(NAME valgrind_unittest + COMMAND valgrind --suppressions=${CMAKE_SOURCE_DIR}/test/valgrind.supp --leak-check=full --error-exitcode=1 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest --gtest_filter=-SIMD.* + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin) ++endif(VALGRIND_EXECUTABLE) + ++if(NOT MSVC) + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + add_test(NAME symbol_check + COMMAND sh -c "objdump -t -C libnamespacetest.a | grep rapidjson ; test $? -ne 0" diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/metadata.xml b/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/metadata.xml new file mode 100644 index 00000000000..a3be7bec65f --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/metadata.xml @@ -0,0 +1,12 @@ + + + + + candrews@gentoo.org + Craig Andrews + + + https://github.com/miloyip/rapidjson/issues + miloyip/rapidjson + + diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/rapidjson-1.1.0-r4.ebuild b/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/rapidjson-1.1.0-r4.ebuild new file mode 100644 index 00000000000..e2df1e4023b --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/rapidjson-1.1.0-r4.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake + +DESCRIPTION="A fast JSON parser/generator for C++ with both SAX/DOM style API" +HOMEPAGE="https://rapidjson.org/" + +if [[ ${PV} == *9999 ]] ; then + EGIT_REPO_URI="https://github.com/miloyip/rapidjson.git" + EGIT_SUBMODULES=() + inherit git-r3 +else + SRC_URI="https://github.com/miloyip/rapidjson/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="amd64 arm arm64 ~hppa ~loong ppc ppc64 ~riscv ~s390 ~sparc x86" + S="${WORKDIR}/rapidjson-${PV}" +fi + +LICENSE="MIT" +SLOT="0" +IUSE="doc examples test" +RESTRICT="!test? ( test )" + +BDEPEND=" + doc? ( app-text/doxygen ) + test? ( dev-cpp/gtest ) +" + +PATCHES=( + "${FILESDIR}/${P}-gcc-7.patch" + "${FILESDIR}/${P}-system_gtest.patch" + "${FILESDIR}/${P}-valgrind_optional.patch" + "${FILESDIR}/${P}-gcc14-const.patch" +) + +src_prepare() { + cmake_src_prepare + + sed -i -e 's| -march=native||g' CMakeLists.txt || die + sed -i -e 's| -Werror||g' CMakeLists.txt example/CMakeLists.txt test/unittest/CMakeLists.txt || die +} + +src_configure() { + local mycmakeargs=( + -DDOC_INSTALL_DIR="${EPREFIX}/usr/share/doc/${PF}" + -DLIB_INSTALL_DIR="${EPREFIX}/usr/$(get_libdir)" + -DRAPIDJSON_BUILD_CXX11=OFF # latest gtest requires C++14 or later + -DRAPIDJSON_BUILD_DOC=$(usex doc) + -DRAPIDJSON_BUILD_EXAMPLES=$(usex examples) + -DRAPIDJSON_BUILD_TESTS=$(usex test) + -DRAPIDJSON_BUILD_THIRDPARTY_GTEST=OFF + ) + use test && mycmakeargs+=( + -DVALGRIND_EXECUTABLE= + ) + cmake_src_configure +} diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/rapidjson-1.1.0-r5.ebuild b/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/rapidjson-1.1.0-r5.ebuild new file mode 100644 index 00000000000..75d7d6cc093 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/rapidjson-1.1.0-r5.ebuild @@ -0,0 +1,61 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake + +DESCRIPTION="A fast JSON parser/generator for C++ with both SAX/DOM style API" +HOMEPAGE="https://rapidjson.org/" + +if [[ ${PV} == *9999 ]] ; then + EGIT_REPO_URI="https://github.com/miloyip/rapidjson.git" + EGIT_SUBMODULES=() + inherit git-r3 +else + SRC_URI="https://github.com/miloyip/rapidjson/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="amd64 arm arm64 ~hppa ~loong ppc ppc64 ~riscv ~s390 ~sparc x86" + S="${WORKDIR}/rapidjson-${PV}" +fi + +LICENSE="MIT" +SLOT="0" +IUSE="doc examples test" +RESTRICT="!test? ( test )" + +BDEPEND=" + doc? ( app-text/doxygen ) + test? ( dev-cpp/gtest ) +" + +PATCHES=( + "${FILESDIR}/${P}-gcc-7.patch" + "${FILESDIR}/${P}-system_gtest.patch" + "${FILESDIR}/${P}-valgrind_optional.patch" + "${FILESDIR}/${P}-gcc14-const.patch" + "${FILESDIR}/${P}-cmake4.patch" + "${FILESDIR}/${P}-doc-build.patch" +) + +src_prepare() { + cmake_src_prepare + + sed -i -e 's| -march=native||g' CMakeLists.txt || die + sed -i -e 's| -Werror||g' CMakeLists.txt example/CMakeLists.txt test/unittest/CMakeLists.txt || die +} + +src_configure() { + local mycmakeargs=( + -DDOC_INSTALL_DIR="${EPREFIX}/usr/share/doc/${PF}" + -DLIB_INSTALL_DIR="${EPREFIX}/usr/$(get_libdir)" + -DRAPIDJSON_BUILD_CXX11=OFF # latest gtest requires C++14 or later + -DRAPIDJSON_BUILD_DOC=$(usex doc) + -DRAPIDJSON_BUILD_EXAMPLES=$(usex examples) + -DRAPIDJSON_BUILD_TESTS=$(usex test) + -DRAPIDJSON_BUILD_THIRDPARTY_GTEST=OFF + ) + use test && mycmakeargs+=( + -DVALGRIND_EXECUTABLE= + ) + cmake_src_configure +} diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/rapidjson-9999.ebuild b/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/rapidjson-9999.ebuild new file mode 100644 index 00000000000..b98b72a191b --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/rapidjson-9999.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake + +DESCRIPTION="A fast JSON parser/generator for C++ with both SAX/DOM style API" +HOMEPAGE="https://rapidjson.org/" + +if [[ ${PV} == *9999 ]] ; then + EGIT_REPO_URI="https://github.com/miloyip/rapidjson.git" + EGIT_SUBMODULES=() + inherit git-r3 +else + SRC_URI="https://github.com/miloyip/rapidjson/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86" + S="${WORKDIR}/rapidjson-${PV}" +fi + +LICENSE="MIT" +SLOT="0" +IUSE="doc examples test" +RESTRICT="!test? ( test )" + +BDEPEND=" + doc? ( app-text/doxygen ) + test? ( dev-cpp/gtest ) +" + +PATCHES=( + "${FILESDIR}/${PN}-1.1.0-system_gtest.patch" + "${FILESDIR}/${PN}-1.1.1-valgrind_optional.patch" +) + +src_prepare() { + cmake_src_prepare + + sed -i -e 's| -march=native||g' CMakeLists.txt || die + sed -i -e 's| -mcpu=native||g' CMakeLists.txt || die + sed -i -e 's| -Werror||g' CMakeLists.txt || die +} + +src_configure() { + local mycmakeargs=( + -DDOC_INSTALL_DIR="${EPREFIX}/usr/share/doc/${PF}" + -DLIB_INSTALL_DIR="${EPREFIX}/usr/$(get_libdir)" + -DRAPIDJSON_BUILD_CXX11=OFF # latest gtest requires C++14 or later + -DRAPIDJSON_BUILD_CXX17=ON + -DRAPIDJSON_BUILD_DOC=$(usex doc) + -DRAPIDJSON_BUILD_EXAMPLES=$(usex examples) + -DRAPIDJSON_BUILD_TESTS=$(usex test) + -DRAPIDJSON_BUILD_THIRDPARTY_GTEST=OFF + ) + use test && mycmakeargs+=( + -DVALGRIND_EXECUTABLE= + ) + cmake_src_configure +}