import lua-cjson-2.1.0

Lua CJSON provides JSON support for Lua.

Features:
- Fast, standards compliant encoding/parsing routines.
- Full support for JSON with UTF-8, including decoding surrogate pairs.
- Optional run-time support for common exceptions to the JSON
  specification (infinity, NaN,..).
- No dependencies on other libraries.

ok dcoppa@
This commit is contained in:
jasper 2012-11-26 09:52:13 +00:00
parent 5606569763
commit 0cabe581a1
7 changed files with 88 additions and 0 deletions

33
devel/lua-cjson/Makefile Normal file
View File

@ -0,0 +1,33 @@
# $OpenBSD: Makefile,v 1.1.1.1 2012/11/26 09:52:13 jasper Exp $
SHARED_ONLY= Yes
COMMENT= JSON support for Lua
DISTNAME= lua-cjson-2.1.0
CATEGORIES= devel
HOMEPAGE= http://www.kyne.com.au/~mark/software/lua-cjson.php
# MIT
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
MODULES= lang/lua
MASTER_SITES= http://www.kyne.com.au/~mark/software/download/
NO_REGRESS= Yes
pre-configure:
${SUBST_CMD} ${WRKSRC}/Makefile ${WRKSRC}/lua/*.lua
do-install:
${INSTALL_DATA_DIR} ${MODLUA_LIBDIR} ${MODLUA_DATADIR}/cjson/
${INSTALL_PROGRAM} ${WRKSRC}/cjson.so ${MODLUA_LIBDIR}
${INSTALL_DATA} ${WRKSRC}/lua/cjson/util.lua ${MODLUA_DATADIR}/cjson/
${INSTALL_SCRIPT} ${WRKSRC}/lua/*.lua ${PREFIX}/bin/
.include <bsd.port.mk>

2
devel/lua-cjson/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (lua-cjson-2.1.0.tar.gz) = UbxpzVWTHgy6LOrjnp76JIP0KS2jqIoe1HDtqCn2x3g=
SIZE (lua-cjson-2.1.0.tar.gz) = 86024

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-Makefile,v 1.1.1.1 2012/11/26 09:52:13 jasper Exp $
--- Makefile.orig Thu Mar 1 13:22:50 2012
+++ Makefile Tue Nov 20 19:42:53 2012
@@ -11,14 +11,14 @@
## multi-threaded application. Requries _pthreads_.
##### Build defaults #####
-LUA_VERSION = 5.1
+LUA_VERSION = ${MODLUA_VERSION}
TARGET = cjson.so
PREFIX = /usr/local
#CFLAGS = -g -Wall -pedantic -fno-inline
-CFLAGS = -O3 -Wall -pedantic -DNDEBUG
+CFLAGS ?= -O3 -Wall -pedantic -DNDEBUG
CJSON_CFLAGS = -fpic
CJSON_LDFLAGS = -shared
-LUA_INCLUDE_DIR = $(PREFIX)/include
+LUA_INCLUDE_DIR = $(PREFIX)/include/lua-$(LUA_VERSION)
LUA_CMODULE_DIR = $(PREFIX)/lib/lua/$(LUA_VERSION)
LUA_MODULE_DIR = $(PREFIX)/share/lua/$(LUA_VERSION)
LUA_BIN_DIR = $(PREFIX)/bin

View File

@ -0,0 +1,9 @@
$OpenBSD: patch-lua_json2lua_lua,v 1.1.1.1 2012/11/26 09:52:13 jasper Exp $
--- lua/json2lua.lua.orig Tue Nov 20 19:44:05 2012
+++ lua/json2lua.lua Tue Nov 20 19:44:11 2012
@@ -1,4 +1,4 @@
-#!/usr/bin/env lua
+#!${MODLUA_BIN}
-- usage: json2lua.lua [json_file]
--

View File

@ -0,0 +1,9 @@
$OpenBSD: patch-lua_lua2json_lua,v 1.1.1.1 2012/11/26 09:52:13 jasper Exp $
--- lua/lua2json.lua.orig Tue Nov 20 19:44:13 2012
+++ lua/lua2json.lua Tue Nov 20 19:44:20 2012
@@ -1,4 +1,4 @@
-#!/usr/bin/env lua
+#!${MODLUA_BIN}
-- usage: lua2json.lua [lua_file]
--

View File

@ -0,0 +1,8 @@
Lua CJSON provides JSON support for Lua.
Features:
- Fast, standards compliant encoding/parsing routines.
- Full support for JSON with UTF-8, including decoding surrogate pairs.
- Optional run-time support for common exceptions to the JSON
specification (infinity, NaN,..).
- No dependencies on other libraries.

View File

@ -0,0 +1,6 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2012/11/26 09:52:13 jasper Exp $
bin/json2lua.lua
bin/lua2json.lua
lib/lua/${MODLUA_VERSION}/cjson.so
share/lua/${MODLUA_VERSION}/cjson/
share/lua/${MODLUA_VERSION}/cjson/util.lua