aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-pc/APKBUILD
blob: 76bf2fbbf5b141a69357f5ca6f28247113a1c2d1 (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
66
67
68
69
70
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>

_luaversions="5.1 5.2"

pkgname=lua-pc
_name=lpc
pkgver=1.0.0
pkgrel=7
pkgdesc="Lua Process Call"
url="https://github.com/LuaDist/lpc"
arch="all"
license="MIT/X11"
makedepends=""
depends="lua5.1-pc"
source="http://dev.alpinelinux.org/archive/lpc/lpc-$pkgver.tar.gz
	lpc-lua5.2-compat.patch
	"

for _i in $_luaversions; do
	makedepends="$makedepends lua$_i-dev"
	subpackages="$subpackages lua$_i-pc:_pc_${_i/./_}"
done

_builddir="$srcdir/$_name-$pkgver"

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

build() {
	for _i in $_luaversions; do
		cd "$srcdir"/build-$_i
		make LUA_PKGCONF="lua$_i" \
			CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS -shared" \
			|| return 1
	done
}

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

_split_pc() {
	local _ver=$1
	pkgdesc="$pkgdesc for Lua $_ver"
	depends=""

	mkdir -p "$subpkgdir"
	cd "$srcdir"/build-$_ver
	make install LUA_PKGCONF="lua$_ver" DESTDIR="$subpkgdir"
}

for _i in $_luaversions; do
	eval "_pc_${_i/./_}() { _split_pc $_i; }"
done

md5sums="a8cd8b0c190e7d72dd7ec2f76e74e3c8  lpc-1.0.0.tar.gz
3fc5dcd932cb30fb0ee94fa5d316ed7c  lpc-lua5.2-compat.patch"
sha256sums="2fbbdfbbfa03a70792bb83655f3e1f990fcb972c55a074717ba417514261805c  lpc-1.0.0.tar.gz
0916026d33d20b24b9a5c324922261323c69e461242aacac22df04c050577b6f  lpc-lua5.2-compat.patch"
sha512sums="a955f802b9ea7c4615b8b22b1f4ab540d41e4ddb0edb5e1b77f2f2e1472c49248cb276f8bfec6b929d23ef01681a0018db6cbd401ade1cc1eb366b0a6ace9772  lpc-1.0.0.tar.gz
e0731fedff4815071dfa4909e6d0c7fd8ea588081d18dc3e44c9fdbff9df82863e3bff8ac37b2d7c22feb53c32de12ea5b57944e6374e51189b0b9bc408f2db8  lpc-lua5.2-compat.patch"