From fe3a5347184e6521958ef5ba0e031f33a3160a96 Mon Sep 17 00:00:00 2001 From: Mirko Vogt Date: Mon, 5 Oct 2026 14:44:57 +0300 Subject: [PATCH] lua: install a pkg-config file for Lua 5.4 Lua stopped shipping a pkg-config file after 5.1; the 5.2, 5.3 and 5.4 release tarballs contain none. Distributions add one to their Lua packages instead: Debian's liblua5.4-dev ships lua5.4.pc, lua-5.4.pc and lua54.pc, Alpine's lua5.4-dev ships lua5.4.pc and lua-5.4.pc. Build systems of Lua consumers look Lua 5.4 up under these names. The package stages no pkg-config file so far, so such builds cannot find liblua5.4; the only Lua pkg-config file in the staging directory is lua.pc of the lua package (5.1.5). Stage lua5.4.pc, generated from a template with the package version, and lua-5.4.pc and lua54.pc as links to it. It points to the headers in /usr/include/lua5.4 and to liblua5.4, and lists libm and libdl as private libraries for static linking, as the upstream Makefile links them on Linux. Of the packages that look up one of these names through pkg-config, libinput disables its Lua plugin support explicitly in the previous commit. tio looks up lua-5.4 before lua but depends on lua (5.1), so it links liblua5.4 without depending on it until the next commit moves it to Lua 5.4. The others select their Lua version explicitly, look up lua (5.1) first, build without the feature using Lua, or depend on lua5.4 already. Assisted-By: Claude Opus 5.5 Signed-off-by: Mirko Vogt --- lang/lua/lua5.4/Makefile | 7 ++++++- lang/lua/lua5.4/files/lua5.4.pc.in | 11 +++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 lang/lua/lua5.4/files/lua5.4.pc.in diff --git a/lang/lua/lua5.4/Makefile b/lang/lua/lua5.4/Makefile index 6e03261eaf..072d37d059 100644 --- a/lang/lua/lua5.4/Makefile +++ b/lang/lua/lua5.4/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=lua PKG_VERSION:=5.4.7 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://www.lua.org/ftp/ \ @@ -147,6 +147,11 @@ define Build/InstallDev $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua5.4.{a,so*} $(1)/usr/lib/ $(LN) liblua5.4.so.0.0.0 $(1)/usr/lib/liblualib5.4.so + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) ./files/lua5.4.pc.in $(1)/usr/lib/pkgconfig/lua5.4.pc + $(SED) 's,@VERSION@,$(PKG_VERSION),' $(1)/usr/lib/pkgconfig/lua5.4.pc + $(LN) lua5.4.pc $(1)/usr/lib/pkgconfig/lua-5.4.pc + $(LN) lua5.4.pc $(1)/usr/lib/pkgconfig/lua54.pc endef define Package/liblua5.4/install diff --git a/lang/lua/lua5.4/files/lua5.4.pc.in b/lang/lua/lua5.4/files/lua5.4.pc.in new file mode 100644 index 0000000000..f08e548489 --- /dev/null +++ b/lang/lua/lua5.4/files/lua5.4.pc.in @@ -0,0 +1,11 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include/lua5.4 + +Name: Lua +Description: Lua programming language (version 5.4) +Version: @VERSION@ +Libs: -L${libdir} -llua5.4 +Libs.private: -lm -ldl +Cflags: -I${includedir}