diff --git a/devel/lua-cjson/Makefile b/devel/lua-cjson/Makefile new file mode 100644 index 00000000000..86598f4a322 --- /dev/null +++ b/devel/lua-cjson/Makefile @@ -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 diff --git a/devel/lua-cjson/distinfo b/devel/lua-cjson/distinfo new file mode 100644 index 00000000000..480d91245b0 --- /dev/null +++ b/devel/lua-cjson/distinfo @@ -0,0 +1,2 @@ +SHA256 (lua-cjson-2.1.0.tar.gz) = UbxpzVWTHgy6LOrjnp76JIP0KS2jqIoe1HDtqCn2x3g= +SIZE (lua-cjson-2.1.0.tar.gz) = 86024 diff --git a/devel/lua-cjson/patches/patch-Makefile b/devel/lua-cjson/patches/patch-Makefile new file mode 100644 index 00000000000..ddc4297453a --- /dev/null +++ b/devel/lua-cjson/patches/patch-Makefile @@ -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 diff --git a/devel/lua-cjson/patches/patch-lua_json2lua_lua b/devel/lua-cjson/patches/patch-lua_json2lua_lua new file mode 100644 index 00000000000..5e573cc9bec --- /dev/null +++ b/devel/lua-cjson/patches/patch-lua_json2lua_lua @@ -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] + -- diff --git a/devel/lua-cjson/patches/patch-lua_lua2json_lua b/devel/lua-cjson/patches/patch-lua_lua2json_lua new file mode 100644 index 00000000000..f527d9cdf74 --- /dev/null +++ b/devel/lua-cjson/patches/patch-lua_lua2json_lua @@ -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] + -- diff --git a/devel/lua-cjson/pkg/DESCR b/devel/lua-cjson/pkg/DESCR new file mode 100644 index 00000000000..6b077a90a9f --- /dev/null +++ b/devel/lua-cjson/pkg/DESCR @@ -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. diff --git a/devel/lua-cjson/pkg/PLIST b/devel/lua-cjson/pkg/PLIST new file mode 100644 index 00000000000..9308b77ef0c --- /dev/null +++ b/devel/lua-cjson/pkg/PLIST @@ -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