+++ /dev/null
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-DIST_AUTHOR=LDS
-DIST_VERSION=1.42
-inherit perl-module toolchain-funcs
-
-DESCRIPTION="Read SAM/BAM database files"
-
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE=""
-LICENSE="|| ( Apache-2.0 Artistic-2 GPL-1+ )"
-
-RDEPEND="
- >=sci-biology/bioperl-1.6.9
- >=sci-biology/samtools-1:0
-"
-DEPEND="${RDEPEND}
- virtual/perl-ExtUtils-CBuilder
- >=dev-perl/Module-Build-0.420.0
-"
-
-DIST_TEST=skip
-# cannot load its own library, fundamentally b0rken
-
-PATCHES=(
- "${FILESDIR}"/${PN}-1.390.0-samtools-1.patch
-)
-
-src_prepare() {
- find . -type f -exec chmod +w '{}' + || die
- sed \
- -e 's|my $HeaderFile = "bam.h";|my $HeaderFile = "bam/bam.h";|' \
- -e 's|my $LibFile = "libbam.a";|my $LibFile = "libbam.so";|' \
- -i Build.PL || die
- sed \
- -e 's|#include "bam.h"|#include "bam/bam.h"|' \
- -e 's|#include "sam.h"|#include "bam/sam.h"|' \
- -e 's|#include "khash.h"|#include "htslib/khash.h"|' \
- -e 's|#include "faidx.h"|#include "htslib/faidx.h"|' \
- -i lib/Bio/DB/Sam.xs c_bin/bam2bedgraph.c || die
-
- perl-module_src_prepare
-
- tc-export CC
-}
+++ /dev/null
- Build.PL | 2 +-
- c_bin/makefile | 6 +++---
- lib/Bio/DB/Sam.xs | 9 ++++++---
- 3 files changed, 10 insertions(+), 7 deletions(-)
-
-diff --git a/Build.PL b/Build.PL
-index 1393e03..cf97ad5 100644
---- a/Build.PL
-+++ b/Build.PL
-@@ -38,7 +38,7 @@ my $build = $class->new(
- dist_abstract => 'Perl interface to SamTools library for DNA sequencing',
- license => 'perl',
- include_dirs => [$sam_include],
-- extra_linker_flags => ["-L$sam_lib",'-lbam','-lpthread','-lz'],
-+ extra_linker_flags => ["-L$sam_lib",'-lbam','-lhts','-lpthread','-lz'],
-
- extra_compiler_flags=>[
-
-diff --git a/c_bin/makefile b/c_bin/makefile
-index 9aef917..96a30f2 100644
---- a/c_bin/makefile
-+++ b/c_bin/makefile
-@@ -1,5 +1,5 @@
--CC= gcc
--CFLAGS= -g -Wall -O2 -fPIC
-+CC?= gcc
-+CFLAGS?= -g -Wall -O2 -fPIC
- DFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1
- INCLUDES=
- LIBPATH=
-@@ -14,7 +14,7 @@ PROG= bam2bedgraph
- all:$(PROG)
-
- bam2bedgraph: bam2bedgraph.o
-- $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LIBPATH) -lbam -lpthread -lm -lz
-+ $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LIBPATH) -lbam -lhts -lpthread -lm -lz
-
- clean:
- rm -f *.o $(PROG)
-diff --git a/lib/Bio/DB/Sam.xs b/lib/Bio/DB/Sam.xs
-index 5ca303b..7f92860 100644
---- a/lib/Bio/DB/Sam.xs
-+++ b/lib/Bio/DB/Sam.xs
-@@ -571,9 +571,12 @@ bama_l_aux(b,...)
- Bio::DB::Bam::Alignment b
- PROTOTYPE: $;$
- CODE:
-- if (items > 1)
-- b->l_aux = SvIV(ST(1));
-- RETVAL=b->l_aux;
-+ if (items > 1) {
-+ RETVAL = SvIV(ST(1));
-+ }
-+ else {
-+ RETVAL=bam_get_l_aux(b);
-+ }
- OUTPUT:
- RETVAL
-