aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-microlight/APKBUILD
blob: f889adb0e52ca98577432d56209c076a8af213cd (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
_luaversions="5.1 5.2 5.3"
pkgname=lua-microlight
pkgver=1.1.1
pkgrel=2
pkgdesc="a really compact set of general Lua functions"
url="http://stevedonovan.github.com/microlight/"
arch="noarch"
license="MIT"
depends=""
install=""
makedepends=""
subpackages=""
for _i in $_luaversions; do
	makedepends="$makedepends lua$_i-dev"
	subpackages="$subpackages lua$_i-microlight:split_${_i/./_}"
done
source="lua-microlight-$pkgver.tar.gz::https://github.com/stevedonovan/Microlight/archive/$pkgver.tar.gz
	fix-lua-5.3.patch
	"

_builddir="$srcdir"/Microlight-$pkgver

prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
}

package() {
	cd "$_builddir"
	for _i in $_luaversions; do
		install -Dm644 "$_builddir"/ml.lua \
			"$pkgdir"/usr/share/lua/$_i/ml.lua || return 1
	done
}

_split() {
	local d= _ver=$1
	pkgdesc="a really compact set of general functions for Lua $_ver"
	install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
	depends=
	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

sha512sums="debffab0c599754cb70852e82b2cb76af16dcefa7c1c4c54be1a0949d3f24312a72c9e9accd512a2f7d230259b7b7d18bc5919dbaff5458953236f9752582a45  lua-microlight-1.1.1.tar.gz
c32722c5900e3851e542fbd4e0628dff160cd0de260e94287843c6155eee17a9c217ca52e7fffd375a6d2f66440f871fafa86ec4cb65f51f5c2d569d51139b0e  fix-lua-5.3.patch"