Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 592052 - dev-lang/lua-5.2.3-r1 creates unusable pkgconfig file
Summary: dev-lang/lua-5.2.3-r1 creates unusable pkgconfig file
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: William Hubbs
: 602476 (view as bug list)
Depends on:
Reported: 2016-08-24 21:39 UTC by Nick Owens
Modified: 2019-03-25 05:14 UTC (History)
2 users (show)

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


Note You need to log in before you can comment on or make changes to this bug.
Description Nick Owens 2016-08-24 21:39:21 UTC
pkg-config --libs lua5.2 will produce '-llua', but should be '-llua5.2'
pkg-config --cflags will produce '-I/usr/include', but should be '-I/usr/include/lua5.2'

$ equery -C f =dev-lang/lua-5.2.3-r1
Comment 1 Martin Väth 2018-05-11 05:21:32 UTC
The same holds for the current lua:5.1 and lua:5.3 ebuilds.

My suggestion would be to fix this first (and perhaps not install the static archives, see below).

Then it is a rather easy for packages to depend on the "correct" slot and force using it, independent of what is chosen by "eselect lus".

This could first happen through USE="lua-slotted" (i.e. without that USE-flag, they depend on lua:0, but otherwise on the correct lua version and force using it by forcing to use the correct lua.pc file); of course, this USE-flag would need to be masked as long as slotted lua is masked.

When all packages have been converted, the way is finally free to unmask slotted lua. Then eventually the USE="lua-slotted" can be forced (or the disabled case removed from the ebuilds).

BTW, when the *.pc files are fixed, it is not necessary to install the static libraries (due to the fixed PC files, the correct lua version is linked dynamically).

I am aware that this is discouraged by upstream due to a theoretically slightly slower execution on i686 due to -fPIC in the dynamic archives. However:

1. The speed argument is practically invalid on x86_64.
2. Profile 7.0 uses -fPIE anyway which has the same speed impact on all architectures as -fPIC.
3. Using static archives contradicts gentoo policy and is always a security issue.

I emphasize once more that due to the correct *.pc files - if the ebuilds possibly patch the packages to actually use them if necessary - the dynamic linking is correct and independent of USE=lua-slotted.

That's why I consider it highly important to fix this bug for all lua slots (even if you should decide against removal of static archives).
Comment 2 Larry the Git Cow gentoo-dev 2019-03-25 05:13:54 UTC
The bug has been closed via the following commit(s):

commit d8b34e68bfeb0eb58cec6d7e0f274987c253c2a0
Author:     Robin H. Johnson <>
AuthorDate: 2019-03-25 05:03:33 +0000
Commit:     Robin H. Johnson <>
CommitDate: 2019-03-25 05:13:45 +0000

    dev-lang/lua: fix pkgconfig for lua 5.2 & lua 5.3
    Slotted Lua uses distinct names for libraries and the include path.
    This variant is explicitly compatible with Debian's layout as seen at
    Package-Manager: Portage-2.3.62, Repoman-2.3.12
    Signed-off-by: Robin H. Johnson <>

 dev-lang/lua/lua-5.2.4-r1.ebuild | 192 +++++++++++++++++++++++++++++++++++++++
 dev-lang/lua/lua-5.3.5-r1.ebuild | 192 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 384 insertions(+)
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2019-03-25 05:14:46 UTC
*** Bug 602476 has been marked as a duplicate of this bug. ***