summaryrefslogtreecommitdiffstats
path: root/main/lua/APKBUILD
blob: 146adf7ff37a1506a4be3225669aa9816824fea3 (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lua
pkgver=5.1.4_p3
_ver=${pkgver%_p*}
pkgrel=3
pkgdesc="A powerful light-weight programming language designed for extending applications."
url="http://www.lua.org/"
arch="all"
license="MIT"
depends=
makedepends="libtool"
subpackages="$pkgname-dev $pkgname-doc"
source="http://www.$pkgname.org/ftp/$pkgname-$_ver.tar.gz
	http://www.lua.org/ftp/patch-lua-5.1.4-${pkgver#*_p}
	lua-5.1-make.patch
	lua-5.1-module_paths.patch
	lua-5.1-readline.patch
	"

_builddir="$srcdir"/lua-$_ver
build () 
{ 
	cd "$_builddir"
	for i in $source; do
		case $i in
		patch*|*.patch)
			msg "Applying $i"
			patch -p1 -i "$srcdir"/$i || return 1
			;;
		esac
	done

	# correct lua versioning
	sed -i -e 's/\(LIB_VERSION = \)6:1:1/\16:4:1/' src/Makefile
	
	# we want packages to find our things
	sed -i -e 's:/usr/local:/usr:' etc/lua.pc

	cd src
	make CFLAGS=" -DLUA_USE_LINUX $CFLAGS" \
		RPATH="/lib" \
		LIB_LIBS="-lpthread -lm -ldl" \
		V=$pkgver \
		gentoo_all || return 1
}

package() {
	cd "$_builddir"
	make INSTALL_TOP="$pkgdir"/usr INSTALL_LIB="$pkgdir"/lib \
	     INSTALL_BIN="$pkgdir"/bin \
		V=$pkgver gentoo_install || return 1
	rm "$pkgdir"/lib/*.la || return 1

	install -D -m 644 etc/lua.pc "$pkgdir"/usr/lib/pkgconfig/lua.pc
	install -D -m 644 doc/lua.1 "$pkgdir"/usr/share/man/man1/lua.1
	install -D -m 644 doc/luac.1 "$pkgdir"/usr/share/man/man1/luac.1
}
md5sums="d0870f2de55d59c1c8419f36e8fac150  lua-5.1.4.tar.gz
998ef7886183f61d3a5ca891a9ce6a79  patch-lua-5.1.4-3
0145ff6036eb6bfdab427dc8f0c3f3c0  lua-5.1-make.patch
e60ef15deefb72a5930c498f1184aced  lua-5.1-module_paths.patch
f2205b897edb31292a1f597a7fd638cb  lua-5.1-readline.patch"