Browse Source

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 <charlie@stuphlabs.com>
Charles Southerland 9 years ago
parent
commit
f3eeede823

+ 59
- 0
libs/yajl/Makefile View File

@@ -0,0 +1,59 @@
1
+# 
2
+# Copyright (C) 2014, 2015 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=yajl
11
+PKG_VERSION:=2.1.0
12
+PKG_RELEASE:=1
13
+PKG_MAINTAINER:=Charles Southerland <charlie@stuphlabs.com>
14
+PKG_LICENSE:=ISC
15
+PKG_LICENSE_FILES:=COPYING
16
+PKG_REV:=66cb08ca2ad8581080b626a75dfca266a890afb2
17
+
18
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
19
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
20
+PKG_SOURCE_VERSION:=$(PKG_REV)
21
+PKG_SOURCE_URL:=git://github.com/lloyd/yajl.git
22
+PKG_SOURCE_PROTO:=git
23
+
24
+include $(INCLUDE_DIR)/package.mk
25
+include $(INCLUDE_DIR)/cmake.mk
26
+
27
+define Package/yajl
28
+  SECTION:=libs
29
+  CATEGORY:=Libraries
30
+  TITLE:=Yet Another JSON Library
31
+  URL:=http://lloyd.github.io/yajl
32
+endef
33
+
34
+define Package/yajl/description
35
+  Yet Another JSON Library. YAJL is a small event-driven (SAX-style)
36
+JSON parser written in ANSI C, and a small validating JSON generator.
37
+YAJL is released under the ISC license.
38
+
39
+  YAJL was created by Lloyd Hilaiel.
40
+endef
41
+
42
+PKG_INSTALL:=1
43
+
44
+CMAKE_OPTIONS += \
45
+	-DCMAKE_BUILD_TYPE:String="Release" 
46
+
47
+define Build/InstallDev
48
+	$(INSTALL_DIR) $(1)/usr/include
49
+	$(CP) $(PKG_INSTALL_DIR)/usr/include/yajl $(1)/usr/include/
50
+	$(INSTALL_DIR) $(1)/usr/lib
51
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libyajl.so* $(1)/usr/lib/
52
+endef
53
+
54
+define Package/yajl/install
55
+	$(INSTALL_DIR) $(1)/usr/lib
56
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libyajl.so* $(1)/usr/lib/
57
+endef
58
+
59
+$(eval $(call BuildPackage,yajl))

+ 11
- 0
libs/yajl/patches/100-link-reformatter-uclibc-libm.patch View File

@@ -0,0 +1,11 @@
1
+--- a/reformatter/CMakeLists.txt
2
++++ b/reformatter/CMakeLists.txt
3
+@@ -26,7 +26,7 @@
4
+ 
5
+ ADD_EXECUTABLE(json_reformat ${SRCS})
6
+ 
7
+-TARGET_LINK_LIBRARIES(json_reformat yajl_s)
8
++TARGET_LINK_LIBRARIES(json_reformat yajl_s m)
9
+ 
10
+ # copy the binary into the output directory
11
+ GET_TARGET_PROPERTY(binPath json_reformat LOCATION)

+ 8
- 0
libs/yajl/patches/101-link-perf-uclibc-libm.patch View File

@@ -0,0 +1,8 @@
1
+--- a/perf/CMakeLists.txt
2
++++ b/perf/CMakeLists.txt
3
+@@ -20,4 +20,4 @@
4
+ 
5
+ ADD_EXECUTABLE(perftest ${SRCS})
6
+ 
7
+-TARGET_LINK_LIBRARIES(perftest yajl_s)
8
++TARGET_LINK_LIBRARIES(perftest yajl_s m)