dev-python/fitsio: Improve the ebuild

Enable system library via setup.cfg instead of sed-ing setup.py.
Avoid unnecessarily copying files to run tests, it's sufficient
to change the current directory.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2022-01-29 13:10:47 +01:00
parent 3a30958e69
commit ffeb86f842

View File

@@ -23,14 +23,15 @@ RDEPEND="
"
BDEPEND="${RDEPEND}"
src_prepare() {
sed -e '/self.use_system_fitsio/s/False/True/' -i setup.py || die
distutils-r1_src_prepare
src_configure() {
cat >> setup.cfg <<-EOF || die
[build_ext]
use_system_fitsio = True
EOF
}
python_test() {
cp -r -l -n fitsio "${BUILD_DIR}/lib" || die
cd "${BUILD_DIR}/lib" || die
${EPYTHON} -c "import fitsio; exit(fitsio.test.test())" || die "Tests failed with ${EPYTHON}"
cd "${T}" || die
"${EPYTHON}" -c "import fitsio; exit(fitsio.test.test())" ||
die "Tests failed with ${EPYTHON}"
}