Was supposed to be a linux distribution, now just a collection of build scripts for packages on top of (ideally) any distribution.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.6 KiB

name=lua
majver=5.3
version=$majver.3
update_url="http://www.lua.org/download.html"
dlextract "http://www.lua.org/ftp/$name-$version.tar.gz" \
'703f75caa4fdf4a911c1a72e67a27498'
header_end
cd "$name-$version"
# Fix paths in luaconf.h
sed -i -e "/LUA_ROOT/s/usr\/local/$(safe_sed "$dir_prefix")/" \
-e "/LUA_LDIR/s/share/$(safe_sed "$dir_datadir")/" \
-e "/LUA_CDIR/s/lib/$(safe_sed "$dir_libdir")/" src/luaconf.h
make linux \
MYLIBS="-lncurses" \
MYCFLAGS="$CFLAGS -fPIC" \
MYLDFLAGS="$LDFLAGS"
make install \
INSTALL_TOP="$PWD/install" \
INSTALL_BIN="\$(INSTALL_TOP)/$dir_bindir" \
INSTALL_LIB="\$(INSTALL_TOP)/$dir_libdir" \
INSTALL_MAN="\$(INSTALL_TOP)/$dir_mandir/man1" \
INSTALL_LMOD="\$(INSTALL_TOP)/$dir_datadir/$majver" \
INSTALL_CMOD="\$(INSTALL_TOP)/$dir_libdir/$majver"
# Check the build log to find this
libs="-lm -Wl,-E -ldl -lreadline -lncurses"
# Build the shared library
( cd "install/$dir_libdir"
ar x liblua.a
rm liblua.a
cc -shared "-Wl,-soname,liblua.so.$majver" *.o $libs -o "liblua.so.$version"
rm *.o
ln -s "liblua.so.$version" "liblua.so.$majver"
ln -s "liblua.so.$version" liblua.so
)
# Link the binary against the shared library
rm "install/$dir_bindir/lua"
cc src/lua.o "install/$dir_libdir/liblua.so" $libs -o "install/$dir_bindir/lua"
rm "install/$dir_bindir/luac"
cc src/luac.o src/lopcodes.o src/ldump.o "install/$dir_libdir/liblua.so" $libs -o "install/$dir_bindir/luac"
# Actually install
mkdir -p "$dir_install/$dir_prefix"
cp -a install/* "$dir_install/$dir_prefix/"
# vim:set tabstop=4 shiftwidth=4 syntax=sh et: