aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lua-mpack/APKBUILD
blob: 35852150dbfac4f9183d87164e7383188d8dca8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Contributor: Daniel Sabogal <dsabogalcc@gmail.com>
# Maintainer:
pkgname=lua-mpack
pkgver=1.0.2
_lua_versions="5.1 5.2"
pkgrel=0
_pkgdesc="Libmpack bindings for Lua"
pkgdesc="$_pkgdesc"
url="https://github.com/tarruda/libmpack"
arch="all"
license="MIT"
depends=""
depends_dev=""
makedepends=""
install=""
subpackages=""
source="libmpack-$pkgver.tar.gz::https://github.com/tarruda/libmpack/archive/$pkgver.tar.gz"
for _v in $_lua_versions; do
        makedepends="$makedepends lua$_v-dev"
        subpackages="$subpackages lua$_v-mpack:split_${_v/./_}"
done

builddir="$srcdir"/libmpack-$pkgver

build() {
	cd "$builddir"
	gcc $CFLAGS -fPIC -c binding/lua/lmpack.c -o lmpack.o || return 1
	gcc -shared -o mpack.so lmpack.o || return 1
}

package() {
	arch="noarch"
	mkdir -p "$pkgdir"
}

_split() {
	local _ver="$1"
	install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
	pkgdesc="$_pkgdesc $_ver"
	cd "$srcdir"/libmpack-$pkgver || return 1
	install -Dm755 mpack.so \
		"$subpkgdir"/usr/lib/lua/$_ver/mpack.so || return 1
}

for _v in $_lua_versions; do
        eval "split_${_v/./_}() { _split $_v; }"
done

md5sums="a6320e37991bb56520d4670419edb43c  libmpack-1.0.2.tar.gz"
sha256sums="9c570b2aab81b0c56d97cbd8fc483dc431b69510fd9becb4a1845291563e8bc9  libmpack-1.0.2.tar.gz"
sha512sums="307ae26799e59224dd624d1f5473c86d5cf975155c58b7ccfd17be98321afb0f7235d06a7a2c50112d4630b3cc7c185c9b307007be5cdbd792819ec2991fa3d2  libmpack-1.0.2.tar.gz"