aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua5.1/APKBUILD
blob: 20ef64c5660ab6cbcf0f8bf31aa4567d56d4afc3 (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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lua5.1
pkgver=5.1.5
_ver=$pkgver
pkgrel=1
pkgdesc="A powerful light-weight programming language designed for extending applications."
url="http://www.lua.org/"
arch="all"
license="MIT"
depends=
makedepends="libtool autoconf automake"
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
source="http://www.lua.org/ftp/lua-$_ver.tar.gz
	lua-5.1-make.patch
	lua-5.1-module_paths.patch
	lua-5.1-readline.patch
	"

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

	# we want packages to find our things
	sed -i -e 's:/usr/local:/usr:' etc/lua.pc

	# correct lua versioning
	sed -i -e 's/\(LIB_VERSION = \).*/\16:4:1/' src/Makefile

	# we use libtool
	cat >configure.ac <<EOF
top_buildir=.

AC_INIT(src/luaconf.h)
AC_PROG_LIBTOOL
AC_OUTPUT()
EOF
	libtoolize --force --install && aclocal && autoconf
}

build() {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		|| return 1

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

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

	for i in  "$pkgdir"/usr/bin/*; do
		mv $i ${i}5.1
	done

	install -D -m 644 etc/lua.pc "$pkgdir"/usr/lib/pkgconfig/lua5.1.pc
	install -D -m 644 doc/lua.1 "$pkgdir"/usr/share/man/man1/lua5.1.1
	install -D -m 644 doc/luac.1 "$pkgdir"/usr/share/man/man1/luac5.1.1
}

dev() {
	default_dev
	replaces="lua-dev"
}

libs() {
	pkgdesc="Lua dynamic library runtime"
	replaces="lua lua-libs"
	mkdir -p "$subpkgdir"/usr
	mv "$pkgdir"/usr/lib "$subpkgdir"/usr/
}


md5sums="2e115fe26e435e33b0d5c022e4490567  lua-5.1.5.tar.gz
7fa6ce1f09e18415f2ba00db437f2804  lua-5.1-make.patch
e60ef15deefb72a5930c498f1184aced  lua-5.1-module_paths.patch
f2205b897edb31292a1f597a7fd638cb  lua-5.1-readline.patch"
sha256sums="2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333  lua-5.1.5.tar.gz
99a709038b0910edff3e40a2d368f35abe8eebbd699ee06aea4005de401ce843  lua-5.1-make.patch
1115b6aa00eb4e918156ae70c763534bd2f603ba888da75e4908c19c2ac3e5f7  lua-5.1-module_paths.patch
1f0f90eb8103e338f1188cc884c0c59cc6afd023828c11d86b8145b2a8d1efc2  lua-5.1-readline.patch"
sha512sums="0142fefcbd13afcd9b201403592aa60620011cc8e8559d4d2db2f92739d18186860989f48caa45830ff4f99bfc7483287fd3ff3a16d4dec928e2767ce4d542a9  lua-5.1.5.tar.gz
ec5945f9f73d87fceaaa2418f1dc5c0f1e2ab1392e3a110e9ca737bfd122a951543899cd9b6170771374c35de8dd106f7b51ba9885eae281241c79b47ee58370  lua-5.1-make.patch
123b115389d01d383af8698d2ed66c75bb7c3e2d33de57b8539ae56a9478930a0a72fa5657e78cc1c5b6bef00d07ec3a51e19ec0e419647e84eb158fb5c4795a  lua-5.1-module_paths.patch
a99154258419dc2e582804eae97517687e5b8b5f731dc91722193d1ff470b8522af6ff4e7142c9258afe4734cd52e6987d3c2108ac52b1487a262f1e89f2f332  lua-5.1-readline.patch"