aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-pty/APKBUILD
blob: d3087dca08692d7f8ceecf7839fac7c9ae6b1964 (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lua-pty
_pkgname=lpty
pkgver=1.2.1
_rockver=1
pkgrel=1
pkgdesc="Lua module to control other programs via PTYs."
url="http://www.tset.de/lpty/"
arch="all"
license="MIT/X11"
depends=""
makedepends=""
source="http://www.tset.de/downloads/$_pkgname-$pkgver-$_rockver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver-$_rockver"

_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

prepare() {
	default_prepare || return 1

	local lver; for lver in $_luaversions; do
		cp -r "$builddir" "$builddir-$lver" || return 1
	done
}

build() {
	local lver; for lver in $_luaversions; do
		msg "Building for Lua $lver..."

		cd "$builddir-$lver"
		make CFLAGS="$CFLAGS -fPIC" \
			LUA_INCDIR="$(pkg-config --variable=includedir lua$lver)" \
			LUA_LIBDIR="$(pkg-config --variable=libdir lua$lver)" \
			LUA=lua$lver || return 1
	done
}

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

_subpackage() {
	local lver="${subpkgname:3:3}"
	local rockdir="$subpkgdir/usr/lib/luarocks/rocks-$lver/$_pkgname/$pkgver-$_rockver"
	pkgdesc="$pkgdesc (for Lua $lver)"
	depends="lua$lver"
	install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
	[ "$lver" = 5.1 ] && replaces="$pkgname"

	cd "$builddir-$lver"
	make INST_DIR="$subpkgdir/usr" LUAVERSION=$lver install

	mkdir -p "$rockdir"
	echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
}

md5sums="6eadcd08580d8eb5e60abe7273b74d61  lpty-1.2.1-1.tar.gz"
sha256sums="46bf8142ac06a4ed4ac64036f03af63d69a65d3fc03ce578fbb33d56fd5dfb65  lpty-1.2.1-1.tar.gz"
sha512sums="46ffe9f5d9d70bda453c86965b218be4908a965e915aed5e0f4a788f85a8e67e88c9d5aea960048a584bfab08e02b64edfcfafa463bc3821dce056515380e692  lpty-1.2.1-1.tar.gz"