Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 852809 - net-proxy/haproxy Allow LUA
Summary: net-proxy/haproxy Allow LUA
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Christian Ruppert (idl0r)
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2022-06-17 16:02 UTC by Mike Lothian
Modified: 2022-06-28 09:30 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Lothian 2022-06-17 16:02:43 UTC
Hi

I build haproxy from scratch at work and I noticed that LUA wasn't enabled in the Gentoo ebuilds

The following was enough to get it working for me with LUA 5.4:

diff --git a/net-proxy/haproxy/haproxy-2.4.17.ebuild b/net-proxy/haproxy/haproxy-2.4.17.ebuild
index 2b772750ef6..d793d01f5ad 100644
--- a/net-proxy/haproxy/haproxy-2.4.17.ebuild
+++ b/net-proxy/haproxy/haproxy-2.4.17.ebuild
@@ -3,7 +3,7 @@
 
 EAPI="7"
 
-LUA_COMPAT=( lua5-3 )
+LUA_COMPAT=( lua5-3 lua5-4 )
 
 [[ ${PV} == *9999 ]] && SCM="git-r3"
 inherit toolchain-funcs flag-o-matic lua-single systemd linux-info ${SCM}
@@ -86,6 +86,7 @@ src_compile() {
        args+=( $(haproxy_use slz SLZ) )
        args+=( $(haproxy_use zlib ZLIB) )
        args+=( $(haproxy_use lua LUA) )
+       use lua && args+=( LUA_LIB_NAME=${ELUA} LUA_INC=/usr/include/${ELUA} )
        args+=( $(haproxy_use 51degrees 51DEGREES) )
        args+=( $(haproxy_use wurfl WURFL) )
        args+=( $(haproxy_use systemd SYSTEMD) )

The LUA_CFLAGS and LUA_INCLUDE_DIR variables didn't seem to be set, so I stuck with ELUA for both, the INC directory might neeed ${PREFIX} or the likes


Reproducible: Always
Comment 1 Christian Ruppert (idl0r) gentoo-dev 2022-06-21 15:07:47 UTC
It didn't work / detect it for you because it's kind of hardcoded for Lua 5.3 only.
It will need more work, to make it more dynamically but it's also not entirely clear if it works fine with anything other than 5.3.
Comment 2 Mike Lothian 2022-06-21 20:38:26 UTC
I'm telling you how I got it working

Support for Lua 5.4 was added a while ago
Comment 3 Christian Ruppert (idl0r) gentoo-dev 2022-06-21 21:09:24 UTC
What I wanted to say is, I'd like it to be fixed upstream if possible, so that anybody can benefit from it and not just Gentoo.

There was a request about a year ago already, which I just tried to revive:
https://www.mail-archive.com/haproxy@formilux.org/msg42474.html
So we'll likely get both soonish, 5.4 for Gentoo as well as HAProxy upstream.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-21 21:11:28 UTC
Sure, but it's a pretty simple fix, and we have to do stuff like this in lots of ebuilds. I don't know if it's really a big deal.
Comment 5 Mike Lothian 2022-06-21 23:55:14 UTC
Ah I understand, you want it to auto-detect lua 5.4

Is there a reason we don't just use the patch?
Comment 6 Larry the Git Cow gentoo-dev 2022-06-28 09:27:15 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1e135fe1d9b508e778de85d44f40382f2221f7ea

commit 1e135fe1d9b508e778de85d44f40382f2221f7ea
Author:     Christian Ruppert <idl0r@gentoo.org>
AuthorDate: 2022-06-28 09:25:58 +0000
Commit:     Christian Ruppert <idl0r@gentoo.org>
CommitDate: 2022-06-28 09:27:12 +0000

    net-proxy/haproxy: Add LUA 5.4 support, thanks to Mike Lothian
    
    Bug: https://bugs.gentoo.org/852809
    Package-Manager: Portage-3.0.30, Repoman-3.0.3
    Signed-off-by: Christian Ruppert <idl0r@gentoo.org>

 net-proxy/haproxy/files/haproxy-lua54.patch | 63 +++++++++++++++++++++++++++++
 net-proxy/haproxy/haproxy-2.4.17.ebuild     |  6 ++-
 net-proxy/haproxy/haproxy-2.4.9999.ebuild   |  6 ++-
 net-proxy/haproxy/haproxy-2.6.1.ebuild      |  6 ++-
 net-proxy/haproxy/haproxy-2.6.9999.ebuild   |  6 ++-
 net-proxy/haproxy/haproxy-9999.ebuild       |  6 ++-
 6 files changed, 88 insertions(+), 5 deletions(-)
Comment 7 Christian Ruppert (idl0r) gentoo-dev 2022-06-28 09:30:10 UTC
Should be fixed now. Thanks! :)