aboutsummaryrefslogtreecommitdiffstats
path: root/community/lua-lpeg
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-05-12 22:22:14 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-05-12 22:23:07 +0200
commitf42c67b39d05f610b590063d32522d45a3d3ded6 (patch)
tree9dc90c39b40d5a372daf70dd57dae3f6272ddd0a /community/lua-lpeg
parent04170b314686f4117edf1052d5ef951f570de158 (diff)
downloadaports-f42c67b39d05f610b590063d32522d45a3d3ded6.tar.bz2
aports-f42c67b39d05f610b590063d32522d45a3d3ded6.tar.xz
community/lua-lpeg: add -dev subpackage with static libs
Diffstat (limited to 'community/lua-lpeg')
-rw-r--r--community/lua-lpeg/APKBUILD18
-rw-r--r--community/lua-lpeg/build-static-lib.patch29
2 files changed, 44 insertions, 3 deletions
diff --git a/community/lua-lpeg/APKBUILD b/community/lua-lpeg/APKBUILD
index b1ca9b5e34..364d18a604 100644
--- a/community/lua-lpeg/APKBUILD
+++ b/community/lua-lpeg/APKBUILD
@@ -10,9 +10,10 @@ arch="all"
license="MIT"
depends=""
makedepends=""
-subpackages=""
+subpackages="$pkgname-dev"
source="http://www.inf.puc-rio.br/~roberto/lpeg/$_pkgname-$pkgver.tar.gz
- test-fix-setlocale.patch"
+ test-fix-setlocale.patch
+ build-static-lib.patch"
builddir="$srcdir/$_pkgname-$pkgver"
# luajit is not available for selected arches
@@ -61,6 +62,16 @@ package() {
mkdir -p "$pkgdir"
}
+dev() {
+ default_dev
+ mkdir -p "$subpkgdir"
+
+ local lver; for lver in $_luaversions; do
+ install -Dm644 "$builddir-$lver"/lpeg.a \
+ "$subpkgdir"/usr/lib/lua/$lver/lpeg.a || return 1
+ done
+}
+
_package() {
local lver="${subpkgname:3:3}"
pkgdesc="Pattern-matching library for Lua $lver"
@@ -76,4 +87,5 @@ _package() {
}
sha512sums="7b43fbee7eff443000986684bc56bba6d2796a31cf860740746c70e155bdea1b62a46b93f97e2747e3ef0f63e965148778ac2985d0f2d83e1e37ec4ebbabf4aa lpeg-1.0.1.tar.gz
-49ce012e6c2f6e07b3aae4f52630f3b4aa43f936f76dbfb2b8e33208fb05aec54e2e6c815215d606ee0dfc860b07917a042c77cdc0ea5b6b14a8028fa0e724f8 test-fix-setlocale.patch"
+49ce012e6c2f6e07b3aae4f52630f3b4aa43f936f76dbfb2b8e33208fb05aec54e2e6c815215d606ee0dfc860b07917a042c77cdc0ea5b6b14a8028fa0e724f8 test-fix-setlocale.patch
+3022a101639822f6d5ea38578a9efd29e22dba7433c770d0ebf6e7a35053ead26dae10a737a804061ea32daed8770812d9f9ca444acc1b0ea7329280223ae1fb build-static-lib.patch"
diff --git a/community/lua-lpeg/build-static-lib.patch b/community/lua-lpeg/build-static-lib.patch
new file mode 100644
index 0000000000..d109ae52c0
--- /dev/null
+++ b/community/lua-lpeg/build-static-lib.patch
@@ -0,0 +1,29 @@
+--- a/makefile
++++ b/makefile
+@@ -24,12 +24,15 @@
+
+ CFLAGS = $(CWARNS) $(COPT) -std=c99 -I$(LUADIR) -fPIC
+ CC = gcc
++AR = ar
++RANLIB = ranlib
+
+ FILES = lpvm.o lpcap.o lptree.o lpcode.o lpprint.o
+
+ # For Linux
+ linux:
+ make lpeg.so "DLLFLAGS = -shared -fPIC"
++ make lpeg.a
+
+ # For Mac OS
+ macosx:
+@@ -37,6 +40,10 @@
+
+ lpeg.so: $(FILES)
+ env $(CC) $(DLLFLAGS) $(FILES) -o lpeg.so
++
++lpeg.a: $(FILES)
++ env $(AR) rc lpeg.a $(FILES)
++ env $(RANLIB) lpeg.a
+
+ $(FILES): makefile
+