]> git.99rst.org Git - openwrt-packages.git/commitdiff
luaexpat: add Lua 5.4 variant
authorAlexandru Ardelean <redacted>
Tue, 26 May 2026 11:15:12 +0000 (14:15 +0300)
committerAlexandru Ardelean <redacted>
Fri, 31 Jul 2026 06:46:08 +0000 (09:46 +0300)
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 <redacted>
lang/lua/luaexpat/Makefile

index ef16eb81b2d75d2e7affdb96dada13eebbee225a..e5cad11aff1e6bfd0caf16b07dbfc0b8e4544fb0 100644 (file)
@@ -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 <mike@flyn.org>
+endef
+
+define Package/luaexpat
+  $(Package/luaexpat/default)
   DEPENDS:=+lua +libexpat
+  VARIANT:=lua-51
+  DEFAULT_VARIANT:=1
 endef
 
-define Package/luaexpat/description
+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))
git clone https://git.99rst.org/PROJECT