commit:     ffeb86f842f8662baec059775bb8a32156520c6e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 29 12:10:47 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jan 29 12:10:47 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ffeb86f8

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 <AT> gentoo.org>

 dev-python/fitsio/fitsio-1.1.7.ebuild | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/dev-python/fitsio/fitsio-1.1.7.ebuild 
b/dev-python/fitsio/fitsio-1.1.7.ebuild
index 80ad81b256f8..238fbca619fb 100644
--- a/dev-python/fitsio/fitsio-1.1.7.ebuild
+++ b/dev-python/fitsio/fitsio-1.1.7.ebuild
@@ -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}"
 }

Reply via email to