APKBUILD 1.84 KB
Newer Older
Natanael Copa's avatar
Natanael Copa committed
1
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
2

3
_luaversions="5.1 5.2 5.3"
4

5 6
pkgname=lua-pc
_name=lpc
Natanael Copa's avatar
Natanael Copa committed
7
pkgver=1.0.0
Timo Teräs's avatar
Timo Teräs committed
8
pkgrel=9
Natanael Copa's avatar
Natanael Copa committed
9
pkgdesc="Lua Process Call"
10
url="https://github.com/LuaDist/lpc"
11
arch="all"
Natanael Copa's avatar
Natanael Copa committed
12
license="MIT/X11"
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
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
}
Natanael Copa's avatar
Natanael Copa committed
37 38

build() {
39 40 41 42 43 44
	for _i in $_luaversions; do
		cd "$srcdir"/build-$_i
		make LUA_PKGCONF="lua$_i" \
			CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS -shared" \
			|| return 1
	done
45 46 47
}

package() {
48
	mkdir -p "$pkgdir"
Natanael Copa's avatar
Natanael Copa committed
49 50
}

51 52 53
_split_pc() {
	local _ver=$1
	pkgdesc="$pkgdesc for Lua $_ver"
54
	install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
55
	depends=""
56 57 58

	mkdir -p "$subpkgdir"
	cd "$srcdir"/build-$_ver
59
	make install LUA_PKGCONF="lua$_ver" DESTDIR="$subpkgdir"
60 61 62 63 64 65 66
}

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

md5sums="a8cd8b0c190e7d72dd7ec2f76e74e3c8  lpc-1.0.0.tar.gz
Timo Teräs's avatar
Timo Teräs committed
67
97c3a94797b03b84c6340781b413e5be  lpc-lua5.2-compat.patch"
68
sha256sums="2fbbdfbbfa03a70792bb83655f3e1f990fcb972c55a074717ba417514261805c  lpc-1.0.0.tar.gz
Timo Teräs's avatar
Timo Teräs committed
69
7937be39287210166bbe364bee56f575f63a1b928acc838388d09fb6ab1b3fe4  lpc-lua5.2-compat.patch"
70
sha512sums="a955f802b9ea7c4615b8b22b1f4ab540d41e4ddb0edb5e1b77f2f2e1472c49248cb276f8bfec6b929d23ef01681a0018db6cbd401ade1cc1eb366b0a6ace9772  lpc-1.0.0.tar.gz
Timo Teräs's avatar
Timo Teräs committed
71
d98aba2a757cb4dd6ceebefb4b0bebb4b91d8a38360193f6246be727f0dc89fe438154596c22232d16539f86d5589730e13834cdaf5b71965728904fbdea8615  lpc-lua5.2-compat.patch"