summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Seifert <soap@gentoo.org>2021-10-03 19:41:39 +0200
committerDavid Seifert <soap@gentoo.org>2021-10-03 19:41:39 +0200
commit938a340079ee1b725936dad3e441faf8cc3420cd (patch)
tree6d850a78178d3dc651dbff3bcdb04383a3e8201c /sci-biology/pysam/pysam-0.17.0.ebuild
parentsci-biology/bcftools: add 1.13 (diff)
downloadgentoo-938a340079ee1b725936dad3e441faf8cc3420cd.tar.gz
gentoo-938a340079ee1b725936dad3e441faf8cc3420cd.tar.bz2
gentoo-938a340079ee1b725936dad3e441faf8cc3420cd.zip
sci-biology/pysam: add 0.17.0
Signed-off-by: David Seifert <soap@gentoo.org>
Diffstat (limited to 'sci-biology/pysam/pysam-0.17.0.ebuild')
-rw-r--r--sci-biology/pysam/pysam-0.17.0.ebuild66
1 files changed, 66 insertions, 0 deletions
diff --git a/sci-biology/pysam/pysam-0.17.0.ebuild b/sci-biology/pysam/pysam-0.17.0.ebuild
new file mode 100644
index 000000000000..afdc4777e20e
--- /dev/null
+++ b/sci-biology/pysam/pysam-0.17.0.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+
+inherit distutils-r1
+
+DESCRIPTION="Python interface for the SAM/BAM sequence alignment and mapping format"
+HOMEPAGE="
+ https://github.com/pysam-developers/pysam
+ https://pypi.org/project/pysam/"
+SRC_URI="https://github.com/pysam-developers/pysam/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="=sci-libs/htslib-1.13*:="
+DEPEND="${RDEPEND}
+ dev-python/cython[${PYTHON_USEDEP}]
+ dev-python/setuptools[${PYTHON_USEDEP}]"
+BDEPEND="
+ test? (
+ =sci-biology/bcftools-1.13*
+ =sci-biology/samtools-1.13*
+ )"
+
+distutils_enable_tests pytest
+
+DISTUTILS_IN_SOURCE_BUILD=1
+
+EPYTEST_DESELECT=(
+ # only work with bundled htslib
+ 'tests/tabix_test.py::TestRemoteFileHTTP'
+ 'tests/tabix_test.py::TestRemoteFileHTTPWithHeader'
+)
+
+python_prepare_all() {
+ # unbundle htslib
+ export HTSLIB_MODE="external"
+ export HTSLIB_INCLUDE_DIR="${EPREFIX}"/usr/include
+ export HTSLIB_LIBRARY_DIR="${EPREFIX}"/usr/$(get_libdir)
+ rm -r htslib || die
+
+ # prevent setup.py from adding RPATHs (except $ORIGIN)
+ sed -e '/runtime_library_dirs=htslib_library_dirs/d' \
+ -i setup.py || die
+
+ if use test; then
+ einfo "Building test data"
+ emake -C tests/pysam_data
+ emake -C tests/cbcf_data
+ fi
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile() {
+ # breaks with parallel build
+ # need to avoid dropping .so plugins into
+ # build-lib, which breaks tests
+ esetup.py build_ext --inplace -j1
+ distutils-r1_python_compile -j1
+}