summaryrefslogtreecommitdiff
path: root/repo/system
diff options
context:
space:
mode:
Diffstat (limited to 'repo/system')
-rw-r--r--repo/system/ljx.xibuild19
-rw-r--r--repo/system/lua-lpeg.xibuild50
-rw-r--r--repo/system/lua-mpack.xibuild56
-rw-r--r--repo/system/lua.xibuild67
-rw-r--r--repo/system/lua5-1.xibuild77
-rw-r--r--repo/system/luajit.xibuild32
-rw-r--r--repo/system/tree-sitter.xibuild22
7 files changed, 288 insertions, 35 deletions
diff --git a/repo/system/ljx.xibuild b/repo/system/ljx.xibuild
new file mode 100644
index 0000000..c28cd7b
--- /dev/null
+++ b/repo/system/ljx.xibuild
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+MAKEDEPS="make "
+DEPS="musl"
+
+PKG_VER=1.3
+SOURCE=https://github.com/katlogic/ljx/archive/refs/tags/LJX-v$PKG_VER.tar.gz
+
+DESC="LuaJIT experimental 5.2/5.3 port"
+
+
+build () {
+ make PREFIX=/usr
+
+}
+
+package () {
+ make install DESTDIR="$PKG_DEST" PREFIX=/usr
+}
diff --git a/repo/system/lua-lpeg.xibuild b/repo/system/lua-lpeg.xibuild
new file mode 100644
index 0000000..f2b3b4d
--- /dev/null
+++ b/repo/system/lua-lpeg.xibuild
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+MAKEDEPS="make tar patch lua lua5-1"
+DEPS="musl"
+
+PKG_VER=1.0.2
+SOURCE=http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-$PKG_VER.tar.gz
+DESC="Pattern-matching library for Lua"
+ADDITIONAL="
+ build-static-lib.patch
+ test-fix-setlocale.patch
+"
+
+luaversions="5.1 5.4"
+
+prepare () {
+ apply_patches
+
+# lver=$(lua -v | cut -d" " -f2 | cut -d. -f-2)
+ sed -i -e 's/^CFLAGS =/CFLAGS +=/' \
+ -e 's/^COPT =/# COPT =/' \
+ makefile
+
+ for lver in $luaversions; do
+ tar xf lpeg-$PKG_VER.tar.gz
+ mv lpeg-$PKG_VER build-$lver
+ done
+}
+
+build () {
+ for lver in $luaversions; do
+ echo building for $lver
+ make -C build-$lver LUADIR=/usr/include/lua$lver
+ done
+}
+
+package () {
+ for lver in $luaversions; do
+ cd build-$lver
+ install -Dm755 lpeg.so \
+ $PKG_DEST/usr/lib/lua/$lver/lpeg.so
+ install -Dm644 re.lua \
+ $PKG_DEST/usr/share/lua/$lver/re.lua
+
+ local rockdir="$PKG_DEST/usr/lib/luarocks/rocks-$lver/lua-lpeg/$PKG_VER-1"
+ mkdir -p "$rockdir"
+ echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
+ cd ..
+ done
+}
diff --git a/repo/system/lua-mpack.xibuild b/repo/system/lua-mpack.xibuild
new file mode 100644
index 0000000..85c5195
--- /dev/null
+++ b/repo/system/lua-mpack.xibuild
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+MAKEDEPS="make "
+DEPS="musl libmpack"
+
+PKG_VER=1.0.9
+SOURCE=https://github.com/libmpack/libmpack-lua/archive/$PKG_VER.tar.gz
+DESC="Libmpack bindings for Lua"
+ADDITIONAL="
+dont-install-busted.patch
+skip-memleak-test.patch
+"
+
+luaversions="5.1 "
+
+prepare () {
+ apply_patches
+
+ for lver in $luaversions; do
+ tar xf $PKG_VER.tar.gz
+ mv libmpack-lua-$PKG_VER build-$lver
+ done
+
+}
+
+build () {
+ for lver in $luaversions; do
+ echo "building for lua $lver"
+ make -C build-$lver \
+ FETCH=false \
+ USE_SYSTEM_LUA=yes \
+ USE_SYSTEM_MPACK=yes \
+ LUA=lua$lver \
+ LUA_IMPL=lua$lver
+ #LUA_INCLUDE="$(pkg-config --cflags lua$lver)" \
+ #LUA_LIB="$(pkg-config --libs lua$lver)"
+ done
+
+}
+
+package () {
+ for lver in $luaversions; do
+ echo "building for lua $lver"
+ local rockdir="$PKG_DEST/usr/lib/luarocks/rocks-$lver/mpack/$PKG_VER-0"
+
+ make -C build-$lver \
+ USE_SYSTEM_LUA=yes \
+ USE_SYSTEM_MPACK=yes \
+ LUA_CMOD_INSTALLDIR="$(pkg-config --variable=INSTALL_CMOD lua$lver)" \
+ DESTDIR="$subpkgdir" \
+ install || exit 1
+
+ mkdir -p "$rockdir"
+ echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
+ done
+}
diff --git a/repo/system/lua.xibuild b/repo/system/lua.xibuild
index c8c992f..fdcf8ab 100644
--- a/repo/system/lua.xibuild
+++ b/repo/system/lua.xibuild
@@ -7,53 +7,50 @@ PKG_VER=5.4.4
SOURCE=https://www.lua.org/ftp/lua-$PKG_VER.tar.gz
ADDITIONAL="
https://www.linuxfromscratch.org/patches/blfs/svn/lua-$PKG_VER-shared_library-1.patch
+ lua5.4.pc
"
+
DESC="A powerful lightweight scripting language"
prepare () {
- cat > lua.pc << "EOF"
-V=5.4
-R=5.4.4
-
-prefix=/usr
-INSTALL_BIN=${prefix}/bin
-INSTALL_INC=${prefix}/include
-INSTALL_LIB=${prefix}/lib
-INSTALL_MAN=${prefix}/share/man/man1
-INSTALL_LMOD=${prefix}/share/lua/${V}
-INSTALL_CMOD=${prefix}/lib/lua/${V}
-exec_prefix=${prefix}
-libdir=${exec_prefix}/lib
-includedir=${prefix}/include
-
-Name: Lua
-Description: An Extensible Extension Language
-Version: ${R}
-Requires:
-Libs: -L${libdir} -llua -lm -ldl
-Cflags: -I${includedir}
-EOF
-
-patch -Np1 -i lua-$PKG_VER-shared_library-1.patch
+ sed -e "s|@MAJOR_VER@|${PKG_VER%.*}|g" \
+ -e "s|@MINOR_VER@|${PKG_VER}|g" \
+ -i lua5.4.pc
+
+ patch -Np1 -i lua-$PKG_VER-shared_library-1.patch
+ cat > configure.ac <<-EOF
+ top_buildir=.
+
+ AC_INIT(src/luaconf.h)
+ AC_PROG_LIBTOOL
+ AC_OUTPUT()
+ EOF
+ libtoolize --force --install && aclocal && autoconf
+
}
build () {
- make linux
+ ./configure \
+ --prefix=/usr
+ cd src
+ CFLAGS="$CFLAGS -DLUA_USE_LINUX -DLUA_COMPAT_5_2" \
+ SYSLDFLAGS="$LDFLAGS" \
+ RPATH="/usr/lib" make
}
package () {
- make INSTALL_TOP=/usr \
- DESTDIR=$PKG_DEST \
- INSTALL="install" \
- INSTALL_MAN=/usr/share/man/man1 \
- TO_LIB="liblua.so liblua.so.${PKG_VER} liblua.so.5.4.4" \
- install &&
-
- mkdir -p $PKG_DEST/usr/share/doc/lua-$PKG_VER &&
+ 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/lua${PKG_VER%.*} \
+ INSTALL_LIB="$PKG_DEST"/usr/lib/lua${PKG_VER%.*} install
+
+
+ mkdir -p $PKG_DEST/usr/share/doc/lua-$PKG_VER
for s in html css gif png; do
cp doc/*.$s $PKG_DEST/usr/share/doc/lua-$PKG_VER
done
-
- install -m644 -D lua.pc $PKG_DEST/usr/lib/pkgconfig/lua.pc
+ install -Dm644 lua5.4.pc "$PKG_DEST"/usr/lib/pkgconfig/lua5.4.pc
}
diff --git a/repo/system/lua5-1.xibuild b/repo/system/lua5-1.xibuild
new file mode 100644
index 0000000..5fc5f80
--- /dev/null
+++ b/repo/system/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
+}
diff --git a/repo/system/luajit.xibuild b/repo/system/luajit.xibuild
new file mode 100644
index 0000000..09f6015
--- /dev/null
+++ b/repo/system/luajit.xibuild
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+MAKEDEPS="make "
+DEPS="musl lua5-1"
+
+PKG_VER=2.1
+SUBVER=20220310
+SOURCE=https://github.com/openresty/luajit2/archive/refs/tags/v$PKG_VER-$SUBVER.tar.gz
+ADDITIONAL="
+module-paths.patch
+"
+
+DESC="OpenResty's branch of LuaJIT"
+
+prepare () {
+ apply_patches
+}
+
+build () {
+ local xcflags="-DLUAJIT_ENABLE_LUA52COMPAT -DLUAJIT_NUMMODE=2"
+ [ "$CARCH" = x86_64 ] && xcflags="$xcflags -msse4.2"
+ make amalg PREFIX=/usr XCFLAGS="$xcflags"
+
+}
+
+package () {
+ make install DESTDIR="$PKG_DEST" PREFIX=/usr
+
+ install -Dm644 COPYRIGHT \
+ $PKG_DEST/usr/share/licenses/luajit/COPYRIGHT
+
+}
diff --git a/repo/system/tree-sitter.xibuild b/repo/system/tree-sitter.xibuild
new file mode 100644
index 0000000..ccd2b77
--- /dev/null
+++ b/repo/system/tree-sitter.xibuild
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+MAKEDEPS="make "
+DEPS="musl"
+
+PKG_VER=0.20.6
+SOURCE=https://github.com/tree-sitter/tree-sitter/archive/v$PKG_VER/tree-sitter-$PKG_VER.tar.gz
+DESC="Incremental parsing system for programming tools"
+
+prepare () {
+ cargo fetch --locked
+}
+
+build () {
+ make
+ cargo build -p tree-sitter-cli --frozen --release
+}
+
+package () {
+ make DESTDIR=$PKG_DEST PREFIX=/usr install
+ install -D -m755 target/release/tree-sitter $PKG_DEST/usr/bin/
+}