| 1 |
|
# Copyright 1999-2024 Gentoo Authors
|
|
1 |
# Copyright 1999-2021 Gentoo Authors
|
| 2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
3 |
|
| 4 |
4 |
EAPI=8
|
| 5 |
5 |
|
| 6 |
|
inherit toolchain-funcs
|
| 7 |
|
|
| 8 |
6 |
DESCRIPTION="Bayesian Inference of Phylogeny"
|
| 9 |
|
HOMEPAGE="http://mrbayes.csit.fsu.edu/"
|
| 10 |
|
SRC_URI="https://downloads.sourceforge.net/${PN}/${P}.tar.gz"
|
|
7 |
HOMEPAGE="https://nbisweden.github.io/MrBayes/"
|
|
8 |
SRC_URI="https://github.com/NBISweden/MrBayes/releases/download/v${PV}/${P}.tar.gz"
|
| 11 |
9 |
|
| 12 |
10 |
LICENSE="GPL-2"
|
| 13 |
11 |
SLOT="0"
|
| 14 |
12 |
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
|
| 15 |
13 |
IUSE="debug mpi readline"
|
|
14 |
# --with-readline was given, but MPI support requires readline to be disabled.
|
|
15 |
REQUIRED_USE="mpi? ( !readline )"
|
| 16 |
16 |
|
| 17 |
17 |
DEPEND="
|
| 18 |
18 |
sys-libs/ncurses:=
|
| ... | ... | |
| 21 |
21 |
"
|
| 22 |
22 |
RDEPEND="${DEPEND}"
|
| 23 |
23 |
|
| 24 |
|
src_prepare() {
|
| 25 |
|
default
|
| 26 |
|
|
| 27 |
|
if use mpi; then
|
| 28 |
|
sed -e "s:MPI ?= no:MPI=yes:" -i Makefile || die "Patching MPI support."
|
| 29 |
|
fi
|
| 30 |
|
if ! use readline; then
|
| 31 |
|
sed -e "s:USEREADLINE ?= yes:USEREADLINE=no:" \
|
| 32 |
|
-i Makefile || die "Patching readline support."
|
| 33 |
|
else
|
| 34 |
|
# Only needed for OSX with an old (4.x) version of
|
| 35 |
|
# libreadline, but it doesn't hurt for other distributions.
|
| 36 |
|
eapply "${FILESDIR}"/mb_readline_312.patch
|
| 37 |
|
fi
|
| 38 |
|
sed -e 's:-ggdb::g' -i Makefile || die
|
|
24 |
src_configure() {
|
|
25 |
econf \
|
|
26 |
"$(use_with mpi)" \
|
|
27 |
"$(use_with readline)" \
|
|
28 |
"$(use_enable debug )" \
|
|
29 |
# configure checks cpuid and enables fma{3,4}, sse{1..4} if detected.
|
|
30 |
# Configure options only allow disabling the auto-detection, but do not
|
|
31 |
# actually allow toggling the individual cpu instruction sets. The only
|
|
32 |
# way to guarantee that cross-compiling and binpkgs will work on machines
|
|
33 |
# other than the host is to unconditionally disable sse/fma/avx.
|
|
34 |
#"$(use_enable cpu_flags_x86_sse sse )" \
|
|
35 |
#"$(use_enable cpu_flags_x86_avx avx )" \
|
|
36 |
#"$(use_enable cpu_flags_x86_fma3 fma )" \
|
|
37 |
# Has optional support for sci-biology/beagle::science
|
|
38 |
# "$(use_with beagle)"
|
| 39 |
39 |
}
|
| 40 |
40 |
|
| 41 |
41 |
src_compile() {
|
| 42 |
|
local myconf mycc
|
| 43 |
|
|
| 44 |
|
if use mpi; then
|
| 45 |
|
mycc=mpicc
|
| 46 |
|
else
|
| 47 |
|
mycc="$(tc-getCC)"
|
| 48 |
|
fi
|
| 49 |
|
|
| 50 |
|
use mpi && myconf="MPI=yes"
|
| 51 |
|
use readline || myconf="${myconf} USEREADLINE=no"
|
| 52 |
|
use debug && myconf="${myconf} DEBUG=yes"
|
| 53 |
|
emake \
|
| 54 |
|
OPTFLAGS="${CFLAGS}" \
|
| 55 |
|
LDFLAGS="${LDFLAGS}" \
|
| 56 |
|
CC=${mycc} \
|
| 57 |
|
${myconf}
|
| 58 |
|
}
|
| 59 |
|
|
| 60 |
|
src_install() {
|
| 61 |
|
dobin mb
|
| 62 |
|
insinto /usr/share/${PN}
|
| 63 |
|
doins *.nex
|
|
42 |
# The --disable options for the cpu instruction sets don't actually work so
|
|
43 |
# we override it here and also set the user specified CFLAGS.
|
|
44 |
emake SIMD_FLAGS= CPUEXT_FLAGS= CFLAGS="${CFLAGS}"
|
| 64 |
45 |
}
|