summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authoredward-p2018-09-10 15:10:55 +0800
committeredward-p2018-09-10 15:10:55 +0800
commit3aea058f94b72a366419142830ca527cc92ebdcb (patch)
tree7cb22745db2dc78b27d3b028e4b474d75193f5da
downloadaur-libubox-lua-archwrt.tar.gz
init commit
-rw-r--r--.SRCINFO32
-rw-r--r--001-lua-version.patch11
-rw-r--r--002-json-c-include.patch31
-rw-r--r--003-uloop.c.patch16
-rw-r--r--PKGBUILD51
5 files changed, 141 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..f143cd081a6
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,32 @@
+pkgbase = libubox-lua-archwrt
+ pkgdesc = A small utility library developed for OpenWrt containing a event loop, linked lists, blobmsg, stream buffer management, [...]
+ pkgver = r411.c83a84a
+ pkgrel = 1
+ url = http://git.openwrt.org/?p=project/libubox.git
+ arch = i686
+ arch = x86_64
+ arch = armv7h
+ license = ISC BSD-3c
+ makedepends = git
+ makedepends = cmake
+ makedepends = gcc
+ makedepends = make
+ makedepends = patch
+ makedepends = pkg-config
+ depends = json-c
+ depends = lua51
+ provides = libubox
+ conflicts = libubox
+ conflicts = libubox-git
+ conflicts = libubox-lua-git
+ source = git://git.openwrt.org/project/libubox.git
+ source = 001-lua-version.patch
+ source = 002-json-c-include.patch
+ source = 003-uloop.c.patch
+ md5sums = SKIP
+ md5sums = 6753ffbf07d79b697e43aad9f3ec6ead
+ md5sums = d940bc9cc45645c62d30a72e877c10b8
+ md5sums = d0b08751db1bbedb80d4ee01920d4606
+
+pkgname = libubox-lua-archwrt
+
diff --git a/001-lua-version.patch b/001-lua-version.patch
new file mode 100644
index 00000000000..2cde4b36b1b
--- /dev/null
+++ b/001-lua-version.patch
@@ -0,0 +1,11 @@
+--- a/lua/CMakeLists.txt
++++ b/lua/CMakeLists.txt
+@@ -24,7 +24,7 @@
+
+ IF(NOT LUAPATH)
+ EXECUTE_PROCESS(
+- COMMAND lua -e "for k in string.gmatch(package.cpath .. \";\", \"([^;]+)/..so;\") do if k:sub(1,1) == \"/\" then print(k) break end end"
++ COMMAND lua5.1 -e "for k in string.gmatch(package.cpath .. \";\", \"([^;]+)/..so;\") do if k:sub(1,1) == \"/\" then print(k) break end end"
+ OUTPUT_VARIABLE LUAPATH
+ RESULT_VARIABLE LUA_CHECK_RES
+ OUTPUT_STRIP_TRAILING_WHITESPACE
diff --git a/002-json-c-include.patch b/002-json-c-include.patch
new file mode 100644
index 00000000000..72b50816f0c
--- /dev/null
+++ b/002-json-c-include.patch
@@ -0,0 +1,31 @@
+--- a/blobmsg_json.c
++++ b/blobmsg_json.c
+@@ -17,11 +17,7 @@
+ #include "blobmsg.h"
+ #include "blobmsg_json.h"
+
+-#ifdef JSONC
+- #include <json.h>
+-#else
+- #include <json/json.h>
+-#endif
++#include <json-c/json.h>
+
+ bool blobmsg_add_object(struct blob_buf *b, json_object *obj)
+ {
+--- a/jshn.c
++++ b/jshn.c
+@@ -13,11 +13,8 @@
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+-#ifdef JSONC
+- #include <json.h>
+-#else
+- #include <json/json.h>
+-#endif
++
++#include <json-c/json.h>
+
+ #include <string.h>
+ #include <stdlib.h>
diff --git a/003-uloop.c.patch b/003-uloop.c.patch
new file mode 100644
index 00000000000..79ec78b85f8
--- /dev/null
+++ b/003-uloop.c.patch
@@ -0,0 +1,16 @@
+--- a/lua/uloop.c
++++ b/lua/uloop.c
+@@ -18,9 +18,9 @@
+ #include <stdlib.h>
+ #include <unistd.h>
+
+-#include <lua.h>
+-#include <lualib.h>
+-#include <lauxlib.h>
++#include <lua5.1/lua.h>
++#include <lua5.1/lualib.h>
++#include <lua5.1/lauxlib.h>
+
+ #include "../uloop.h"
+ #include "../list.h"
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..7d6c281d75c
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,51 @@
+# Maintainer: Edward Pacman <micro<doT>fedora(aT)gmail<doT>com>
+
+pkgname=libubox-lua-archwrt
+_gitname=libubox
+pkgver=r411.c83a84a
+pkgrel=1
+pkgdesc='A small utility library developed for OpenWrt containing a event loop, linked lists, blobmsg, stream buffer management, [...]'
+url='http://git.openwrt.org/?p=project/libubox.git'
+arch=('i686' 'x86_64' 'armv7h')
+license=('ISC BSD-3c')
+depends=('json-c' 'lua51')
+makedepends=('git' 'cmake' 'gcc' 'make' 'patch' 'pkg-config')
+conflicts=('libubox' 'libubox-git' 'libubox-lua-git')
+provides=('libubox')
+source=('git://git.openwrt.org/project/libubox.git' '001-lua-version.patch' '002-json-c-include.patch' '003-uloop.c.patch')
+md5sums=('SKIP'
+ '6753ffbf07d79b697e43aad9f3ec6ead'
+ 'd940bc9cc45645c62d30a72e877c10b8'
+ 'd0b08751db1bbedb80d4ee01920d4606')
+
+pkgver() {
+ cd "$srcdir/$_gitname"
+
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+prepare() {
+ cd "$srcdir/$_gitname"
+
+ patch -p1 -i "$srcdir/001-lua-version.patch"
+ patch -p1 -i "$srcdir/002-json-c-include.patch"
+ patch -p1 -i "$srcdir/003-uloop.c.patch"
+}
+
+build() {
+ cd "$srcdir/$_gitname"
+
+ cmake CMakeLists.txt \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DBUILD_LUA=ON
+
+ make
+}
+
+package() {
+ cd "$srcdir/$_gitname"
+
+ make DESTDIR="$pkgdir" install
+}
+
+# burp -c lib `ls libubox-lua-git*.src.tar.gz | sort | tail -n 1`