commit:     35ac52402ad5f6a417d6af10e13df64a8da559b2
Author:     Martin Mokrejš <mmokrejs <AT> fold <DOT> natur <DOT> cuni <DOT> cz>
AuthorDate: Thu Feb 16 23:02:54 2017 +0000
Commit:     Martin Mokrejs <mmokrejs <AT> fold <DOT> natur <DOT> cuni <DOT> cz>
CommitDate: Thu Feb 16 23:02:54 2017 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=35ac5240

sci-biology/samtools: version bump; partially updated patch but without 
libbam.{a,so} change

I did not manage to get to compile the shared library so samtools binary at the 
moment
contains libbam.a (which is what upstream prefers but not Gentoo).

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 .../files/samtools-1.3.1-buildsystem.patch         | 75 +++++++++++++++++++
 sci-biology/samtools/samtools-1.3.1.ebuild         | 84 ++++++++++++++++++++++
 2 files changed, 159 insertions(+)

diff --git a/sci-biology/samtools/files/samtools-1.3.1-buildsystem.patch 
b/sci-biology/samtools/files/samtools-1.3.1-buildsystem.patch
new file mode 100644
index 000000000..bd0f20c7c
--- /dev/null
+++ b/sci-biology/samtools/files/samtools-1.3.1-buildsystem.patch
@@ -0,0 +1,75 @@
+--- samtools-1.3.1/Makefile.ori        2016-04-22 11:51:16.000000000 +0200
++++ samtools-1.3.1/Makefile    2017-02-16 23:41:19.819951687 +0100
+@@ -21,9 +21,9 @@
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ # DEALINGS IN THE SOFTWARE.
+ 
+-CC       = gcc
++CC       ?= gcc
+ CPPFLAGS =
+-CFLAGS   = -g -Wall -O2
++CFLAGS   ?= -g -Wall -O2
+ LDFLAGS  =
+ LIBS     =
+ 
+@@ -197,8 +203,8 @@
+ # For tests that might use it, set $REF_PATH explicitly to use only reference
+ # areas within the test suite (or set it to ':' to use no reference areas).
+ # (regression.sh sets $REF_PATH to a subdirectory itself.)
+-check test: samtools $(BGZIP) $(BUILT_TEST_PROGRAMS)
+-      REF_PATH=: test/test.pl --exec bgzip=$(BGZIP)
++check test: samtools $(BUILT_TEST_PROGRAMS)
++      REF_PATH=: test/test.pl --exec bgzip=bgzip
+       test/merge/test_bam_translate test/merge/test_bam_translate.tmp
+       test/merge/test_rtrans_build
+       test/merge/test_trans_tbl_init
+@@ -210,28 +216,28 @@
+       test/split/test_parse_args
+ 
+ 
+-test/merge/test_bam_translate: test/merge/test_bam_translate.o test/test.o 
sam_opts.o $(HTSLIB)
++test/merge/test_bam_translate: test/merge/test_bam_translate.o test/test.o 
sam_opts.o
+       $(CC) -pthread $(ALL_LDFLAGS) -o $@ test/merge/test_bam_translate.o 
test/test.o sam_opts.o $(HTSLIB_LIB) $(ALL_LIBS)
+ 
+-test/merge/test_rtrans_build: test/merge/test_rtrans_build.o sam_opts.o 
$(HTSLIB)
++test/merge/test_rtrans_build: test/merge/test_rtrans_build.o sam_opts.o
+       $(CC) -pthread $(ALL_LDFLAGS) -o $@ test/merge/test_rtrans_build.o 
sam_opts.o $(HTSLIB_LIB) $(ALL_LIBS)
+ 
+-test/merge/test_trans_tbl_init: test/merge/test_trans_tbl_init.o sam_opts.o 
$(HTSLIB)
++test/merge/test_trans_tbl_init: test/merge/test_trans_tbl_init.o sam_opts.o
+       $(CC) -pthread $(ALL_LDFLAGS) -o $@ test/merge/test_trans_tbl_init.o 
sam_opts.o $(HTSLIB_LIB) $(ALL_LIBS)
+ 
+-test/split/test_count_rg: test/split/test_count_rg.o test/test.o sam_opts.o 
$(HTSLIB)
++test/split/test_count_rg: test/split/test_count_rg.o test/test.o sam_opts.o
+       $(CC) -pthread $(ALL_LDFLAGS) -o $@ test/split/test_count_rg.o 
test/test.o sam_opts.o $(HTSLIB_LIB) $(ALL_LIBS)
+ 
+-test/split/test_expand_format_string: test/split/test_expand_format_string.o 
test/test.o sam_opts.o $(HTSLIB)
++test/split/test_expand_format_string: test/split/test_expand_format_string.o 
test/test.o sam_opts.o
+       $(CC) -pthread $(ALL_LDFLAGS) -o $@ 
test/split/test_expand_format_string.o test/test.o sam_opts.o $(HTSLIB_LIB) 
$(ALL_LIBS)
+ 
+-test/split/test_filter_header_rg: test/split/test_filter_header_rg.o 
test/test.o sam_opts.o $(HTSLIB)
++test/split/test_filter_header_rg: test/split/test_filter_header_rg.o 
test/test.o sam_opts.o
+       $(CC) -pthread $(ALL_LDFLAGS) -o $@ test/split/test_filter_header_rg.o 
test/test.o sam_opts.o $(HTSLIB_LIB) $(ALL_LIBS)
+ 
+-test/split/test_parse_args: test/split/test_parse_args.o test/test.o 
sam_opts.o $(HTSLIB)
++test/split/test_parse_args: test/split/test_parse_args.o test/test.o 
sam_opts.o
+       $(CC) -pthread $(ALL_LDFLAGS) -o $@ test/split/test_parse_args.o 
test/test.o sam_opts.o $(HTSLIB_LIB) $(ALL_LIBS)
+ 
+-test/vcf-miniview: test/vcf-miniview.o $(HTSLIB)
++test/vcf-miniview: test/vcf-miniview.o
+       $(CC) -pthread $(ALL_LDFLAGS) -o $@ test/vcf-miniview.o $(HTSLIB_LIB) 
$(ALL_LIBS)
+ 
+ test_test_h = test/test.h $(htslib_sam_h)
+@@ -258,10 +264,10 @@
+ misc/maq2sam-long: misc/maq2sam-long.o
+       $(CC) $(LDFLAGS) -o $@ misc/maq2sam-long.o $(ALL_LIBS)
+ 
+-misc/md5fa: misc/md5fa.o $(HTSLIB)
++misc/md5fa: misc/md5fa.o
+       $(CC) $(ALL_LDFLAGS) -o $@ misc/md5fa.o $(HTSLIB_LIB) $(ALL_LIBS)
+ 
+-misc/md5sum-lite: misc/md5sum-lite.o $(HTSLIB)
++misc/md5sum-lite: misc/md5sum-lite.o
+       $(CC) $(ALL_LDFLAGS) -o $@ misc/md5sum-lite.o $(HTSLIB_LIB) $(ALL_LIBS)
+ 
+ misc/wgsim: misc/wgsim.o

