mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-05 12:16:41 +02:00
Merge pull request #3620 from flatcar/chewi/non-live-overlaybd
Build overlaybd and accelerated-container-image entirely offline
This commit is contained in:
commit
01ef70d285
@ -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
|
||||
|
||||
@ -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
|
||||
@ -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"
|
||||
|
||||
@ -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.
|
||||
<sys-fs/overlaybd-9999 dsa isal
|
||||
|
||||
5
sdk_container/src/third_party/coreos-overlay/sys-fs/overlaybd/Manifest
vendored
Normal file
5
sdk_container/src/third_party/coreos-overlay/sys-fs/overlaybd/Manifest
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
DIST PhotonLibOS-v0.6.17.tar.gz 1056709 BLAKE2B 47a9f2e484ba09fdd5c879a0a78a659a18404e8ac4b699cfc67f5022f893e2b8467fc4232917d65df147f694c57b0b4b0e8030e63d13b57110361fa61313a381 SHA512 8d03a18d53dbe197268c550dc55c01bbec0a1bd678a337a2e1f1ed62ed2e2aa6114dab211b82eec2ef719d2bd4e3d569b8d37e78fe27d725be2dcc56ad398b70
|
||||
DIST erofs-utils-eec6f7a2755dfccc8f655aa37cf6f26db9164e60.tar.gz 186465 BLAKE2B 4731cd2fe41bad44c655f52106f02c6fe0852fc6c169542af20c0a3fe4502d7df86c8402524c7cc9bb3034c44ea6a9e8ac1ccee649d571916432cef4bfbef909 SHA512 cdd391ec7b0996542061f12bc7ebfb69663373742e52166c7c269e3fa1d18d0b2aada68a826e2e963913089a42fcdbb96c0730aa9b9e1bc44b6d0ca9a7db12f6
|
||||
DIST ocf-c2dd2259e47c2e5e72dc77f99d0150a5d05496d7.tar.gz 364310 BLAKE2B 4b908173db214d578bb8caa172cf3efe765b88e543f56d71bdc525b4565f304f7dc3d58d7b7a496b2150d1fa6107778d50e15159e0e05b7768afbd697acf080e SHA512 d8cb21e8e2372e40301714e7a0e30c2d8c0e7a9067fe90e06c5b36428dc5acf51754d0e005e876e190d50c35105f45cd24737976a602ccd501dd7bd12d75de53
|
||||
DIST overlaybd-1.0.16.tar.gz 713290 BLAKE2B 76bd981395e81ea3f0dcc4f048e6c4c2da2025304cbee22201da289431c6c018267142e8664cba8104ac55e14a778b90a8aa29b01e4313f095d25f12cd505085 SHA512 2a14b4ec0016cdf0b55f93abd8b5bea4ccf1e53527f0bae41bb912a039517ae819acde2b1f20847cbe6c1db119fcadd76b90f9832cc6551ccd3c3ee0ca13ca6f
|
||||
DIST photon-libtcmu-813fd65361bb2f348726b9c41478a44211847614.tar.gz 39008 BLAKE2B ff422842e4433e41f2e4dad6fc73134321f79557c64f4a42576830f95ca191f7d80d7aea5454dea893eb65c1141d90d7a31ed823282b1c0629720533a016f873 SHA512 f92ed165610f6434b5089e7b93754debd70745bd387fe33e88b444bc3c73696c8124513753668269d9ec6dc07a1d6ae4d2cc235778f1461664175ca3517fd013
|
||||
@ -1,25 +0,0 @@
|
||||
From eae89e8432d993417e6f0e17ae519b4e02f72c9b Mon Sep 17 00:00:00 2001
|
||||
From: Krzesimir Nowak <knowak@microsoft.com>
|
||||
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 <knowak@microsoft.com>
|
||||
---
|
||||
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
|
||||
|
||||
312
sdk_container/src/third_party/coreos-overlay/sys-fs/overlaybd/files/overlaybd-offline-build.patch
vendored
Normal file
312
sdk_container/src/third_party/coreos-overlay/sys-fs/overlaybd/files/overlaybd-offline-build.patch
vendored
Normal file
@ -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")
|
||||
|
||||
@ -1,42 +0,0 @@
|
||||
From 10a573aa85db4eeb13df9e9cfa7047a0dc55d334 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= <foss@grueninger.de>
|
||||
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
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
</maintainer>
|
||||
<use>
|
||||
<flag name="dsa">Accelerate CRC calculations with Intel Data Streaming Accelerator</flag>
|
||||
<flag name="isal">Accelerate CRC calculations with Intel Intelligent Storage Acceleration Library</flag>
|
||||
<flag name="qat">Accelerate compression with Intel QuickAssist Technology</flag>
|
||||
</use>
|
||||
<upstream>
|
||||
|
||||
@ -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"
|
||||
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"
|
||||
|
||||
# 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"
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
1
sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/Manifest
vendored
Normal file
1
sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/Manifest
vendored
Normal file
@ -0,0 +1 @@
|
||||
DIST rapidjson-1.1.0.tar.gz 1019402 BLAKE2B e1564b3cfa020f76437b0a35048a42ff2cd98b5ce285e63f228e158885182e5cecda13407cdf30c03fa39b47cbc579ff0065f6c2682d04b806e8f9ea8d36fc4e SHA512 2e82a4bddcd6c4669541f5945c2d240fb1b4fdd6e239200246d3dd50ce98733f0a4f6d3daa56f865d8c88779c036099c52a9ae85d47ad263686b68a88d832dff
|
||||
@ -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)
|
||||
@ -0,0 +1,41 @@
|
||||
https://github.com/Tencent/rapidjson/commit/bbdf5d1d4b40891c82e5c1946d32dfc841926066
|
||||
|
||||
From bbdf5d1d4b40891c82e5c1946d32dfc841926066 Mon Sep 17 00:00:00 2001
|
||||
From: Christopher Warrington <chwarr@microsoft.com>
|
||||
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
|
||||
|
||||
@ -0,0 +1,46 @@
|
||||
From fe19b7b6016d446722621fb407738209d1a911e8 Mon Sep 17 00:00:00 2001
|
||||
From: Harry Wong <harrywong@live.com>
|
||||
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 <harrywong@live.com>
|
||||
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
|
||||
@ -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 <janusz.chorko@apdu.pl>
|
||||
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; }
|
||||
|
||||
@ -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)
|
||||
@ -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"
|
||||
@ -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"
|
||||
12
sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/metadata.xml
vendored
Normal file
12
sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/metadata.xml
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<email>candrews@gentoo.org</email>
|
||||
<name>Craig Andrews</name>
|
||||
</maintainer>
|
||||
<upstream>
|
||||
<bugs-to>https://github.com/miloyip/rapidjson/issues</bugs-to>
|
||||
<remote-id type="github">miloyip/rapidjson</remote-id>
|
||||
</upstream>
|
||||
</pkgmetadata>
|
||||
59
sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/rapidjson-1.1.0-r4.ebuild
vendored
Normal file
59
sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/rapidjson-1.1.0-r4.ebuild
vendored
Normal file
@ -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
|
||||
}
|
||||
61
sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/rapidjson-1.1.0-r5.ebuild
vendored
Normal file
61
sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/rapidjson-1.1.0-r5.ebuild
vendored
Normal file
@ -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
|
||||
}
|
||||
59
sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/rapidjson-9999.ebuild
vendored
Normal file
59
sdk_container/src/third_party/portage-stable/dev-libs/rapidjson/rapidjson-9999.ebuild
vendored
Normal file
@ -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
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user