From f3eeede823154cccbb4757c805c7238e1714bcbb Mon Sep 17 00:00:00 2001 From: Charles Southerland Date: Wed, 29 Jul 2015 09:46:58 -0500 Subject: [PATCH] yajl: add yajl Adds YAJL (Yet Another JSON Library), a C library for parsing JSON. Includes patches for uClibc support. Improved from version used internally at Who's On My WiFi since Feb 2014. Adds myself as maintainer. Signed-off-by: Charles Southerland --- libs/yajl/Makefile | 59 +++++++++++++++++++ .../100-link-reformatter-uclibc-libm.patch | 11 ++++ .../patches/101-link-perf-uclibc-libm.patch | 8 +++ 3 files changed, 78 insertions(+) create mode 100644 libs/yajl/Makefile create mode 100644 libs/yajl/patches/100-link-reformatter-uclibc-libm.patch create mode 100644 libs/yajl/patches/101-link-perf-uclibc-libm.patch diff --git a/libs/yajl/Makefile b/libs/yajl/Makefile new file mode 100644 index 0000000000..f9a2877a03 --- /dev/null +++ b/libs/yajl/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2014, 2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=yajl +PKG_VERSION:=2.1.0 +PKG_RELEASE:=1 +PKG_MAINTAINER:=Charles Southerland +PKG_LICENSE:=ISC +PKG_LICENSE_FILES:=COPYING +PKG_REV:=66cb08ca2ad8581080b626a75dfca266a890afb2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_URL:=git://github.com/lloyd/yajl.git +PKG_SOURCE_PROTO:=git + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/yajl + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Yet Another JSON Library + URL:=http://lloyd.github.io/yajl +endef + +define Package/yajl/description + Yet Another JSON Library. YAJL is a small event-driven (SAX-style) +JSON parser written in ANSI C, and a small validating JSON generator. +YAJL is released under the ISC license. + + YAJL was created by Lloyd Hilaiel. +endef + +PKG_INSTALL:=1 + +CMAKE_OPTIONS += \ + -DCMAKE_BUILD_TYPE:String="Release" + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/yajl $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libyajl.so* $(1)/usr/lib/ +endef + +define Package/yajl/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libyajl.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,yajl)) diff --git a/libs/yajl/patches/100-link-reformatter-uclibc-libm.patch b/libs/yajl/patches/100-link-reformatter-uclibc-libm.patch new file mode 100644 index 0000000000..fd637eca55 --- /dev/null +++ b/libs/yajl/patches/100-link-reformatter-uclibc-libm.patch @@ -0,0 +1,11 @@ +--- a/reformatter/CMakeLists.txt ++++ b/reformatter/CMakeLists.txt +@@ -26,7 +26,7 @@ + + ADD_EXECUTABLE(json_reformat ${SRCS}) + +-TARGET_LINK_LIBRARIES(json_reformat yajl_s) ++TARGET_LINK_LIBRARIES(json_reformat yajl_s m) + + # copy the binary into the output directory + GET_TARGET_PROPERTY(binPath json_reformat LOCATION) diff --git a/libs/yajl/patches/101-link-perf-uclibc-libm.patch b/libs/yajl/patches/101-link-perf-uclibc-libm.patch new file mode 100644 index 0000000000..0d6fd47958 --- /dev/null +++ b/libs/yajl/patches/101-link-perf-uclibc-libm.patch @@ -0,0 +1,8 @@ +--- a/perf/CMakeLists.txt ++++ b/perf/CMakeLists.txt +@@ -20,4 +20,4 @@ + + ADD_EXECUTABLE(perftest ${SRCS}) + +-TARGET_LINK_LIBRARIES(perftest yajl_s) ++TARGET_LINK_LIBRARIES(perftest yajl_s m)