Add configuration files and patches for R, SDL2, SDL3, Tk, and Vala

- Introduced `r.toml` for R package configuration, including build flags and dependencies.
- Added `sdl2-compat.toml` for SDL2 compatibility layer with SDL3, specifying build and runtime dependencies.
- Created a patch for SDL3 to handle cases when XInput2 is not available, ensuring compatibility.
- Added `sdl3.toml` for SDL3 configuration, including build flags and dependencies.
- Introduced `tk.toml` for Tk configuration, detailing build flags and runtime dependencies.
- Added a patch for Vala to ensure POSIX compliance in the test runner script, improving portability.
This commit is contained in:
2026-03-24 00:04:10 -05:00
parent bf96e50e44
commit 49bf7bbb5d
78 changed files with 4605 additions and 14 deletions
+32
View File
@@ -0,0 +1,32 @@
make MYCFLAGS="$CFLAGS -fPIC" MYLDFLAGS="$LDFLAGS" linux
cd ../lua++-5.5.0
make MYCFLAGS="$CXXFLAGS -fPIC" MYLDFLAGS="$LDFLAGS" LUA_A=liblua++.a LUA_SO=liblua++.so linux
cd ../lua-5.5.0
make \
TO_LIB="liblua.so liblua.so.5.5 liblua.so.5.5.0" \
INSTALL_DATA='cp -d' \
INSTALL_TOP="$DESTDIR"/usr \
INSTALL_MAN="$DESTDIR"/usr/share/man/man1 \
install
ln -sf /usr/bin/lua "$DESTDIR"/usr/bin/lua5.5
ln -sf /usr/bin/luac "$DESTDIR"/usr/bin/luac5.5
ln -sf /usr/lib/liblua.so.5.5.0 "$DESTDIR"/usr/lib/liblua5.5.so
install -Dm644 lua.pc "$DESTDIR"/usr/lib/pkgconfig/lua55.pc
ln -sf lua55.pc "$DESTDIR"/usr/lib/pkgconfig/lua.pc
ln -sf lua55.pc "$DESTDIR"/usr/lib/pkgconfig/lua5.5.pc
ln -sf lua55.pc "$DESTDIR"/usr/lib/pkgconfig/lua-5.5.pc
cd ../lua++-5.5.0
make \
TO_LIB="liblua++.so liblua++.so.5.5 liblua++.so.5.5.0" \
INSTALL_BIN=null INSTALL_INC=null INSTALL_MAN=../null \
INSTALL_DATA='cp -d' \
INSTALL_TOP="$DESTDIR"/usr \
install
ln -sf /usr/lib/liblua++.so.5.5.0 "$DESTDIR"/usr/lib/liblua++5.5.so
install -Dm644 lua++.pc "$DESTDIR"/usr/lib/pkgconfig/lua++55.pc
ln -sf lua++55.pc "$DESTDIR"/usr/lib/pkgconfig/lua++.pc
ln -sf lua++55.pc "$DESTDIR"/usr/lib/pkgconfig/lua++5.5.pc
ln -sf lua++55.pc "$DESTDIR"/usr/lib/pkgconfig/lua++-5.5.pc
+186
View File
@@ -0,0 +1,186 @@
diff -urN a/Makefile b/Makefile
--- a/Makefile 2025-06-26 08:04:37.000000000 -0500
+++ b/Makefile 2026-03-23 21:17:07.502287273 -0500
@@ -18,9 +18,9 @@
INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
-# How to install. If your install program does not support "-p", then
+# How to install. If your install program does not preserve timestamps, then
# you may have to run ranlib on the installed liblua.a.
-INSTALL= install -p
+INSTALL?= install
INSTALL_EXEC= $(INSTALL) -m 0755
INSTALL_DATA= $(INSTALL) -m 0644
#
@@ -30,8 +30,8 @@
# INSTALL_DATA= $(INSTALL)
# Other utilities.
-MKDIR= mkdir -p
-RM= rm -f
+MKDIR?= mkdir -p
+RM?= rm -f
# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
@@ -52,7 +52,7 @@
all: $(PLAT)
$(PLATS) help test clean:
- @cd src && $(MAKE) $@
+ @cd src && $(MAKE) $@ V=$(V) R=$(R)
install: dummy
cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
diff -urN a/src/Makefile b/src/Makefile
--- a/src/Makefile 2025-07-06 19:19:14.000000000 -0500
+++ b/src/Makefile 2026-03-23 21:17:07.502287273 -0500
@@ -6,15 +6,21 @@
# Your platform. See PLATS for possible values.
PLAT= guess
-CC= gcc -std=gnu99
-CFLAGS= -O2 -Wall -Wextra $(SYSCFLAGS) $(MYCFLAGS)
-LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
-LIBS= -lm $(SYSLIBS) $(MYLIBS)
-
-AR= ar rcu
-RANLIB= ranlib
-RM= rm -f
-UNAME= uname
+CC?= cc
+CXX?= c++
+CCSTD?= -std=gnu99
+CFLAGS?= $(CCSTD) -O2 -Wall -Wextra
+ALLCFLAGS= $(CFLAGS) $(SYSCFLAGS) $(MYCFLAGS)
+LDFLAGS?=
+ALLLDFLAGS= $(LDFLAGS) $(SYSLDFLAGS) $(MYLDFLAGS)
+LIBS?= -lm
+ALLLIBS= $(LIBS) $(SYSLIBS) $(MYLIBS)
+
+AR?= ar
+ARFLAGS?= rcu
+RANLIB?= ranlib
+RM?= rm -f
+UNAME?= uname
SYSCFLAGS=
SYSLDFLAGS=
@@ -28,11 +34,20 @@
# Special flags for compiler modules; -Os reduces code size.
CMCFLAGS=
+# Use C mode when a C++ driver is selected for compiling Lua's C sources.
+CCMODE=
+CCLINK= $(CC)
+ifneq ($(filter %++ c++,$(notdir $(firstword $(CC)))),)
+CCMODE= -x c
+endif
+CCCOMPILE= $(CC) $(CCMODE)
+
# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
PLATS= guess aix bsd c89 freebsd generic ios linux macosx mingw posix solaris
LUA_A= liblua.a
+LUA_SO= liblua.so
CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o
LIB_O= lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o
BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
@@ -44,7 +59,7 @@
LUAC_O= luac.o
ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
+ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO)
ALL_A= $(LUA_A)
# Targets start here.
@@ -57,14 +72,19 @@
a: $(ALL_A)
$(LUA_A): $(BASE_O)
- $(AR) $@ $(BASE_O)
+ $(AR) $(ARFLAGS) $@ $(BASE_O)
$(RANLIB) $@
+$(LUA_SO): $(CORE_O) $(LIB_O)
+ $(CCLINK) -shared $(ALLLDFLAGS) -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? $(ALLLIBS)
+ ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V)
+ ln -sf $(LUA_SO).$(R) $(LUA_SO)
+
$(LUA_T): $(LUA_O) $(LUA_A)
- $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+ $(CCLINK) -o $@ $(ALLLDFLAGS) $(LUA_O) $(LUA_A) $(ALLLIBS)
$(LUAC_T): $(LUAC_O) $(LUA_A)
- $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+ $(CCLINK) -o $@ $(ALLLDFLAGS) $(LUAC_O) $(LUA_A) $(ALLLIBS)
test:
./$(LUA_T) -v
@@ -73,15 +93,22 @@
$(RM) $(ALL_T) $(ALL_O)
depend:
- @$(CC) $(CFLAGS) -MM l*.c
+ @$(CCCOMPILE) $(ALLCFLAGS) -MM l*.c
echo:
@echo "PLAT= $(PLAT)"
@echo "CC= $(CC)"
+ @echo "CXX= $(CXX)"
+ @echo "CCSTD= $(CCSTD)"
+ @echo "CCMODE= $(CCMODE)"
@echo "CFLAGS= $(CFLAGS)"
+ @echo "ALLCFLAGS= $(ALLCFLAGS)"
@echo "LDFLAGS= $(LDFLAGS)"
+ @echo "ALLLDFLAGS= $(ALLLDFLAGS)"
@echo "LIBS= $(LIBS)"
+ @echo "ALLLIBS= $(ALLLIBS)"
@echo "AR= $(AR)"
+ @echo "ARFLAGS= $(ARFLAGS)"
@echo "RANLIB= $(RANLIB)"
@echo "RM= $(RM)"
@echo "UNAME= $(UNAME)"
@@ -105,7 +132,7 @@
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" SYSLIBS="-Wl,-E"
c89:
- $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_C89" CC="gcc -std=c89"
+ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_C89" CCSTD="-std=c89"
@echo ''
@echo '*** C89 does not guarantee 64-bit integers for Lua.'
@echo '*** Make sure to compile all external Lua libraries'
@@ -113,7 +140,7 @@
@echo ''
FreeBSD NetBSD OpenBSD freebsd:
- $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc"
+ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit"
generic: $(ALL)
@@ -141,15 +168,18 @@
# Targets that do not create files (not all makes understand .PHONY).
.PHONY: all $(PLATS) help test clean default o a depend echo
+%.o: %.c
+ $(CCCOMPILE) $(ALLCFLAGS) -c -o $@ $<
+
# Compiler modules may use special flags.
llex.o:
- $(CC) $(CFLAGS) $(CMCFLAGS) -c llex.c
+ $(CCCOMPILE) $(ALLCFLAGS) $(CMCFLAGS) -c -o $@ llex.c
lparser.o:
- $(CC) $(CFLAGS) $(CMCFLAGS) -c lparser.c
+ $(CCCOMPILE) $(ALLCFLAGS) $(CMCFLAGS) -c -o $@ lparser.c
lcode.o:
- $(CC) $(CFLAGS) $(CMCFLAGS) -c lcode.c
+ $(CCCOMPILE) $(ALLCFLAGS) $(CMCFLAGS) -c -o $@ lcode.c
# DO NOT DELETE
+20
View File
@@ -0,0 +1,20 @@
V=%VER%
R=%REL%
prefix=/usr
INSTALL_BIN=${prefix}/bin
INSTALL_INC=${prefix}/include
INSTALL_LIB=${prefix}/lib
INSTALL_MAN=${prefix}/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
Cflags: -I${includedir}
+36
View File
@@ -0,0 +1,36 @@
[alternatives]
provides = ["lua55"]
[build]
type = "custom"
[dependencies]
runtime = ["readline"]
[[manual_sources]]
files = [
"paths.patch",
"lua.pc",
"lua-5.5.0-posixify.patch"
]
[package]
description = "Powerful lightweight programming language designed for extending applications"
homepage = "https://www.lua.org/"
license = "MIT"
name = "lua"
version = "5.5.0"
[[source]]
extract_dir = "$name-$version"
patches = [
"paths.patch",
"lua-5.5.0-posixify.patch"
]
post_extract = [
"cp -r ../lua-$version ../lua++-$version",
'sed "s/%VER%/5.5/g;s/%REL%/$version/g" ../lua.pc > lua.pc',
'sed "s/%VER%/5.5/g;s/%REL%/$version/g;s/-llua/-llua++/g" lua.pc > ../lua++-$version/lua++.pc',
]
sha256 = "57ccc32bbbd005cab75bcc52444052535af691789dba2b9016d5c50640d68b3d"
url = "https://www.lua.org/ftp/lua-$version.tar.gz"
+33
View File
@@ -0,0 +1,33 @@
diff --git a/src/luaconf.h b/src/luaconf.h
--- a/src/luaconf.h 2023-05-03 06:02:30.000000000 +1000
+++ b/src/luaconf.h 2023-12-13 12:24:30.287727037 +1100
@@ -224,19 +224,28 @@
#else /* }{ */
#define LUA_ROOT "/usr/local/"
+#define LUA_ROOT2 "/usr/"
#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/"
+#define LUA_LDIR2 LUA_ROOT2 "share/lua/" LUA_VDIR "/"
#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/"
+#define LUA_CDIR2 LUA_ROOT2 "lib/lua/" LUA_VDIR "/"
#if !defined(LUA_PATH_DEFAULT)
#define LUA_PATH_DEFAULT \
LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
+ LUA_LDIR2"?.lua;" LUA_LDIR2"?/init.lua;" \
LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \
+ LUA_CDIR2"?.lua;" LUA_CDIR2"?/init.lua;" \
"./?.lua;" "./?/init.lua"
#endif
#if !defined(LUA_CPATH_DEFAULT)
#define LUA_CPATH_DEFAULT \
- LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so"
+ LUA_CDIR"?.so;" \
+ LUA_CDIR2"?.so;" \
+ LUA_CDIR"loadall.so;" \
+ LUA_CDIR2"loadall.so;" \
+ "./?.so"
#endif
#endif /* } */