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

EAPI=6

inherit autotools eutils

DESCRIPTION="C implementation of the Double Description Method of Motzkin et al"
HOMEPAGE="https://www.inf.ethz.ch/personal/fukudak/cdd_home/"
SRC_URI="ftp://ftp.math.ethz.ch/users/fukudak/cdd/${P}.tar.gz"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~amd64 ~arm ~ppc ~x86 ~amd64-linux ~x86-linux"
IUSE="doc static-libs tools"

DEPEND="dev-libs/gmp:0="
RDEPEND="${DEPEND}"

DOCS=( ChangeLog README )

PATCHES=(
	"${FILESDIR}"/${P}-add-cdd_both_reps-binary.patch
	"${FILESDIR}"/${P}-enforce-no-gmp.patch
)

src_prepare() {
	default
	sed -e 's|localdebug=dd_TRUE|localdebug=dd_FALSE|g' \
		-i lib-src/cddlp.c -i lib-src-gmp/cddlp.c -i lib-src-gmp/cddlp_f.c || die
	cp "${FILESDIR}"/cdd_both_reps.c src || die
	ln -s "${S}"/src/cdd_both_reps.c "${S}"/src-gmp/cdd_both_reps.c || die
	eautoreconf
}

src_configure() {
	econf $(use_enable static-libs static)
}

src_install() {
	default
	use tools || rm "${ED}"/usr/bin/*
	use static-libs || prune_libtool_files --all
	use doc && dodoc doc/cddlibman.pdf
}