diff --git a/sci-biology/samtools/samtools-1.3.1.ebuild 
b/sci-biology/samtools/samtools-1.3.1.ebuild
new file mode 100644
index 000000000..8c118dcf4
--- /dev/null
+++ b/sci-biology/samtools/samtools-1.3.1.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils multilib python-r1 toolchain-funcs
+
+DESCRIPTION="Utilities for SAM (Sequence Alignment/Map)"
+HOMEPAGE="http://www.htslib.org/";
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x64-macos"
+IUSE="examples"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+CDEPEND="
+       sys-libs/ncurses:0=
+       >=sci-libs/htslib-${PV}"
+
+RDEPEND="${CDEPEND}
+       dev-lang/lua
+       dev-lang/perl"
+DEPEND="${CDEPEND}
+       virtual/pkgconfig"
+
+src_prepare() {
+       find htslib-* -delete || die
+
+       sed -i 's~/software/bin/python~/usr/bin/env python~' 
"${S}"/misc/varfilter.py || die
+
+       epatch \
+               "${FILESDIR}"/${P}-buildsystem.patch
+
+       tc-export CC AR
+
+       sed \
+               -e '/htslib.mk/d' \
+               -i Makefile || die
+}
+
+src_compile() {
+       local mymakeargs=(
+               LIBCURSES="$($(tc-getPKG_CONFIG) --libs ncurses)"
+               HTSDIR="${EPREFIX}/usr/include"
+               HTSLIB=$($(tc-getPKG_CONFIG) --libs htslib)
+               BAMLIB="libbam.so"
+               )
+       emake "${mymakeargs[@]}"
+}
+
+src_test() {
+       local mymakeargs=(
+               LIBCURSES="$($(tc-getPKG_CONFIG) --libs ncurses)"
+               HTSDIR="${EPREFIX}/usr/include"
+               HTSLIB=$($(tc-getPKG_CONFIG) --libs htslib)
+               BAMLIB="libbam.so"
+               )
+       LD_LIBRARY_PATH="${S}" emake "${mymakeargs[@]}" test
+}
+
+src_install() {
+       dobin samtools $(find misc -type f -executable)
+
+       python_replicate_script "${ED}"/usr/bin/varfilter.py
+       #dolib.so libbam.so*
+       dolib libbam.a
+
+       insinto /usr/include/bam
+       doins *.h
+
+       doman ${PN}.1
+       dodoc AUTHORS NEWS README
+
+       if use examples; then
+               insinto /usr/share/${PN}
+               doins -r examples
+       fi
+}

Reply via email to