From ccc722b7ed330198d82a3cf28ead76d6d107a70a Mon Sep 17 00:00:00 2001 From: davidovski Date: Mon, 6 Jun 2022 21:25:48 +0000 Subject: added java --- repo/rapidjson/disable-Werror.patch | 54 +++++++++++++++++++++++ repo/rapidjson/disable-march-cxx-flag.patch | 20 +++++++++ repo/rapidjson/do-not-include-gtest-src-dir.patch | 20 +++++++++ repo/rapidjson/rapidjson.xibuild | 40 +++++++++++++++++ 4 files changed, 134 insertions(+) create mode 100644 repo/rapidjson/disable-Werror.patch create mode 100644 repo/rapidjson/disable-march-cxx-flag.patch create mode 100644 repo/rapidjson/do-not-include-gtest-src-dir.patch create mode 100644 repo/rapidjson/rapidjson.xibuild (limited to 'repo/rapidjson') diff --git a/repo/rapidjson/disable-Werror.patch b/repo/rapidjson/disable-Werror.patch new file mode 100644 index 0000000..32ae959 --- /dev/null +++ b/repo/rapidjson/disable-Werror.patch @@ -0,0 +1,54 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9fc5273..3991718 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -50,7 +50,7 @@ if(CCACHE_FOUND) + endif(CCACHE_FOUND) + + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") + if (RAPIDJSON_BUILD_CXX11) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7.0") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") +@@ -73,7 +73,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + endif() + endif() + elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -Wno-missing-field-initializers") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-missing-field-initializers") + if (RAPIDJSON_BUILD_CXX11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + endif() +diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt +index 4d448cc..47d19ed 100644 +--- a/example/CMakeLists.txt ++++ b/example/CMakeLists.txt +@@ -26,9 +26,9 @@ include_directories("../include/") + add_definitions(-D__STDC_FORMAT_MACROS) + + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -Werror -Wall -Wextra -Weffc++ -Wswitch-default") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -Wall -Wextra -Weffc++ -Wswitch-default") + elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -Weffc++ -Wswitch-default -Wfloat-equal -Wimplicit-fallthrough -Weverything") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Weffc++ -Wswitch-default -Wfloat-equal -Wimplicit-fallthrough -Weverything") + endif() + + foreach (example ${EXAMPLES}) +diff --git a/test/unittest/CMakeLists.txt b/test/unittest/CMakeLists.txt +index b3204d6..d1c0add 100644 +--- a/test/unittest/CMakeLists.txt ++++ b/test/unittest/CMakeLists.txt +@@ -37,9 +37,9 @@ if(CCACHE_FOUND) + endif(CCACHE_FOUND) + + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -Weffc++ -Wswitch-default -Wfloat-equal") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Weffc++ -Wswitch-default -Wfloat-equal") + elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -Weffc++ -Wswitch-default -Wfloat-equal -Wimplicit-fallthrough -Weverything") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Weffc++ -Wswitch-default -Wfloat-equal -Wimplicit-fallthrough -Weverything") + # If the user is running a newer version of Clang that includes the + # -Wdouble-promotion, we will ignore that warning. + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.7) diff --git a/repo/rapidjson/disable-march-cxx-flag.patch b/repo/rapidjson/disable-march-cxx-flag.patch new file mode 100644 index 0000000..768c9fc --- /dev/null +++ b/repo/rapidjson/disable-march-cxx-flag.patch @@ -0,0 +1,20 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -50,7 +50,7 @@ + endif(CCACHE_FOUND) + + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wall -Wextra -Werror") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror") + if (RAPIDJSON_BUILD_CXX11) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7.0") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") +@@ -73,7 +73,7 @@ + endif() + endif() + elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wall -Wextra -Werror -Wno-missing-field-initializers") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -Wno-missing-field-initializers") + if (RAPIDJSON_BUILD_CXX11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + endif() diff --git a/repo/rapidjson/do-not-include-gtest-src-dir.patch b/repo/rapidjson/do-not-include-gtest-src-dir.patch new file mode 100644 index 0000000..2feb7aa --- /dev/null +++ b/repo/rapidjson/do-not-include-gtest-src-dir.patch @@ -0,0 +1,20 @@ +commit e61866f098098422462e8bc220506443e76c3bb0 +Author: Björn Esser +Date: Sun Apr 3 11:21:47 2016 +0200 + + do not include gtest_src_dir + +Source: http://pkgs.fedoraproject.org/cgit/rpms/rapidjson.git/tree/rapidjson-1.1.0-do_not_include_gtest_src_dir.patch +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index 11c1b04..43377db 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -8,7 +8,7 @@ IF(GTESTSRC_FOUND) + set(gtest_force_shared_crt ON) + endif() + +- add_subdirectory(${GTEST_SOURCE_DIR} ${CMAKE_BINARY_DIR}/googletest) ++# add_subdirectory(${GTEST_SOURCE_DIR} ${CMAKE_BINARY_DIR}/googletest) + include_directories(SYSTEM ${GTEST_INCLUDE_DIR}) + + set(TEST_LIBRARIES gtest gtest_main) diff --git a/repo/rapidjson/rapidjson.xibuild b/repo/rapidjson/rapidjson.xibuild new file mode 100644 index 0000000..481891a --- /dev/null +++ b/repo/rapidjson/rapidjson.xibuild @@ -0,0 +1,40 @@ +#!/bin/sh + +NAME="rapidjson" +DESC="Fast JSON parser/generator for C++ with both SAX/DOM style API" + +MAKEDEPS=" cmake" + +PKG_VER=1.1.0 +SOURCE="https://github.com/miloyip/rapidjson/archive/v$PKG_VER.tar.gz" + +ADDITIONAL=" +disable-march-cxx-flag.patch +do-not-include-gtest-src-dir.patch +" + +prepare () { + apply_patches + find -name "CMakeLists.txt" | xargs sed -i "s/-Werror//g" +} + +build() { + + cmake -B build . \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DRAPIDJSON_BUILD_DOC=OFF \ + -DRAPIDJSON_BUILD_EXAMPLES=OFF \ + -DGTESTSRC_FOUND=ON \ + -DGTEST_SOURCE_DIR=. + make -C build +} + +package() { + make -C build install DESTDIR="$PKG_DEST" + + # Remove examples and readme. + rm -r "$PKG_DEST"/usr/share +} + -- cgit v1.2.1