summaryrefslogtreecommitdiff
path: root/lua53/Pkgfile
blob: c16233de42716564bcde4d74956936c5bdcb5937 (plain)
    1 # Description: A programming language designed for extending applications.
    2 # URL: https://www.lua.org/
    3 # Maintainer: Danny Rawlins, crux at romster dot me
    4 # Depends on: readline
    5 
    6 name=lua53
    7 version=5.3.6
    8 release=4
    9 source=(https://www.lua.org/ftp/lua-$version.tar.gz
   10 	liblua.so.patch lua.pc)
   11 
   12 build() {
   13 	cd lua-$version
   14 
   15 	patch -p1 -i $SRC/liblua.so.patch
   16 
   17 	sed -e "s/%VER%/${version%.*}/g;s/%REL%/$version/g" $SRC/lua.pc > lua.pc
   18 
   19 	# Lua 5.3.4 has wrong release version in its Makefile. Fix it.
   20 	sed "s/^R= \$V.4/R= \$V.5/" -i Makefile
   21 
   22 	sed -e 's:llua:llua5.3:' -e 's:/include:/include/lua5.3:' -i lua.pc
   23 	sed -r \
   24 		-e '/^LUA_(SO|A|T)=/ s/lua/lua5.3/' \
   25 		-e '/^LUAC_T=/ s/luac/luac5.3/' \
   26 		-i src/Makefile
   27 
   28 	make MYCFLAGS="$CFLAGS -fPIC" MYLDFLAGS="$LDFLAGS" linux
   29 
   30 	install -d $PKG/usr/include/lua5.3 $PKG/usr/share/man/man1 $PKG/usr/lib
   31 
   32 	make \
   33 		TO_BIN="lua5.3 luac5.3" \
   34 		TO_LIB="liblua5.3.a liblua5.3.so liblua5.3.so.5.3 liblua5.3.so.$version" \
   35 		INSTALL_DATA='cp -d' \
   36 		INSTALL_TOP="$PKG/usr" \
   37 		INSTALL_INC="$PKG/usr/include/lua5.3" \
   38 		INSTALL_MAN="$PKG/usr/share/man/man1" \
   39 		install
   40 
   41 	install -m 0644 -D lua.pc $PKG/usr/lib/pkgconfig/lua${version:0:1}${version:2:1}.pc
   42 	ln -s lua${version:0:1}${version:2:1}.pc $PKG/usr/lib/pkgconfig/lua${version:0:3}.pc
   43 	ln -s lua${version:0:1}${version:2:1}.pc $PKG/usr/lib/pkgconfig/lua-${version:0:3}.pc
   44 
   45 	ln -s liblua5.3.so $PKG/usr/lib/liblua.so.5.3
   46 	ln -s liblua5.3.so $PKG/usr/lib/liblua.so.$version
   47 
   48 	cd $PKG/usr/share/man/man1
   49 	mv lua.1 lua5.3.1
   50 	mv luac.1 luac5.3.1
   51 }

Generated by cgit