mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-16 14:29:05 -07:00
sys-apps/pkgcore: fix sys.prefix testing
Closes: https://bugs.gentoo.org/880693 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
This commit is contained in:
18
sys-apps/pkgcore/files/pkgcore-0.12.17-fix-prefix.patch
Normal file
18
sys-apps/pkgcore/files/pkgcore-0.12.17-fix-prefix.patch
Normal file
@@ -0,0 +1,18 @@
|
||||
--- a/py_build.py
|
||||
+++ b/py_build.py
|
||||
@@ -28,12 +28,12 @@ def write_pkgcore_lookup_configs(cleanup_files):
|
||||
with open(path, "w") as f:
|
||||
os.chmod(path, 0o644)
|
||||
f.write(textwrap.dedent("""\
|
||||
- from os.path import join, abspath
|
||||
+ from os.path import abspath, exists, join
|
||||
import sys
|
||||
|
||||
- from snakeoil import process
|
||||
-
|
||||
INSTALL_PREFIX = abspath(sys.prefix)
|
||||
+ if not exists(join(INSTALL_PREFIX, 'lib/pkgcore')):
|
||||
+ INSTALL_PREFIX = abspath(sys.base_prefix)
|
||||
DATA_PATH = join(INSTALL_PREFIX, 'share/pkgcore')
|
||||
CONFIG_PATH = join(DATA_PATH, 'config')
|
||||
LIBDIR_PATH = join(INSTALL_PREFIX, 'lib/pkgcore')
|
||||
@@ -38,20 +38,11 @@ BDEPEND="
|
||||
)
|
||||
"
|
||||
|
||||
distutils_enable_tests pytest
|
||||
|
||||
EPYTEST_DESELECT=(
|
||||
# fail because of forcing Gentoo's prefix
|
||||
tests/ebuild/test_eapi.py::TestEAPI::test_register
|
||||
tests/ebuild/test_eapi.py::TestEAPI::test_is_supported
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-0.12.17-fix-prefix.patch"
|
||||
)
|
||||
|
||||
src_prepare() {
|
||||
# force Gentoo's prefix
|
||||
sed -e "/INSTALL_PREFIX =/s@= .*\$@= '${EPREFIX}/usr'@" -i py_build.py || die
|
||||
|
||||
distutils-r1_src_prepare
|
||||
}
|
||||
distutils_enable_tests pytest
|
||||
|
||||
python_install_all() {
|
||||
local DOCS=( NEWS.rst )
|
||||
@@ -40,21 +40,8 @@ BDEPEND="
|
||||
|
||||
distutils_enable_tests pytest
|
||||
|
||||
EPYTEST_DESELECT=(
|
||||
# fail because of forcing Gentoo's prefix
|
||||
tests/ebuild/test_eapi.py::TestEAPI::test_register
|
||||
tests/ebuild/test_eapi.py::TestEAPI::test_is_supported
|
||||
)
|
||||
|
||||
src_prepare() {
|
||||
# force Gentoo's prefix
|
||||
sed -e "/INSTALL_PREFIX =/s@= .*\$@= '${EPREFIX}/usr'@" -i py_build.py || die
|
||||
|
||||
distutils-r1_src_prepare
|
||||
}
|
||||
|
||||
python_install_all() {
|
||||
local DOCS=( NEWS.rst )
|
||||
[[ ${PV} == *9999 ]] || doman man/*
|
||||
[[ ${PV} == *9999 ]] || doman build/sphinx/man/*
|
||||
distutils-r1_python_install_all
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user