summaryrefslogtreecommitdiff
blob: 61d387b71dc02ce743ec8b193ee72087117b9332 (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
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=6

inherit toolchain-funcs

MY_PV="${PV//\./}"

DESCRIPTION="Library for genetic algorithms in C++ programs"
HOMEPAGE="http://lancet.mit.edu/ga/"
SRC_URI="http://lancet.mit.edu/ga/dist/galib${MY_PV}.tgz"

LICENSE="BSD examples? ( GPL-2 )"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
IUSE="doc examples"

S="${WORKDIR}/${PN}${MY_PV}"

PATCHES=(
	"${FILESDIR}/${PN}-2.4.7-fix-buildsystem.patch"
	"${FILESDIR}/${PN}-2.4.7-fix-c++14.patch"
	"${FILESDIR}/${PN}-2.4.7-Wformat-security.patch"
)

src_prepare() {
	default
	sed -e "s:/include:${EPREFIX}/usr/include:" \
		-e "s:/lib:${EPREFIX}/usr/$(get_libdir):" \
		-i makevars || die
}

src_compile() {
	emake \
		CXX="$(tc-getCXX)" \
		AR="$(tc-getAR)" \
		RANLIB="$(tc-getRANLIB)" \
		lib
	emake -C examples clean
}

src_install() {
	dodir /usr/$(get_libdir)

	use doc && HTML_DOCS+=( doc/. )
	if use examples; then
		dodoc -r examples
		find "${ED%/}/usr/share/doc/${PF}/examples" -iname 'makefile*' -delete || die
		docompress -x /usr/share/doc/${PF}/examples
	fi

	default
}