Package/py pysam macos (#33851)

* cleaned up style, linked to external htslib

* removed htslib/bcfrools/samtools deps, use bundled libs instead

the pysam package includes the necessary libs to link to, so it wasn't even using linked libs when building

* fixed style

* revert to using external htslib

currently uses bundled samtools and bcftools, and there is no way to use external versions for those dependencies

* added libs property to htslibs package

added support for lib64

* added htslib name
This commit is contained in:
Luke Diorio-Toth 2023-02-27 16:25:21 -06:00 committed by GitHub
parent 502e216ee2
commit 779e80b7c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 4 deletions

View file

@ -52,6 +52,10 @@ class Htslib(AutotoolsPackage):
depends_on("automake", when="@1.2") depends_on("automake", when="@1.2")
depends_on("libtool", when="@1.2") depends_on("libtool", when="@1.2")
@property
def libs(self):
return find_libraries("libhts", root=self.prefix, recursive=True)
# v1.2 uses the automagically assembled tarball from .../archive/... # v1.2 uses the automagically assembled tarball from .../archive/...
# everything else uses the tarballs uploaded to the release # everything else uses the tarballs uploaded to the release
def url_for_version(self, version): def url_for_version(self, version):

View file

@ -26,11 +26,18 @@ class PyPysam(PythonPackage):
depends_on("py-cython@0.21:", when="@0.14:", type="build") depends_on("py-cython@0.21:", when="@0.14:", type="build")
depends_on("py-cython@0.17:", type="build") depends_on("py-cython@0.17:", type="build")
depends_on("curl") depends_on("curl")
depends_on("bcftools") depends_on("xz")
depends_on("htslib")
depends_on("samtools")
depends_on("htslib@:1.6", when="@:0.13") depends_on("htslib@:1.6", when="@:0.13")
depends_on("htslib")
def setup_build_environment(self, env): def setup_build_environment(self, env):
env.set("LDFLAGS", self.spec["curl"].libs.search_flags) env.set("LDFLAGS", self.spec["curl"].libs.search_flags)
# this flag is supposed to be removed by cy_build.py, but for some reason isn't
if self.spec.platform == "darwin":
env.remove_flags("LDSHARED", "-bundle")
# linking htslib, see:
# http://pysam.readthedocs.org/en/latest/installation.html#external
# https://github.com/pysam-developers/pysam/blob/v0.9.0/setup.py#L79
env.set("HTSLIB_MODE", "external")
env.set("HTSLIB_LIBRARY_DIR", self.spec["htslib"].libs.directories[0])
env.set("HTSLIB_INCLUDE_DIR", self.spec["htslib"].headers.directories[0])