[oe-commits] [meta-openembedded] 23/32: json-spirit: add new recipe

git at git.openembedded.org git at git.openembedded.org
Sat Mar 11 16:58:11 UTC 2017


This is an automated email from the git hooks/post-receive script.

martin_jansa pushed a commit to branch master
in repository meta-openembedded.

commit 29cc9583e3ccb1056b5cf3411c23bd5527c23a25
Author: Ming Liu <peter.x.liu at external.atlascopco.com>
AuthorDate: Tue Mar 7 12:11:41 2017 +0100

    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 <peter.x.liu at external.atlascopco.com>
    Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>
---
 .../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(+)

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 0000000..f7030c5
--- /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 <peter.x.liu at external.atlascopco.com>
+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 <peter.x.liu at external.atlascopco.com>
+---
+ 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 0000000..27d46b1
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 0000000..dff6cc1
--- /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"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list