diff options
-rw-r--r-- | main/lua-ldbus/APKBUILD | 75 | ||||
-rw-r--r-- | main/lua-ldbus/fix-makefile.patch | 43 |
2 files changed, 118 insertions, 0 deletions
diff --git a/main/lua-ldbus/APKBUILD b/main/lua-ldbus/APKBUILD new file mode 100644 index 0000000000..982942ba6c --- /dev/null +++ b/main/lua-ldbus/APKBUILD @@ -0,0 +1,75 @@ +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> +_luaversions="5.1 5.2 5.3" +pkgname=lua-ldbus +pkgver=20150430 +_commitid=9f6db626600eb7e04000368da947e0c5cd175fb5 +pkgrel=0 +pkgdesc="Lua D-Bus bindings" +url="https://github.com/daurnimator/ldbus" +arch="all" +license="MIT" +depends="" +subpackages="" +makedepends="dbus-dev" +install="" +source="ldbus-$pkgver.tar.gz::https://github.com/daurnimator/ldbus/archive/$_commitid.tar.gz + fix-makefile.patch + " + +for _i in $_luaversions; do + makedepends="$makedepends lua${_i}-dev" + subpackages="$subpackages lua${_i}-dbus:_split_${_i/./}" +done + +_builddir="$srcdir"/ldbus-$_commitid/src +prepare() { + local i + cd "$srcdir"/ldbus-$_commitid + for i in $source; do + case $i in + *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; + esac + done +} + +build() { + cd "$_builddir" + for _i in $_luaversions; do + msg "Build for Lua $_i" + make LUA_VERSION=$_i LUA_LIBDIR="$pkgdir"/usr/lib/lua/$_i all || return 1 + done +} + +package() { + cd "$_builddir" + for _i in $_luaversions; do + msg "Install for Lua $_i" + make LUA_VERSION=$_i LUA_LIBDIR="$pkgdir"/usr/lib/lua/$_i install || return 1 + done + rm -f "$pkgdir"/usr/lib/*.la +} + +_split() { + local d= _ver=$1 + pkgdesc="$pkgdesc - for Lua $_ver" + depends= + install_if="lua$_ver $pkgname=$pkgver-r$pkgrel" + for d in usr/lib/lua usr/share/lua; do + if [ -d "$pkgdir"/$d/$_ver ]; then + mkdir -p "$subpkgdir"/$d + mv "$pkgdir"/$d/$_ver "$subpkgdir"/$d/ || return 1 + fi + done +} + +for _i in $_luaversions; do + eval "_split_${_i/./}() { _split $_i; }" +done + + +md5sums="0688d0bc571483a28341c53acc57ded9 ldbus-20150430.tar.gz +c6f40fa1880ba35a0553e281f532f0e6 fix-makefile.patch" +sha256sums="3f8eabe8a7f73214bc774faa428d1bb3a4a4b8c0f6712c2fffa4646b71020cfd ldbus-20150430.tar.gz +2b9eab47aa85510026bc5aca43b39095d09176ae6a397a7e51db2a51707ba5a5 fix-makefile.patch" +sha512sums="cab609800b3d67bb6fd533b62179345430e822ad30c711bc8f35cb079353108339288eb7adc374a681bb4f42b66cfd025cff4591fd9cbef045acad41e72d3073 ldbus-20150430.tar.gz +63f54e86d1c879d584ff79d384f24f1e5af15d39506ce8bba5c8562ec826e430b273537650639337869758ca7333dfa6af641ad16bca7c1582f628120ad8f01a fix-makefile.patch" diff --git a/main/lua-ldbus/fix-makefile.patch b/main/lua-ldbus/fix-makefile.patch new file mode 100644 index 0000000000..781efe7c2a --- /dev/null +++ b/main/lua-ldbus/fix-makefile.patch @@ -0,0 +1,43 @@ +--- ldbus-9f6db626600eb7e04000368da947e0c5cd175fb5.orig/src/Makefile ++++ ldbus-9f6db626600eb7e04000368da947e0c5cd175fb5/src/Makefile +@@ -1,22 +1,32 @@ +-LUA_LIBDIR = /usr/local/lib/lua/5.3 ++LUA_VERSION ?= 5.3 ++LUA_LIBDIR = /usr/local/lib/lua/$(LUA_VERSION) + ++O = obj$(LUA_VERSION) + CFLAGS += -Wall -Wextra --pedantic -Wno-long-long +-CFLAGS += `pkg-config --cflags lua5.3 dbus-1` ++CFLAGS += `pkg-config --cflags lua$(LUA_VERSION) dbus-1` + CFLAGS += -fPIC + CFLAGS += -I ../vendor/compat-5.3/c-api + + LIBS = `pkg-config --libs dbus-1` + +-OBJS = ldbus.o error.o pending_call.o connection.o bus.o message.o message_iter.o timeout.o watch.o ../vendor/compat-5.3/c-api/compat-5.3.o ++OBJS = $(addprefix $(O)/, ldbus.o error.o pending_call.o connection.o bus.o message.o message_iter.o timeout.o watch.o compat-5.3.o) + +-all: ldbus.so ++all: $(O)/ldbus.so + +-ldbus.so: $(OBJS) +- $(CC) -o ldbus.so -shared $(CFLAGS) $^ $(LIBS) ++$(O)/compat-5.3.o: ../vendor/compat-5.3/c-api/compat-5.3.c ++ @mkdir -p $(O) ++ $(CC) -c -o $@ $(CFLAGS) $< + ++$(O)/%.o: %.c ++ @mkdir -p $(O) ++ $(CC) -c -o $@ $(CFLAGS) $< ++ ++$(O)/ldbus.so: $(OBJS) ++ $(CC) -o $@ -shared $(CFLAGS) $^ $(LIBS) ++ + clean: + rm -f -- ldbus.so $(OBJS) + +-install: ldbus.so ++install: $(O)/ldbus.so + mkdir -p $(LUA_LIBDIR) +- cp ldbus.so $(LUA_LIBDIR) ++ cp $(O)/ldbus.so $(LUA_LIBDIR) |