From 59977dc387fb9fc2993c83182ccc2d54c1bc5bdf Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Tue, 26 May 2026 14:15:12 +0300 Subject: [PATCH] luaexpat: add Lua 5.4 variant Add luaexpat5.4, parallel to existing luaexpat (Lua 5.1, default). Builds against the Lua 5.4 headers under /usr/include/lua5.4 and installs to /usr/lib/lua/5.4/. Same pattern as the luasocket 5.3 variant already shipped. Needed for the prosody 13.x upgrade. Signed-off-by: Alexandru Ardelean --- lang/lua/luaexpat/Makefile | 49 ++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/lang/lua/luaexpat/Makefile b/lang/lua/luaexpat/Makefile index ef16eb81b2..e5cad11aff 100644 --- a/lang/lua/luaexpat/Makefile +++ b/lang/lua/luaexpat/Makefile @@ -1,4 +1,4 @@ -# +# # Copyright (C) 2009 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luaexpat PKG_VERSION:=1.5.2 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_VERSION:=$(PKG_VERSION) @@ -22,19 +22,46 @@ PKG_CPE_ID:=cpe:/a:matthewwild:luaexpat include $(INCLUDE_DIR)/package.mk -define Package/luaexpat +define Package/luaexpat/default SUBMENU:=Lua SECTION:=lang CATEGORY:=Languages TITLE:=LuaExpat URL:=https://lunarmodules.github.io/luaexpat/ MAINTAINER:=W. Michael Petullo - DEPENDS:=+lua +libexpat endef -define Package/luaexpat/description +define Package/luaexpat + $(Package/luaexpat/default) + DEPENDS:=+lua +libexpat + VARIANT:=lua-51 + DEFAULT_VARIANT:=1 +endef + +define Package/luaexpat5.4 + $(Package/luaexpat/default) + TITLE+= (Lua 5.4) + DEPENDS:=+lua5.4 +libexpat + VARIANT:=lua-54 +endef + +define Package/luaexpat/default/description LuaExpat is a SAX XML parser based on the Expat library. endef +Package/luaexpat/description = $(Package/luaexpat/default/description) +Package/luaexpat5.4/description = $(Package/luaexpat/default/description) + +ifeq ($(BUILD_VARIANT),lua-51) + LUA_INCDIR:=$(STAGING_DIR)/usr/include + LUA_LIBNAME:=lua + LUA_INSTALL_DIR:=/usr/lib/lua +endif + +ifeq ($(BUILD_VARIANT),lua-54) + LUA_INCDIR:=$(STAGING_DIR)/usr/include/lua5.4 + LUA_LIBNAME:=lua5.4 + LUA_INSTALL_DIR:=/usr/lib/lua/5.4 +endif define Build/Configure endef @@ -43,10 +70,10 @@ define Build/Compile $(CP) files/compat-5.1r5 $(PKG_BUILD_DIR)/compat-5.1r5 $(MAKE) -C $(PKG_BUILD_DIR) \ EXPAT_INC="-I$(STAGING_DIR)/usr/include/" \ - LUA_INC="-I$(STAGING_DIR)/usr/include/" \ + LUA_INC="-I$(LUA_INCDIR)" \ LUA_LIBDIR="$(STAGING_DIR)/usr/lib/" \ COMPAT_DIR="$(PKG_BUILD_DIR)/compat-5.1r5" \ - LDFLAGS="-shared $(TARGET_LDFLAGS)" \ + LDFLAGS="-shared $(TARGET_LDFLAGS) -l$(LUA_LIBNAME)" \ CC="$(TARGET_CC) $(TARGET_CFLAGS) $(FPIC) -std=c99" \ LD="$(TARGET_CROSS)ld -shared" endef @@ -58,4 +85,12 @@ define Package/luaexpat/install $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/lxp/lom.lua $(1)/usr/lib/lua/lxp endef +define Package/luaexpat5.4/install + $(INSTALL_DIR) $(1)/usr/lib/lua/5.4 + $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/lxp.so $(1)/usr/lib/lua/5.4/lxp.so + $(INSTALL_DIR) $(1)/usr/lib/lua/5.4/lxp + $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/lxp/lom.lua $(1)/usr/lib/lua/5.4/lxp +endef + $(eval $(call BuildPackage,luaexpat)) +$(eval $(call BuildPackage,luaexpat5.4))