blob: f2e769a7e42620c5b60541ec1f37aa9a1e45da01 (
plain)
1 # Description: A programming language designed for extending applications.
2 # URL: http://www.lua.org/
3 # Maintainer: Danny Rawlins, crux at romster dot me
4 # Depends on: readline
5
6 name=lua51
7 version=5.1.5
8 release=1
9 source=(http://www.lua.org/ftp/lua-$version.tar.gz
10 lua.diff lua-5.1-cflags.diff)
11
12 build() {
13 cd lua-$version
14
15 patch -p1 -i $SRC/lua.diff
16 patch -p1 -i $SRC/lua-5.1-cflags.diff
17 export CFLAGS="$CFLAGS -fPIC"
18
19 sed \
20 -e 's|llua|llua5.1|' \
21 -e 's|/include|/include/lua5.1|' \
22 -i etc/lua.pc
23
24 sed -r \
25 -e '/^LUA_(SO|A|T)=/ s/lua/lua5.1/' \
26 -e '/^LUAC_T=/ s/luac/luac5.1/' \
27 -i src/Makefile
28
29 make MYCFLAGS="$CFLAGS" MYLDFLAGS="$LDFLAGS" linux
30
31 install -d $PKG/usr/include/lua5.1 $PKG/usr/share/man/man1 $PKG/usr/lib
32
33 make \
34 TO_BIN="lua5.1 luac5.1" \
35 TO_LIB="liblua5.1.a liblua5.1.so liblua5.1.so.5.1 liblua5.1.so.$version" \
36 INSTALL_DATA='cp -d' \
37 INSTALL_TOP="$PKG/usr" \
38 INSTALL_INC="$PKG/usr/include/lua5.1" \
39 INSTALL_MAN="$PKG/usr/share/man/man1" \
40 install
41
42 install -m 0644 -D etc/lua.pc $PKG/usr/lib/pkgconfig/lua5.1.pc
43
44 # fixups
45 ln -s liblua5.1.so $PKG/usr/lib/liblua.so.5.1
46 ln -s liblua5.1.so $PKG/usr/lib/liblua.so.$version
47 cd $PKG/usr/share/man/man1
48 mv lua.1 lua5.1.1
49 mv luac.1 luac5.1.1
50 }
|