summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Andrews <candrews@gentoo.org>2020-12-28 11:43:33 -0500
committerCraig Andrews <candrews@gentoo.org>2020-12-28 11:43:56 -0500
commitcf938e7183d49f0da60052ddc884bc99643a49cc (patch)
treef41267cae01e06bec7bf33526457411f52544a25 /dev-libs/rapidjson
parentdev-libs/libzia: Support libftdi:1 (diff)
downloadgentoo-cf938e7183d49f0da60052ddc884bc99643a49cc.tar.gz
gentoo-cf938e7183d49f0da60052ddc884bc99643a49cc.tar.bz2
gentoo-cf938e7183d49f0da60052ddc884bc99643a49cc.zip
dev-libs/rapidjson: Drop dependency on valgrind; remove -march=native
Closes: https://bugs.gentoo.org/760881 Package-Manager: Portage-3.0.12, Repoman-3.0.2 Signed-off-by: Craig Andrews <candrews@gentoo.org>
Diffstat (limited to 'dev-libs/rapidjson')
-rw-r--r--dev-libs/rapidjson/files/rapidjson-1.1.0-system_gtest.patch44
-rw-r--r--dev-libs/rapidjson/files/rapidjson-1.1.0-valgrind_optional.patch21
-rw-r--r--dev-libs/rapidjson/files/rapidjson-1.1.1-valgrind_optional.patch21
-rw-r--r--dev-libs/rapidjson/rapidjson-1.1.0-r3.ebuild54
-rw-r--r--dev-libs/rapidjson/rapidjson-9999.ebuild18
5 files changed, 151 insertions, 7 deletions
diff --git a/dev-libs/rapidjson/files/rapidjson-1.1.0-system_gtest.patch b/dev-libs/rapidjson/files/rapidjson-1.1.0-system_gtest.patch
new file mode 100644
index 000000000000..bdc720e8cf86
--- /dev/null
+++ b/dev-libs/rapidjson/files/rapidjson-1.1.0-system_gtest.patch
@@ -0,0 +1,44 @@
+--- /CMakeModules/FindGTestSrc.cmake
++++ /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)
+--- /test/CMakeLists.txt
++++ /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/dev-libs/rapidjson/files/rapidjson-1.1.0-valgrind_optional.patch b/dev-libs/rapidjson/files/rapidjson-1.1.0-valgrind_optional.patch
new file mode 100644
index 000000000000..071a3d2392df
--- /dev/null
+++ b/dev-libs/rapidjson/files/rapidjson-1.1.0-valgrind_optional.patch
@@ -0,0 +1,21 @@
+https://github.com/Tencent/rapidjson/issues/1808
+
+--- /test/unittest/CMakeLists.txt
++++ /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/dev-libs/rapidjson/files/rapidjson-1.1.1-valgrind_optional.patch b/dev-libs/rapidjson/files/rapidjson-1.1.1-valgrind_optional.patch
new file mode 100644
index 000000000000..b40a39fb13db
--- /dev/null
+++ b/dev-libs/rapidjson/files/rapidjson-1.1.1-valgrind_optional.patch
@@ -0,0 +1,21 @@
+https://github.com/Tencent/rapidjson/issues/1808
+
+--- /test/unittest/CMakeLists.txt
++++ /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/dev-libs/rapidjson/rapidjson-1.1.0-r3.ebuild b/dev-libs/rapidjson/rapidjson-1.1.0-r3.ebuild
new file mode 100644
index 000000000000..546127329df2
--- /dev/null
+++ b/dev-libs/rapidjson/rapidjson-1.1.0-r3.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake
+
+DESCRIPTION="A fast JSON parser/generator for C++ with both SAX/DOM style API"
+HOMEPAGE="https://rapidjson.org/"
+
+LICENSE="MIT"
+IUSE="doc examples test"
+RESTRICT="!test? ( test )"
+SLOT="0"
+
+if [[ ${PV} == *9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/miloyip/rapidjson.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/miloyip/rapidjson/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+ S="${WORKDIR}/rapidjson-${PV}"
+fi
+
+DEPEND="
+ doc? ( app-doc/doxygen )
+ test? ( dev-cpp/gtest )"
+RDEPEND=""
+
+PATCHES=(
+ "${FILESDIR}/${P}-gcc-7.patch"
+ "${FILESDIR}/${P}-system_gtest.patch"
+ "${FILESDIR}/${P}-valgrind_optional.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_DOC=$(usex doc)
+ -DRAPIDJSON_BUILD_EXAMPLES=$(usex examples)
+ -DRAPIDJSON_BUILD_TESTS=$(usex test)
+ -DRAPIDJSON_BUILD_THIRDPARTY_GTEST=OFF
+ -DVALGRIND_EXECUTABLE=
+ )
+ cmake_src_configure
+}
diff --git a/dev-libs/rapidjson/rapidjson-9999.ebuild b/dev-libs/rapidjson/rapidjson-9999.ebuild
index 7abb247fd71d..081c33172b8d 100644
--- a/dev-libs/rapidjson/rapidjson-9999.ebuild
+++ b/dev-libs/rapidjson/rapidjson-9999.ebuild
@@ -19,23 +19,26 @@ if [[ ${PV} == *9999 ]] ; then
inherit git-r3
else
SRC_URI="https://github.com/miloyip/rapidjson/archive/v${PV}.tar.gz -> ${P}.tar.gz"
- KEYWORDS="~amd64 ~x86"
+ KEYWORDS="~amd64 ~arm ~arm64 ~x86"
S="${WORKDIR}/rapidjson-${PV}"
fi
DEPEND="
doc? ( app-doc/doxygen )
- test? (
- dev-cpp/gtest
- dev-util/valgrind
- )"
+ test? ( dev-cpp/gtest )"
RDEPEND=""
+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|-Werror||g' CMakeLists.txt || die
- sed -i -e 's|-Werror||g' example/CMakeLists.txt || die
+ 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() {
@@ -46,6 +49,7 @@ src_configure() {
-DRAPIDJSON_BUILD_EXAMPLES=$(usex examples)
-DRAPIDJSON_BUILD_TESTS=$(usex test)
-DRAPIDJSON_BUILD_THIRDPARTY_GTEST=OFF
+ -DVALGRIND_EXECUTABLE=
)
cmake_src_configure
}