aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-bit32/APKBUILD
blob: 3256a9c0ba8d94e374405e876db6e1cd017c6afe (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lua-bit32
pkgver=5.3.0
pkgrel=3
pkgdesc="A lua library providing bitwise operations"
url="https://github.com/keplerproject/lua-compat-5.2"
arch="all"
options="!check"
license="MIT"
source="$pkgname-$pkgver.tar.gz::https://github.com/keplerproject/lua-compat-5.2/archive/bitlib-$pkgver.tar.gz
	Makefile
	"
builddir="$srcdir/lua-compat-5.2-bitlib-$pkgver"

_luaversions="5.1 5.2 5.3"

for _v in $_luaversions; do
	makedepends="$makedepends lua$_v-dev"
	subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
done

build() {
    cd "$_builddir"
    for _i in $_luaversions; do
        msg "build for Lua $_i"
        make -f "$srcdir"/Makefile LUAVER=$_i
    done
}

package() {
	mkdir -p "$pkgdir"
}

_subpackage() {
	local lver="${subpkgname:3:3}"
	pkgdesc="$pkgdesc (for Lua $lver)"
	depends="lua$lver"
	install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
	replaces="lua$lver-bitlib"
	# backwards compatibility
	provides="lua$lver-bitlib=$pkgver-r$pkgrel"

	cd "$builddir"
	install -D -m 755 $lver/bit32.so \
		"$subpkgdir"/usr/lib/lua/$lver/bit32.so
}

sha512sums="234807e201197bc27720864a328f5b63a9fe8bf88bf1fb64cd178532c0745a330b23455fcff0e50d365034f3e43af3c835de7f10a685275da66a7a1ca873e90a  lua-bit32-5.3.0.tar.gz
077dd4b397a9e4eb04ac131ceeef148b5f0790970398d69823f1bad485dcb3ab57126fc7b99428c7ec8255dc6b4d4aeee5a88ddf6a7dd9a767886e2fb357265e  Makefile"