Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 14 additions & 23 deletions repos/spack_repo/builtin/packages/augustus/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,8 @@ class Augustus(MakefilePackage):
depends_on(Boost.with_default_variants)
depends_on("zlib-api")
depends_on("htslib")
depends_on("htslib@1.10:", when="@3.4.0:")
depends_on("bcftools")
depends_on("samtools")
# bam2wig/checkTargetSortedness use the legacy samtools API (sam.h, libbam.a),
# which was removed in samtools 1.14
depends_on("samtools@:1.13", when="@:3.3.2")
depends_on("ncurses")
depends_on("curl", when="@3.3.1:")
depends_on("sqlite", when="@3.4.0:")
Expand All @@ -71,11 +67,6 @@ class Augustus(MakefilePackage):
# corresponding environment variable
patch("bam2wig_Makefile.patch", when="@3.4.0")

# bam2wig links samtools' libbam.a, which calls bam_name2id. This became a static
# inline in htslib 1.10. Only 2 versions of augustus are affected. Earlier ones don't
# build bam2wig and 3.4.0+ links -lhts only.
conflicts("^htslib@1.10:", when="@3.3.1-tag1:3.3.2 ^samtools@:1.2")

def edit(self, spec, prefix):
# Set compile commands for each compiler and
# Fix for using 'boost' on Spack. (only after ver.3.3.1-tag1)
Expand Down Expand Up @@ -138,28 +129,28 @@ def edit(self, spec, prefix):
"LIBS = -lbamtools -lz", f"LIBS = {bamtools}/lib/bamtools/libbamtools.a -lz"
)

# For 3.3, when building with newer versions of Boost, the -ansi flag causes an old
# standard to be used which boost complains about.
if spec.satisfies("@=3.3"):
with working_dir("src"):
makefile = FileFilter("Makefile")
makefile.filter("-ansi", "-std=c++14")

if self.version < Version("3.4.0"):
with working_dir(join_path("auxprogs", "bam2wig")):
makefile = FileFilter("Makefile")
# point tools to spack installations
makefile.filter("BCFTOOLS=.*$", f"BCFTOOLS={bcftools}/include")
makefile.filter("SAMTOOLS=.*$", f"SAMTOOLS={samtools}/include")
makefile.filter("HTSLIB=.*$", f"HTSLIB={htslib}/include")

# fix bad linking dirs; libhts.a is linked statically, so
# anything it was built against must be named explicitly
hts = "$(HTSLIB)/../lib/libhts.a"
if spec.satisfies("^libdeflate"):
hts += " " + spec["libdeflate"].libs.ld_flags
# TABIX was never patched here -- defaults to
# $(HOME)/tools/tabix/ (a leftover from the author's own
# machine, see the Makefile's own comment) which doesn't
# exist for anyone building via Spack, causing bam2wig.c's
# #include "sam.h" (bare filename, matching the old flat
# htslib layout from ~2012) to fail with "No such file or
# directory". Modern htslib nests it under
# include/htslib/sam.h, so point TABIX there instead of a
# real tabix install -- it's only being used here as an
# extra -I path to make the bare include resolve.
makefile.filter("TABIX=.*$", f"TABIX={htslib}/include/htslib")

# fix bad linking dirs
makefile.filter("$(SAMTOOLS)/libbam.a", "$(SAMTOOLS)/../lib/libbam.a", string=True)
makefile.filter("$(HTSLIB)/libhts.a", hts, string=True)
makefile.filter("$(HTSLIB)/libhts.a", "$(HTSLIB)/../lib/libhts.a", string=True)
with working_dir(join_path("auxprogs", "checkTargetSortedness")):
makefile = FileFilter("Makefile")
makefile.filter("SAMTOOLS.*=.*$", f"SAMTOOLS={samtools}/include")
Expand Down
Loading