Files
BMLFS/build-scripts/lua-53.build
2020-11-26 00:31:40 -06:00

65 lines
2.4 KiB
Bash

#! /bin/bash
# Lua 53
# Source: https://www.lua.org/ftp/lua-5.3.5.tar.gz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: NONE
# Recommended: NONE
# Optional: NONE
patch -Np0 -i ../patches/lua53-void/liblua.so.patch
sed "s/^R= \$V.4/R= \$V.5/" -i Makefile &&
read -p "Compile?" &&
sed -i src/Makefile -r \
-e '/^LUA_(SO|A|T)=/ s;lua;lua5.3;' \
-e '/^LUAC_T=/ s;luac;luac5.3;' &&
make MYCFLAGS="$CFLAGS -fPIC" \
INSTALL_DATA="cp -d" LUA_SO=liblua5.3.so -j2 linux
sudo -S make INSTALL_DATA="cp -d" INSTALL_TOP="${BUILD}/usr" \
TO_BIN="lua5.3 luac5.3" \
TO_LIB="liblua5.3.a liblua5.3.so liblua5.3.so.5.3 liblua5.3.so.5.3.5" \
INSTALL_INC="${BUILD}/usr/include/lua5.3" \
INSTALL_MAN="${BUILD}/usr/share/man/man1" install &&
cp -v ../files/lua53-void/lua.pc /tmp/ &&
sed /tmp/lua.pc \
-e "s;%VER%;5.3;g;s;%REL%;5.3.5;g" > lua5.3.pc &&
sudo -S install -D -m644 lua5.3.pc ${BUILD}/usr/lib/pkgconfig/lua5.3.pc &&
rm -v /tmp/lua.pc &&
cd $BUILD && sudo -S mkdir -v ${BUILD}/install &&
cat > /tmp/slack-desc << "EOF"
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
lua-53: Lua (a powerful, fast, light-weight, embeddable scripting language)
lua-53:
lua-53: Lua combines simple procedural syntax with powerful data description
lua-53: constructs based on associative arrays and extensible semantics.
lua-53: Lua is dynamically typed, runs by interpreting bytecode for a
lua-53: register-based virtual machine, and has automatic memory management
lua-53: with incremental garbage collection, making it ideal for
lua-53: configuration, scripting, and rapid prototyping.
lua-53:
lua-53:
lua-53:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
# Fix a few libraries and headers...
sudo rm -rvf usr/lib/lua/5.3 &&
sudo ln -sv liblua5.3.so.5.3.5 usr/lib/liblua.so.5.3.5 &&
sudo -S makepkg -l y -c n $PKGS/lua-53-5.3.5-$(uname -m)-mlfs.txz &&
sudo -S rm -rf ${BUILD}/*