diff options
author | Matthias Van Gestel | 2020-11-05 19:46:33 +0100 |
---|---|---|
committer | Matthias Van Gestel | 2020-11-05 19:46:33 +0100 |
commit | 835b686ee75ff55a1a13b32d573be40a6024abe2 (patch) | |
tree | a7c8d6df07e3b1671da842a428413ba98ee44107 | |
download | aur-835b686ee75ff55a1a13b32d573be40a6024abe2.tar.gz |
Initial drop of ubus-git
-rw-r--r-- | .SRCINFO | 28 | ||||
-rw-r--r-- | 001-lua-5_4.patch | 27 | ||||
-rw-r--r-- | PKGBUILD | 65 |
3 files changed, 120 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..b90609ae621b --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,28 @@ +pkgbase = ubus-git + pkgdesc = OpenWrt ubus library + pkgver = r324.ad0cd11 + pkgrel = 1 + url = https://git.openwrt.org/project/ubus.git + arch = i686 + arch = x86_64 + arch = armv7h + license = LGPL 2.1 + makedepends = git + makedepends = cmake + makedepends = gcc + makedepends = make + makedepends = pkg-config + makedepends = patch + depends = libubox + depends = lua + provides = libubus + provides = ubus + conflicts = libubus + conflicts = ubus + source = ubus-git::git+https://git.openwrt.org/project/ubus.git#branch=master + source = 001-lua-5_4.patch + md5sums = SKIP + md5sums = SKIP + +pkgname = ubus-git + diff --git a/001-lua-5_4.patch b/001-lua-5_4.patch new file mode 100644 index 000000000000..6e3d2aea7d9d --- /dev/null +++ b/001-lua-5_4.patch @@ -0,0 +1,27 @@ +diff --git a/lua/ubus.c b/lua/ubus.c +index e2bb081..208da7d 100644 +--- a/lua/ubus.c ++++ b/lua/ubus.c +@@ -51,6 +51,22 @@ struct ubus_lua_subscriber { + static int + ubus_lua_parse_blob(lua_State *L, struct blob_attr *attr, bool table); + ++#if LUA_VERSION_NUM >= 503 ++/* one can simply enable LUA_COMPAT_5_2 to be backward compatible. ++However, this does not work when we are trying to use system-installed lua, ++hence these redefines ++*/ ++#define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, (n), (d))) ++#define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d))) ++#define luaL_checklong(L,n) ((long)luaL_checkinteger(L, (n))) ++#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n))) ++ ++#define lua_objlen(L,i) (lua_rawlen(L, (i))) ++#define luaL_register(L,n,l) (luaL_setfuncs(L,(l),0)) ++ ++#endif ++ ++ + static int + ubus_lua_parse_blob_array(lua_State *L, struct blob_attr *attr, size_t len, bool table) + { diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..d9ad3550f71d --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,65 @@ +# Maintainer: Luka Perkov <luka.perkov@sartura.hr> + +pkgname=ubus-git +pkgver=r324.ad0cd11 +pkgrel=1 +pkgdesc='OpenWrt ubus library' +url='https://git.openwrt.org/project/ubus.git' +arch=('i686' 'x86_64' 'armv7h') +license=('LGPL 2.1') + +depends=( + 'libubox' + 'lua' +) +makedepends=( + 'git' + 'cmake' + 'gcc' + 'make' + 'pkg-config' + 'patch' +) +provides=( + 'libubus' + 'ubus' +) +conflicts=( + 'libubus' + 'ubus' +) + +gitbranch="master" + +source=("${pkgname}::git+https://git.openwrt.org/project/ubus.git#branch=${gitbranch}" "001-lua-5_4.patch") +md5sums=('SKIP' 'SKIP') + +pkgver() { + cd "${pkgname}" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + cd "${pkgname}" + + patch -p1 -i "$srcdir/001-lua-5_4.patch" +} + +build() { + cd "${pkgname}" + + cmake CMakeLists.txt \ + -DCMAKE_INSTALL_PREFIX=/usr + + make +} + +package() { + cd "${pkgname}" + + make DESTDIR="$pkgdir" install + + install -d ${pkgdir}/usr/bin + mv ${pkgdir}/usr/sbin/* ${pkgdir}/usr/bin/ + rm -Rf ${pkgdir}/usr/sbin/ +} |