summaryrefslogtreecommitdiff
blob: 27431973b872eb9802e2877d68c4e354057d7eba (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
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6

DESCRIPTION="Open BEAGLE, a versatile EC/GA/GP framework"
SRC_URI="mirror://sourceforge/beagle/${P}.tar.gz"
HOMEPAGE="https://chgagne.github.io/beagle/"

SLOT="0"
LICENSE="LGPL-2.1"
KEYWORDS="~amd64 ~x86"
IUSE="doc examples static-libs"

RDEPEND="
	sys-libs/zlib
	!app-misc/beagle
	!dev-libs/libbeagle"
DEPEND="${RDEPEND}
	doc? ( app-doc/doxygen )"

PATCHES=(
	"${FILESDIR}/${PN}-3.0.3-gcc43.patch"
	"${FILESDIR}/${PN}-3.0.3-gcc47.patch"
	"${FILESDIR}/${PN}-3.0.3-fix-c++14.patch"
)

src_prepare() {
	default
	sed -e "s:@LIBS@:@LIBS@ -lpthread:" \
		-i PACC/Threading/Makefile.in || die
}

src_configure() {
	econf \
		--enable-optimization \
		$(use_enable static-libs static)
}

src_compile() {
	default
	use doc && emake doc
}

src_install() {
	use doc && local HTML_DOCS=( refman/. )
	if use examples; then
		dodoc -r examples
		docompress -x /usr/share/doc/${PF}/examples
	fi

	default

	if ! use static-libs; then
		find "${D}" -name '*.la' -delete || die
	fi
}