When using emerge ebuild configures libdir to --libdir=/usr/lib64/postgresql-13/lib64, but this is implicitly done. When installing with pmerge this will be --libdir=/lib64. This in turn, results in failure to detect libs when `postgresql-config update` is invoked in `pkg_postinst`. Reproducible: Always Steps to Reproduce: 1. emerge -1 dev-db/postgresl | grep --libdir 2. emerce -C dev-db/postgresl 3. pmerge -1 dev-db/postgresl | grep --libdir Actual Results: # grep libdir emerge-log ./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --docdir=/usr/share/doc/postgresql-13.3 --htmldir=/usr/share/doc/postgresql-13.3/html --libdir=/usr/lib64/postgresql-13/lib64 --prefix=/usr/lib64/postgresql-13 --datadir=/usr/share/postgresql-13 --includedir=/usr/include/postgresql-13 --mandir=/usr/share/postgresql-13/man --sysconfdir=/etc/postgresql-13 --with-system-tzdata=/usr/share/zoneinfo --disable-debug --disable-thread-safety --with-icu --without-gssapi --without-ldap --without-llvm --with-pam --without-perl --without-python --with-readline --with-openssl --without-systemd --without-tcl --without-libxml --without-libxslt --with-zlib --enable-nls --enable-spinlocks # grep libdir pmerge-log ./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --docdir=/usr/share/doc/postgresql-13.3 --htmldir=/usr/share/doc/postgresql-13.3/html --libdir=/lib64 --prefix=/usr/lib64/postgresql-13 --datadir=/usr/share/postgresql-13 --includedir=/usr/include/postgresql-13 --mandir=/usr/share/postgresql-13/man --sysconfdir=/etc/postgresql-13 --with-system-tzdata=/usr/share/zoneinfo --disable-debug --disable-thread-safety --with-icu --without-gssapi --without-ldap --without-llvm --with-pam --without-perl --without-python --with-readline --with-openssl --without-systemd --without-tcl --without-libxml --without-libxslt --with-zlib --enable-nls --enable-spinlocks Expected Results: pmerge has the same libdir as emerge. I was able to fix the issue with the following explicit --libdir in src_configure: --libdir="${PO}/usr/$(get_libdir)/postgresql-${SLOT}/$(get_libdir)" See attached ebuild.
Created attachment 730058 [details] log of emerge
Created attachment 730066 [details] log of pmerge
Created attachment 730076 [details] fixed ebuild
Created attachment 730078 [details] log of pmerge with fixed ebuild
See also but report in pkgcore: https://github.com/pkgcore/pkgcore/issues/318
Portage is correct. --libdir should use the prefix passed by --prefix. PMS algorithm 12.2: https://projects.gentoo.org/pms/8/pms.html#x1-128002r2
Created attachment 730080 [details, diff] ebd/eapi/2/src_configure.bash: Fix typo in econf --libdir logic Looks like a typo in econf ("pref" instead of "prefix").
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a1a0017b18cc99e4d4c4722082967abbcabdc806 commit a1a0017b18cc99e4d4c4722082967abbcabdc806 Author: Michał Górny <mgorny@gentoo.org> AuthorDate: 2021-08-04 11:32:31 +0000 Commit: Michał Górny <mgorny@gentoo.org> CommitDate: 2021-08-04 11:35:34 +0000 sys-apps/pkgcore: Bump to 0.12.2 Closes: https://bugs.gentoo.org/806362 Signed-off-by: Michał Górny <mgorny@gentoo.org> sys-apps/pkgcore/Manifest | 1 + sys-apps/pkgcore/pkgcore-0.12.2.ebuild | 50 ++++++++++++++++++++++++++++++++++ sys-apps/pkgcore/pkgcore-9999.ebuild | 7 +++-- 3 files changed, 56 insertions(+), 2 deletions(-)