summaryrefslogtreecommitdiff
path: root/repo/system/lua5-1/lua5-1.xibuild
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-05-04 23:52:30 +0100
committerdavidovski <david@davidovski.xyz>2022-05-04 23:52:30 +0100
commit739c65c54cb0e957df5e9b76f93fb02554e5cac3 (patch)
tree09ddfa0a342f3ea9de136cb50abdd79821bf1b53 /repo/system/lua5-1/lua5-1.xibuild
parent4c585ad54388285500fd18a6aaa516894e0f2c16 (diff)
moved everything to new file formatting
Diffstat (limited to 'repo/system/lua5-1/lua5-1.xibuild')
-rw-r--r--repo/system/lua5-1/lua5-1.xibuild77
1 files changed, 77 insertions, 0 deletions
diff --git a/repo/system/lua5-1/lua5-1.xibuild b/repo/system/lua5-1/lua5-1.xibuild
new file mode 100644
index 0000000..5fc5f80
--- /dev/null
+++ b/repo/system/lua5-1/lua5-1.xibuild
@@ -0,0 +1,77 @@
+#!/bin/sh
+
+MAKEDEPS="make "
+DEPS="readline"
+
+PKG_VER=5.1.5
+SOURCE=https://www.lua.org/ftp/lua-$PKG_VER.tar.gz
+
+# use alpinelinux's makefile
+ADDITIONAL="
+ lua-5.1-make.patch
+ lua-5.1-module_paths.patch
+ lua-5.1-readline.patch
+"
+
+DESC="A powerful lightweight scripting language"
+
+prepare () {
+
+ apply_patches
+
+ # we want packages to find our things
+ sed -i 's:/usr/local:/usr:' etc/lua.pc
+
+ # correct lua versioning
+ sed -i 's/\(LIB_VERSION = \).*/\16:4:1/' src/Makefile
+
+ cat > configure.ac <<-EOF
+ top_buildir=.
+
+ AC_INIT(src/luaconf.h)
+ AC_PROG_LIBTOOL
+ AC_OUTPUT()
+ EOF
+ libtoolize --force --install && aclocal && autoconf
+
+
+}
+
+build () {
+ ./configure \
+ --prefix=/usr
+ cd src
+ make CFLAGS="$CFLAGS -DLUA_USE_LINUX" \
+ SYSLDFLAGS="$LDFLAGS" \
+ LIB_LIBS="-lpthread -lm -ldl" \
+ RPATH="/usr/lib" \
+ V=${PKG_VER%.*} alpine_all
+}
+
+package () {
+ cd ..
+ sed -i "s/INSTALL= install -p/INSTALL= install/g" Makefile
+ make V=$PKG_VER \
+ INSTALL_TOP="$PKG_DEST/usr" \
+ INSTALL_INC="$PKG_DEST/usr/include" \
+ INSTALL_LIB="$PKG_DEST/usr/lib" \
+ alpine_install
+
+ install -D -m 644 etc/lua.pc "$PKG_DEST"/usr/lib/pkgconfig/lua5.1.pc
+ install -D -m 644 doc/lua.1 "$PKG_DEST"/usr/share/man/man1/lua5.1.1
+ install -D -m 644 doc/luac.1 "$PKG_DEST"/usr/share/man/man1/luac5.1.1
+
+ mkdir -p "$PKG_DEST"/usr/share/doc/lua5-1/
+ install -m644 doc/*.html doc/*.css doc/logo.gif doc/cover.png \
+ "$PKG_DEST"/usr/share/doc/lua5-1/
+
+ # Create symlinks without version suffix.
+ ln -s lua5.1 "$PKG_DEST"/usr/bin/lua
+ ln -s luac5.1 "$PKG_DEST"/usr/bin/luac
+ ln -s lua5.1.pc "$PKG_DEST"/usr/lib/pkgconfig/lua.pc
+ ln -s lua5.1.1 "$PKG_DEST"/usr/share/man/man1/lua.1
+ ln -s luac5.1.1 "$PKG_DEST"/usr/share/man/man1/luac.1
+
+
+ install -m644 -D etc/lua.pc $PKG_DEST/usr/lib/pkgconfig/lua5.1.pc
+}