aboutsummaryrefslogtreecommitdiff
blob: de93157a4ddac94da666be64b37b95b0429b2398 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

PYTHON_COMPAT=( python{2_7,3_{4,5}} )

inherit eutils toolchain-funcs

DESCRIPTION="De novo de Bruijn genome assembler overcoming uneven coverage"
HOMEPAGE="http://bioinf.spbau.ru/en/spades"
SRC_URI="
	http://spades.bioinf.spbau.ru/release${PV}/SPAdes-${PV}.tar.gz
	http://spades.bioinf.spbau.ru/release${PV}/manual.html -> ${P}_manual.html
	http://spades.bioinf.spbau.ru/release${PV}/dipspades_manual.html -> ${P}_dipspades_manual.html
	http://spades.bioinf.spbau.ru/release${PV}/rnaspades_manual.html -> ${P}_rnaspades_manual.html
	http://spades.bioinf.spbau.ru/release${PV}/truspades_manual.html -> ${P}_truspades_manual.html"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS=""
IUSE=""

DEPEND="
	sys-libs/zlib
	app-arch/bzip2
	dev-python/regex
	dev-libs/boost"
RDEPEND="${DEPEND}"

# BUG: "${S}"/ext/src/ contains plenty of bundled 3rd-party tools. Drop them all and properly DEPEND on their
#      existing packages
# nlopt
# llvm
# python_libs
# bamtools
# ConsensusCore
# ssw
# jemalloc
# htrie
# getopt_pp
# cppformat
# cityhash
# samtools
# bwa

# BUG: "${S}"/ext/tools/ contains even two version of bwa
# bwa-0.7.12
# bwa-0.6.2

pkg_pretend() {
	if [[ ${MERGE_TYPE} != binary ]]; then
		if [[ $(tc-getCXX) == *g++ ]] ; then
			if [[ $(gcc-major-version) == 4 && $(gcc-minor-version) -lt 7 || $(gcc-major-version) -lt 4 ]] ; then
				eerror "You need at least sys-devel/gcc-4.7.0"
				die "You need at least sys-devel/gcc-4.7.0"
			fi
		fi
	fi
}

src_prepare(){
	# https://github.com/Homebrew/homebrew-science/pull/5616
	epatch "${FILESDIR}"/"${P}"-fix-missing-include.patch
	cp -p spades_compile.sh spades_install.sh || die
	sed -e 's/make install/#make install/;s/cd $PREFIX/#cd $PREFIX/' -i spades_compile.sh || die
	default
}

src_compile(){
	mkdir build_spades || die
	cd build_spades || die
	cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${ED}/usr" $* "${S}/src" || die
}

src_install(){
	cd build_spades || die
	emake install PREFIX="${ED}"/usr
	# BUG: move *.py files to standard site-packages/ subdirectories
	insinto /usr/share/"${PN}"
	dodoc "${DISTDIR}"/${P}_*manual.html
}