aboutsummaryrefslogtreecommitdiff
blob: c7ba45f91944a92909aca21f8895423dcfdd7f1d (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
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5

inherit eutils flag-o-matic toolchain-funcs

RELDATE="2016-03-04"
RELEASE="${PN}-v${PV}-${RELDATE}"

DESCRIPTION="Clustering Database at High Identity with Tolerance"
HOMEPAGE="http://weizhong-lab.ucsd.edu/cd-hit
	http://weizhongli-lab.org/cd-hit"
SRC_URI="https://github.com/weizhongli/cdhit/archive/V${PV}.tar.gz -> ${P}.tar.gz"

SLOT="0"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
LICENSE="GPL-2"
IUSE="doc openmp"

DEPEND="!sci-biology/cd-hit-auxtools"

S="${WORKDIR}"/cdhit-"${PV}"

pkg_setup() {
	 use openmp && ! tc-has-openmp && die "Please switch to an openmp compatible compiler"
}

src_prepare() {
	tc-export CXX
	use openmp || append-flags -DNO_OPENMP
	epatch "${FILESDIR}"/${PV}-gentoo.patch
}

src_compile() {
	local myconf=
	use openmp && myconf="openmp=yes"
	emake ${myconf}
	cd cd-hit-auxtools || die
	emake ${myconf}
}

src_install() {
	dodir /usr/bin
	emake PREFIX="${ED}/usr/bin" install
	dobin psi-cd-hit/*.pl cd-hit-auxtools/*.pl cd-hit-auxtools/{cd-hit-lap,read-linker,cd-hit-dup}
	dodoc ChangeLog psi-cd-hit/README.psi-cd-hit
	use doc && dodoc doc/* psi-cd-hit/qsub-template "${FILESDIR}"/cd-hit-auxtools-manual.txt
}

pkg_postinst(){
	einfo "From the original http://weizhong-lab.ucsd.edu/software/cdhit-454 package"
	einfo "we still lack cdhit-cluster-consensus part. You may want to install yourself"
	einfo "http://weizhong-lab.ucsd.edu/softwares/cd-hit-454/cdhit-cluster-consensus-2013-03-27.tgz"
	einfo ""
	einfo "The cd-hit-auxtools are no longer a separate package and belong to cd-hit since"
	einfo "version 4.6.5. However, there is no manual for that in current cd-hit tree. Therefore"
	einfo "see http://weizhong-lab.ucsd.edu/cd-hit/wiki/doku.php?id=cd-hit-auxtools-manual"
	einfo "A local copy is is in /usr/share/doc/${PN}/cd-hit-auxtools-manual.txt"
}