From 29cc9583e3ccb1056b5cf3411c23bd5527c23a25 Mon Sep 17 00:00:00 2001 From: Ming Liu Date: Tue, 7 Mar 2017 12:11:41 +0100 Subject: json-spirit: add new recipe Json Spirit is a C++ JSON parser/generator implemented with Boost Spirit. It's being required by another newly added recipe librcf. The source json_spirit_v4.08.zip is derived from: https://www.codeproject.com/KB/recipes/JSON_Spirit/json_spirit_v4.08.zip The reason for getting it from a zip file instead of fetching it from the above site is that it needs logging in firstly before you can download anything. Signed-off-by: Ming Liu Signed-off-by: Martin Jansa --- .../json-spirit/0001-Adjust-the-cmake-files.patch | 145 +++++++++++++++++++++ .../json-spirit/json-spirit/json_spirit_v4.08.zip | Bin 0 -> 56299 bytes .../json-spirit/json-spirit_4.08.bb | 24 ++++ 3 files changed, 169 insertions(+) create mode 100644 meta-oe/recipes-devtools/json-spirit/json-spirit/0001-Adjust-the-cmake-files.patch create mode 100644 meta-oe/recipes-devtools/json-spirit/json-spirit/json_spirit_v4.08.zip create mode 100644 meta-oe/recipes-devtools/json-spirit/json-spirit_4.08.bb (limited to 'meta-oe/recipes-devtools/json-spirit') diff --git a/meta-oe/recipes-devtools/json-spirit/json-spirit/0001-Adjust-the-cmake-files.patch b/meta-oe/recipes-devtools/json-spirit/json-spirit/0001-Adjust-the-cmake-files.patch new file mode 100644 index 0000000000..f7030c5530 --- /dev/null +++ b/meta-oe/recipes-devtools/json-spirit/json-spirit/0001-Adjust-the-cmake-files.patch @@ -0,0 +1,145 @@ +From d8986cb065e770017ee1622fb7324387ead60203 Mon Sep 17 00:00:00 2001 +From: Ming Liu +Date: Tue, 7 Mar 2017 11:46:52 +0100 +Subject: [PATCH] Adjust the cmake files + +- Remove json_test which can not build with boost 1.61.0. +- Build shared library as well with the original static library. +- Add FindLibJsonSpirit.cmake to be able to be found by the dependers. + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Ming Liu +--- + CMakeLists.txt | 8 +++--- + FindLibJsonSpirit.cmake | 64 ++++++++++++++++++++++++++++++++++++++++++++++ + json_spirit/CMakeLists.txt | 16 +++++++++++- + 3 files changed, 83 insertions(+), 5 deletions(-) + create mode 100644 FindLibJsonSpirit.cmake + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4637a6c..b292f0f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,7 +1,7 @@ + CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + + PROJECT(json_spirit) +-SUBDIRS(json_spirit json_demo json_headers_only_demo json_map_demo json_test) ++SUBDIRS(json_spirit json_demo json_headers_only_demo json_map_demo) + INCLUDE_DIRECTORIES(json_spirit) + + INSTALL( +@@ -16,11 +16,11 @@ INSTALL( + ${CMAKE_SOURCE_DIR}/json_spirit/json_spirit_writer.h + ${CMAKE_SOURCE_DIR}/json_spirit/json_spirit_writer_template.h + ${CMAKE_SOURCE_DIR}/json_spirit/json_spirit_writer_options.h +- DESTINATION include) ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + + INSTALL( + FILES +- ${CMAKE_BINARY_DIR}/json_spirit/libjson_spirit.a +- DESTINATION lib) ++ ${CMAKE_SOURCE_DIR}/FindLibJsonSpirit.cmake ++ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/Modules) + + INCLUDE(CPack) +diff --git a/FindLibJsonSpirit.cmake b/FindLibJsonSpirit.cmake +new file mode 100644 +index 0000000..7ee7687 +--- /dev/null ++++ b/FindLibJsonSpirit.cmake +@@ -0,0 +1,64 @@ ++# FindLibJsonSpirit - Find libjson_spirit headers and libraries. ++# ++# Sample: ++# ++# SET( LibJsonSpirit_USE_STATIC_LIBS OFF ) ++# FIND_PACKAGE( LibJsonSpirit REQUIRED ) ++# IF( LibJsonSpirit_FOUND ) ++# INCLUDE_DIRECTORIES( ${LibJsonSpirit_INCLUDE_DIRS} ) ++# TARGET_LINK_LIBRARIES( ... ${LibJsonSpirit_LIBRARIES} ) ++# ENDIF() ++# ++# Variables used by this module need to be set before calling find_package ++# ++# LibJsonSpirit_USE_STATIC_LIBS Can be set to ON to force the use of the static ++# libjson_spirit libraries. Defaults to OFF. ++# ++# Variables provided by this module: ++# ++# LibJsonSpirit_FOUND Include dir, libjson_spirit libraries. ++# ++# LibJsonSpirit_LIBRARIES Link to these to use all the libraries you specified. ++# ++# LibJsonSpirit_INCLUDE_DIRS Include directories. ++# ++# For each component you specify in find_package(), the following (UPPER-CASE) ++# variables are set to pick and choose components instead of just using ++# LibJsonSpirit_LIBRARIES: ++# ++# LIBJSONSPIRIT_FOUND TRUE if libjson_spirit was found ++# LIBJSONSPIRIT_LIBRARY libjson_spirit library ++# ++ ++# Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES ++IF(LibJsonSpirit_USE_STATIC_LIBS) ++ SET( _ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) ++ SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ) ++ENDIF() ++ ++# Look for the header files ++UNSET(LibJsonSpirit_INCLUDE_DIRS CACHE) ++FIND_PATH(LibJsonSpirit_INCLUDE_DIRS NAMES json_spirit.h) ++ ++# Look for the core library ++UNSET(LIBJSONSPIRIT_LIBRARY CACHE) ++FIND_LIBRARY(LIBJSONSPIRIT_LIBRARY NAMES json_spirit) ++FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibJsonSpirit DEFAULT_MSG LIBJSONSPIRIT_LIBRARY LibJsonSpirit_INCLUDE_DIRS) ++MARK_AS_ADVANCED( ++ LIBJSONSPIRIT_FOUND ++ LIBJSONSPIRIT_LIBRARY ++) ++ ++# Prepare return values and collectiong more components ++SET(LibJsonSpirit_FOUND ${LIBJSONSPIRIT_FOUND}) ++SET(LibJsonSpirit_LIBRARIES ${LIBJSONSPIRIT_LIBRARY}) ++MARK_AS_ADVANCED( ++ LibJsonSpirit_FOUND ++ LibJsonSpirit_LIBRARIES ++ LibJsonSpirit_INCLUDE_DIRS ++) ++ ++# Restore CMAKE_FIND_LIBRARY_SUFFIXES ++IF(LibJsonSpirit_USE_STATIC_LIBS) ++ SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES} ) ++ENDIF() +diff --git a/json_spirit/CMakeLists.txt b/json_spirit/CMakeLists.txt +index fb52818..c1613b2 100644 +--- a/json_spirit/CMakeLists.txt ++++ b/json_spirit/CMakeLists.txt +@@ -13,5 +13,19 @@ json_spirit_writer_template.h ) + FIND_PACKAGE(Boost 1.34 REQUIRED) + INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR}) + +-ADD_LIBRARY(json_spirit STATIC ${JSON_SPIRIT_SRCS}) ++SET(JSONSPIRIT_SOVERSION_MAJOR "4") ++SET(JSONSPIRIT_SOVERSION_MINOR "0") ++SET(JSONSPIRIT_SOVERSION_PATCH "8") + ++ADD_LIBRARY(json_spirit SHARED ${JSON_SPIRIT_SRCS}) ++SET_TARGET_PROPERTIES(json_spirit PROPERTIES PROJECT_LABEL "Json Spirit Library") ++SET_TARGET_PROPERTIES(json_spirit PROPERTIES COMPILE_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS}) ++SET_TARGET_PROPERTIES(json_spirit PROPERTIES VERSION ${JSONSPIRIT_SOVERSION_MAJOR}.${JSONSPIRIT_SOVERSION_MINOR}.${JSONSPIRIT_SOVERSION_PATCH}) ++SET_TARGET_PROPERTIES(json_spirit PROPERTIES SOVERSION ${JSONSPIRIT_SOVERSION_MAJOR}) ++INSTALL(TARGETS json_spirit DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++ ++ADD_LIBRARY(json_spirit_static STATIC ${JSON_SPIRIT_SRCS}) ++SET_TARGET_PROPERTIES(json_spirit_static PROPERTIES PROJECT_LABEL "Json Spirit Static Library") ++SET_TARGET_PROPERTIES(json_spirit_static PROPERTIES OUTPUT_NAME "json_spirit") ++SET_TARGET_PROPERTIES(json_spirit_static PROPERTIES SOVERSION ${JSONSPIRIT_SOVERSION_MAJOR}) ++INSTALL(TARGETS json_spirit_static DESTINATION ${CMAKE_INSTALL_LIBDIR}) +-- +1.9.1 + diff --git a/meta-oe/recipes-devtools/json-spirit/json-spirit/json_spirit_v4.08.zip b/meta-oe/recipes-devtools/json-spirit/json-spirit/json_spirit_v4.08.zip new file mode 100644 index 0000000000..27d46b15a3 Binary files /dev/null and b/meta-oe/recipes-devtools/json-spirit/json-spirit/json_spirit_v4.08.zip differ diff --git a/meta-oe/recipes-devtools/json-spirit/json-spirit_4.08.bb b/meta-oe/recipes-devtools/json-spirit/json-spirit_4.08.bb new file mode 100644 index 0000000000..dff6cc1614 --- /dev/null +++ b/meta-oe/recipes-devtools/json-spirit/json-spirit_4.08.bb @@ -0,0 +1,24 @@ +SUMMARY = "A C++ JSON Parser/Generator Implemented with Boost Spirit." +DESCRIPTION = "JSON Spirit, a C++ library that reads and writes JSON files or streams. \ +It is written using the Boost Spirit parser generator. If you are \ +already using Boost, you can use JSON Spirit without any additional \ +dependencies." +HOMEPAGE = "https://www.codeproject.com/kb/recipes/json_spirit.aspx" +SECTION = "libs" +PRIORITY = "optional" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=278ef6183dec4aae1524fccc4b0113c9" + +SRC_URI = "file://json_spirit_v${PV}.zip \ + file://0001-Adjust-the-cmake-files.patch \ +" + +S = "${WORKDIR}/json_spirit_v${PV}" + +DEPENDS = "boost" + +inherit cmake + +FILES_${PN}-dev += "${datadir}/cmake/Modules/FindLibJsonSpirit.cmake" + +BBCLASSEXTEND += "nativesdk" -- cgit 1.2.3-korg