FS#65549 - [lua] Provide pkg-config alias to lua5.3

Attached to Project: Arch Linux
Opened by Tomas Volf (gray_-_wolf) - Tuesday, 18 February 2020, 23:43 GMT
Last edited by Anatol Pomozov (anatolik) - Friday, 21 February 2020, 17:48 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Evangelos Foutras (foutrelis)
Anatol Pomozov (anatolik)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

Currently, lua has pkg-config package called lua53. Debian supplies lua53, lua5.3 and lua-5.3. Alpine linux supplies only lua5.3. In interest of compatibility, it would be nice to have alias lua5.3 (and possibly also lua-5.3) to make more compilations work out of the box.

Additional info:
* package version(s)
* config and/or log files etc.
* link to upstream bug report, if any

Steps to reproduce:
This task depends upon

Closed by  Anatol Pomozov (anatolik)
Friday, 21 February 2020, 17:48 GMT
Reason for closing:  Fixed
Comment by Anatol Pomozov (anatolik) - Wednesday, 19 February 2020, 20:35 GMT
Could you please provide a tested patch for 'lua' package with the changes you suggest?
Comment by Tomas Volf (gray_-_wolf) - Wednesday, 19 February 2020, 23:08 GMT
Attached patch seems to work. It provides both package names that debian had in
addition to archlinux. Seems to work fine:

[root@269d701c4588 /]# pkgconf --list-all | grep lua | sort
lua-5.3 Lua - An Extensible Extension Language
lua5.3 Lua - An Extensible Extension Language
lua53 Lua - An Extensible Extension Language
lua Lua - An Extensible Extension Language

[root@269d701c4588 /]# for pkg in $(pkgconf --list-package-names | sort | grep lua); do \
> echo $pkg: $(pkgconf --libs $pkg); \
> done
lua: -llua -lm
lua-5.3: -llua -lm
lua5.3: -llua -lm
lua53: -llua -lm

Thank you for considering this :)
Comment by Anatol Pomozov (anatolik) - Thursday, 20 February 2020, 01:09 GMT
Your patch looks good. I just pushed lua to [testing]. Please verify that it works as expected.

I also modified lua52 and lua51 accordingly to stay consistent with 'lua' package.
Comment by Tomas Volf (gray_-_wolf) - Friday, 21 February 2020, 10:12 GMT
Thank you for acting on this ticket :) I've tested the packages in testing and
they seem to work fine:

[root@dc472776420f lua]# cat test.c
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>

int main(void) {
lua_State *lua = luaL_newstate();
luaL_openlibs(lua);
luaL_dostring(lua, "print('" PKG_NAME ": ' .. _VERSION);");
lua_close(lua);
return 0;
}

[root@dc472776420f lua]# cat Makefile
.PHONY: all
all:
$(MAKE) PKG_NAME=lua test
$(MAKE) PKG_NAME=lua53 test
$(MAKE) PKG_NAME=lua5.3 test
$(MAKE) PKG_NAME=lua-5.3 test
$(MAKE) PKG_NAME=lua52 test
$(MAKE) PKG_NAME=lua5.2 test
$(MAKE) PKG_NAME=lua-5.2 test
$(MAKE) PKG_NAME=lua51 test
$(MAKE) PKG_NAME=lua5.1 test
$(MAKE) PKG_NAME=lua-5.1 test

.PHONY: test
test:
@gcc \
$$(pkg-config --cflags $(PKG_NAME)) \
-DPKG_NAME='"$(PKG_NAME)"' \
-o test \
test.c \
$$(pkg-config --libs $(PKG_NAME))
@./test
[root@dc472776420f lua]# make -s
lua: Lua 5.3
lua53: Lua 5.3
lua5.3: Lua 5.3
lua-5.3: Lua 5.3
lua52: Lua 5.2
lua5.2: Lua 5.2
lua-5.2: Lua 5.2
lua51: Lua 5.1
lua5.1: Lua 5.1
lua-5.1: Lua 5.1

Loading...