Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 831898 - dev-libs/libmpack prefix in the ebuild hardcoded to /usr
Summary: dev-libs/libmpack prefix in the ebuild hardcoded to /usr
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-23 12:43 UTC by Victor Ananyev
Modified: 2022-07-14 19:43 UTC (History)
2 users (show)

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 Victor Ananyev 2022-01-23 12:43:09 UTC
Is there any reason why PREFIX is hardcoded to "/usr" instead of "EPREFIX"?

https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-libs/libmpack/libmpack-1.0.5.ebuild#n33

https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-libs/libmpack/libmpack-1.0.5.ebuild#n48

This issues causes "dev-lua/mpack" to build with wrong symbols, because it picks up the libmpack from the host, instead of prefix.

Specifically, dev-lua/mpack uses pkg-config to configure build flags:

pkg-config --cflags mpack

and this returns /usr/lib instead of EPREFIX/lib

All this is related to building neovim in prefix. I'm getting:
${EPREFIX}/usr/lib64/lua/5.1/mpack.so: undefined symbol: luaL_prepbuffsize

because dev-lua/mpack is built with host libmpack instead of the prefix.
Comment 1 Michael Schubert 2022-02-20 14:42:25 UTC
I can confirm this issue (also for installing neovim).

My symptom is the following (stemming from host stdio.h):

```
/usr/include/stdio.h:781:10: fatal error: bits/sys_errlist.h: No such file or directory
  781 | #include <bits/sys_errlist.h>
      |          ^~~~~~~~~~~~~~~~~~~~
```

A possible workaround is to remove "USE_SYSTEM_MPACK=yes" from lua_src_compile @ mpack-1.0.9-r1.ebuild (which removes the erroneous -I/usr/include flag)
Comment 2 Larry the Git Cow gentoo-dev 2022-02-20 15:11:32 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5556775b66ecf5de31e908b052967c03b8db9952

commit 5556775b66ecf5de31e908b052967c03b8db9952
Author:     Conrad Kostecki <conikost@gentoo.org>
AuthorDate: 2022-02-20 15:03:34 +0000
Commit:     Conrad Kostecki <conikost@gentoo.org>
CommitDate: 2022-02-20 15:03:34 +0000

    dev-libs/libmpack: fix prefix
    
    Closes: https://bugs.gentoo.org/831898
    Signed-off-by: Conrad Kostecki <conikost@gentoo.org>

 .../libmpack/{libmpack-1.0.5-r1.ebuild => libmpack-1.0.5-r2.ebuild}   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 3 Victor Ananyev 2022-02-21 12:17:06 UTC
Hi! I checked the setup, it still fails because after installation, pkgconfig is taken from LIBDIR/INCDIR variables provided from the eclass, and they point to host root, not to EPREFIX. The change that helped:

```
diff --git a/dev-libs/libmpack/libmpack-1.0.5-r2.ebuild b/dev-libs/libmpack/libmpack-1.0.5-r2.ebuild
index b0bcd1ed763..116451d9c01 100644
--- a/dev-libs/libmpack/libmpack-1.0.5-r2.ebuild
+++ b/dev-libs/libmpack/libmpack-1.0.5-r2.ebuild
@@ -29,7 +29,8 @@ src_compile() {
                "PREFIX=${EPREFIX}/usr"
                "CC=$(tc-getCC)"
                "config=release"
-               "LIBDIR=/usr/$(get_libdir)"
+               "LIBDIR=${EPREFIX}/usr/$(get_libdir)"
+               "INCDIR=${EPREFIX}/usr/include"
        )

        emake "${myemakeargs[@]}" lib-bin
@@ -42,8 +43,9 @@ src_test() {
 src_install() {
        local myemakeargs=(
                "PREFIX=${EPREFIX}/usr"
-               "DESTDIR=${ED}"
-               "LIBDIR=/usr/$(get_libdir)"
+               "DESTDIR=${D}"
+               "LIBDIR=${EPREFIX}/usr/$(get_libdir)"
+               "INCDIR=${EPREFIX}/usr/include"
                "XLDFLAGS=-shared"
        )
```
Comment 4 Michael Schubert 2022-03-23 15:15:04 UTC
I can confirm that libmpack-1.0.5-r2 patch _does not_ fix the installation (now fails at QA with double prefix).
Comment 5 Larry the Git Cow gentoo-dev 2022-07-14 19:43:05 UTC
The bug has been closed via the following commit(s):

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

commit e97e5e3c03d2f1145b777341aafbb713436a842f
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2022-07-14 19:41:27 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2022-07-14 19:43:02 +0000

    dev-libs/libmpack-1.0.5-r3: fix for Prefix, bug #831898
    
    Patch by Victor Ananyev in bug 831898#c3
    
    Closes: https://bugs.gentoo.org/831898
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>

 dev-libs/libmpack/libmpack-1.0.5-r3.ebuild | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)