commit:     09e5cc520486a875ddfbe5b59ee95260c3cbe697
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 21 04:05:30 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Oct 21 05:14:37 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=09e5cc52

sys-apps/pkgcore: Fix INSTALL_PREFIX

PkgCore's setup.py originally embedded the actual install prefix
into _const.py when `setup.py install` was used.  However, as we
switched to PEP517 builds, it started installing a generic variant
that uses sys.prefix instead.  This breaks using PkgCore from inside
a venv with `--system-site-packages` option, as the system copy
of PkgCore tries to find its config files inside the venv.  Hardcode
the correct path from the ebuild to avoid this.

Courtesy of Arthur Zamarin.

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../pkgcore/{pkgcore-0.12.16.ebuild => pkgcore-0.12.16-r1.ebuild}  | 7 +++++++
 sys-apps/pkgcore/pkgcore-9999.ebuild                               | 7 +++++++
 2 files changed, 14 insertions(+)

diff --git a/sys-apps/pkgcore/pkgcore-0.12.16.ebuild 
b/sys-apps/pkgcore/pkgcore-0.12.16-r1.ebuild
similarity index 89%
rename from sys-apps/pkgcore/pkgcore-0.12.16.ebuild
rename to sys-apps/pkgcore/pkgcore-0.12.16-r1.ebuild
index 9eb8420dfb20..b060b26f7101 100644
--- a/sys-apps/pkgcore/pkgcore-0.12.16.ebuild
+++ b/sys-apps/pkgcore/pkgcore-0.12.16-r1.ebuild
@@ -39,6 +39,13 @@ BDEPEND="
 
 distutils_enable_tests setup.py
 
+src_prepare() {
+       # force Gentoo's prefix
+       sed -e "/INSTALL_PREFIX =/s@= .*\$@= '${EPREFIX}/usr'@" -i setup.py || 
die
+
+       distutils-r1_src_prepare
+}
+
 src_test() {
        # With PYTHONDONTWRITEBYTECODE=, python will try rebuild all sorts of 
modules.
        # https://bugs.gentoo.org/840266

diff --git a/sys-apps/pkgcore/pkgcore-9999.ebuild 
b/sys-apps/pkgcore/pkgcore-9999.ebuild
index a54deed756c0..6b4c768d3a2f 100644
--- a/sys-apps/pkgcore/pkgcore-9999.ebuild
+++ b/sys-apps/pkgcore/pkgcore-9999.ebuild
@@ -40,6 +40,13 @@ BDEPEND="
 
 distutils_enable_tests setup.py
 
+src_prepare() {
+       # force Gentoo's prefix
+       sed -e "/INSTALL_PREFIX =/s@= .*\$@= '${EPREFIX}/usr'@" -i setup.py || 
die
+
+       distutils-r1_src_prepare
+}
+
 src_test() {
        # With PYTHONDONTWRITEBYTECODE=, python will try rebuild all sorts of 
modules.
        # https://bugs.gentoo.org/840266

Reply via email to