From 599a761b273b738b1f89f09fa03aaf18bbb78d0d Mon Sep 17 00:00:00 2001 From: Ophestra Date: Fri, 31 Jul 2026 17:03:02 +0900 Subject: [PATCH] internal/rosa/package: lua Signed-off-by: Ophestra --- internal/rosa/package/lua/conf-prefix.patch | 13 ++++++++ internal/rosa/package/lua/lua.pc | 23 +++++++++++++ internal/rosa/package/lua/package.az | 36 +++++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 internal/rosa/package/lua/conf-prefix.patch create mode 100644 internal/rosa/package/lua/lua.pc create mode 100644 internal/rosa/package/lua/package.az diff --git a/internal/rosa/package/lua/conf-prefix.patch b/internal/rosa/package/lua/conf-prefix.patch new file mode 100644 index 00000000..cb7bbe5f --- /dev/null +++ b/internal/rosa/package/lua/conf-prefix.patch @@ -0,0 +1,13 @@ +diff --git a/src/luaconf.h b/src/luaconf.h +index 96a7780..0bfa66c 100644 +--- a/src/luaconf.h ++++ b/src/luaconf.h +@@ -239,7 +239,7 @@ + + #else /* }{ */ + +-#define LUA_ROOT "/usr/local/" ++#define LUA_ROOT "/system/" + #define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/" + #define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/" + diff --git a/internal/rosa/package/lua/lua.pc b/internal/rosa/package/lua/lua.pc new file mode 100644 index 00000000..0bc54c70 --- /dev/null +++ b/internal/rosa/package/lua/lua.pc @@ -0,0 +1,23 @@ +# lua.pc -- pkg-config data for Lua + +prefix=/system +INSTALL_BIN=${prefix}/bin +INSTALL_INC=${prefix}/include +INSTALL_LIB=${prefix}/lib +INSTALL_MAN=${prefix}/man/man1 +INSTALL_LMOD=${prefix}/share/lua/@MAJOR_VER@.@MINOR_VER@ +INSTALL_CMOD=${prefix}/lib/lua/@MAJOR_VER@.@MINOR_VER@ + +# canonical vars +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: Lua +Description: An Extensible Extension Language +Version: @MAJOR_VER@.@MINOR_VER@ +Requires: +Libs: -L${libdir} -llua -lm +Cflags: -I${includedir} + +# (end of lua@MAJOR_VER@.pc) diff --git a/internal/rosa/package/lua/package.az b/internal/rosa/package/lua/package.az new file mode 100644 index 00000000..2d61eee5 --- /dev/null +++ b/internal/rosa/package/lua/package.az @@ -0,0 +1,36 @@ +package lua { + description = "the programming language lua"; + website = "https://www.lua.org/home.html"; + anitya = 1847; + + version# = "5.5.0"; + source = remoteTar { + url = "https://www.lua.org/ftp/lua-"+version+".tar.gz"; + compress = gzip; + checksum = "YPyC6868M6mB1p0ARV1WJy9EmFc0ERBoueqJnMvJ_YXjSSvkVtO94C01n6pnd8Te"; + }; + patches = [ "conf-prefix.patch" ]; + + files = { + "lua.pc"; + }; + + enterSource = true; + writable = true; + chmod = true; + + exec = make { + inPlace = true; + skipConfigure = true; + make = [ "CC='clang -fPIC'", "all" ]; + check = [ "test" ]; + install = ` +make INSTALL_TOP=/work/system install +mkdir /work/system/lib/pkgconfig +sed \ + -e "s|@MAJOR_VER@|$(cc -P -E -include src/lua.h - <<< LUA_VERSION_MAJOR_N | tail -n 1)|g" \ + -e "s|@MINOR_VER@|$(cc -P -E -include src/lua.h - <<< LUA_VERSION_MINOR_N | tail -n 1)|g" \ + ../lua.pc > /work/system/lib/pkgconfig/lua.pc +`; + }; +}