summaryrefslogtreecommitdiff
blob: a4c7a3bbab60a8d0b7db8d2fa822d5948fcf433e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sci-biology/samtools/samtools-0.1.18-r3.ebuild,v 1.2 2013/12/06 12:44:16 jlec Exp $

EAPI=5

inherit multilib toolchain-funcs

DESCRIPTION="Utilities for SAM (Sequence Alignment/Map), a format for large nucleotide sequence alignments"
HOMEPAGE="http://samtools.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"

LICENSE="MIT"
SLOT="0"
IUSE="examples"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x64-macos"

RDEPEND="sys-libs/ncurses"
DEPEND="${RDEPEND}
	virtual/pkgconfig"

src_prepare() {
	sed \
		-e '/^CC/s:=:?=:g' \
		-e "/^LIBCURSES/s:=.*$:= $(pkg-config --libs ncurses):g" \
		-e '/^CFLAGS=/s:=:?=:' \
		-e "s/\$(CC) \$(CFLAGS)/& \$(LDFLAGS)/g" \
		-e "s/-shared/& \$(LDFLAGS)/" \
		-i "${S}"/{bcftools,misc,}/Makefile || die #358563
	sed -i 's~/software/bin/python~/usr/bin/env python~' "${S}"/misc/varfilter.py || die

	tc-export CC
}

src_compile() {
	emake dylib
	emake
}

src_install() {
	dobin samtools $(find bcftools misc -type f -executable)

	dolib.so libbam.so.1
	dosym libbam.so.1 /usr/$(get_libdir)/libbam.so

	insinto /usr/include/bam
	doins bam.h bgzf.h faidx.h kaln.h khash.h kprobaln.h kseq.h ksort.h sam.h

	doman ${PN}.1
	dodoc AUTHORS ChangeLog NEWS

	if use examples; then
		insinto /usr/share/${PN}
		doins -r examples
	fi
}