diff --git a/dev-libs/rapidjson/patches/rapidjson-1.1.0.patchset b/dev-libs/rapidjson/patches/rapidjson-1.1.0.patchset new file mode 100644 index 000000000..e82caf4f4 --- /dev/null +++ b/dev-libs/rapidjson/patches/rapidjson-1.1.0.patchset @@ -0,0 +1,22 @@ +From 1dab787da4c145a7fbf3df25383c6d5419365dd5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= +Date: Sun, 16 Dec 2018 13:16:04 +0100 +Subject: Build fix for Haiku + + +diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt +index 4d448cc..48f16ef 100644 +--- a/example/CMakeLists.txt ++++ b/example/CMakeLists.txt +@@ -26,7 +26,7 @@ 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} -lpthread -Werror -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") + endif() +-- +2.19.1 + diff --git a/dev-libs/rapidjson/rapidjson-1.1.0.recipe b/dev-libs/rapidjson/rapidjson-1.1.0.recipe new file mode 100644 index 000000000..f21bd8d9f --- /dev/null +++ b/dev-libs/rapidjson/rapidjson-1.1.0.recipe @@ -0,0 +1,88 @@ +SUMMARY="A fast JSON parser/generator for C++ with both SAX/DOM style API" +DESCRIPTION="RapidJSON is a JSON parser and generator for C++. It was \ +inspired by RapidXml. + +RapidJSON is small but complete. It supports both SAX and DOM style API. The \ +SAX parser is only a half thousand lines of code. + +RapidJSON is fast. Its performance can be comparable to strlen(). It also \ +optionally supports SSE2/SSE4.2 for acceleration. + +RapidJSON is self-contained and header-only. It does not depend on external \ +libraries such as BOOST. It even does not depend on STL. + +RapidJSON is memory-friendly. Each JSON value occupies exactly 16 bytes for \ +most 32/64-bit machines (excluding text string). By default it uses a fast \ +memory allocator, and the parser allocates memory compactly during parsing. + +RapidJSON is Unicode-friendly. It supports UTF-8, UTF-16, UTF-32 (LE & BE), \ +and their detection, validation and transcoding internally. For example, you \ +can read a UTF-8 file and let RapidJSON transcode the JSON strings into \ +UTF-16 in the DOM. It also supports surrogates and \"\u0000\" \ +(null character)." +HOMEPAGE="https://github.com/Tencent/rapidjson" +COPYRIGHT="2015 THL A29 Limited, a Tencent company, and Milo Yip" +LICENSE="MIT" +REVISION="1" +SOURCE_URI="https://github.com/Tencent/rapidjson/archive/v$portVersion.tar.gz" +CHECKSUM_SHA256="bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e" +SOURCE_FILENAME="rapidjson-$portVersion.tar.gz" +PATCHES="rapidjson-$portVersion.patchset" + +ARCHITECTURES="?x86_gcc2 ?x86 x86_64" +SECONDARY_ARCHITECTURES="x86" + +libVersion="$portVersion" +libVersionCompat="$libVersion compat >= ${libVersion%%.*}" + +PROVIDES=" + rapidjson$secondaryArchSuffix = $portVersion + devel:librapidjson$secondaryArchSuffix = $libVersionCompat + " +REQUIRES=" + haiku$secondaryArchSuffix + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + " +BUILD_PREREQUIRES=" + cmd:cmake + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:make + cmd:pkg_config$secondaryArchSuffix + " + +BUILD() +{ + mkdir -p haiku_build + cd haiku_build + + cmake .. \ + -DBUILD_SHARED_LIBS=ON \ + -DRAPIDJSON_BUILD_DOC=ON \ + -DRAPIDJSON_BUILD_EXAMPLES=OFF \ + -DRAPIDJSON_BUILD_TESTS=ON \ + -DRAPIDJSON_BUILD_THIRDPARTY_GTEST=OFF \ + -DINCLUDE_INSTALL_DIR=$includeDir \ + -DLIB_INSTALL_DIR=$libDir \ + -DDOC_INSTALL_DIR=$docDir \ + $cmakeDirArgs + + make $jobArgs +} + +INSTALL() +{ + cd haiku_build + make install + + fixPkgconfig +} + +TEST() +{ + cd haiku_build + make test +}