app-editors/kakoune: drop old 0_pre20160620
[gentoo.git] / sci-libs / lrslib / lrslib-042c-r1.ebuild
1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=2
5
6 inherit toolchain-funcs
7
8 DESCRIPTION="self-contained ANSI C implementation of the reverse search algorithm"
9 HOMEPAGE="http://cgm.cs.mcgill.ca/~avis/C/lrs.html"
10 SRC_URI="http://cgm.cs.mcgill.ca/~avis/C/lrslib/${P}.tar.gz"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="amd64 x86"
15 IUSE="gmp"
16
17 DEPEND="gmp? ( dev-libs/gmp )"
18 RDEPEND="${DEPEND}"
19
20 src_prepare(){
21         sed -i "s/gcc/$(tc-getCC)/g" makefile || die
22         sed -i "s/-O3/${CFLAGS} ${LDFLAGS}/g" makefile || die
23 }
24
25 src_compile () {
26         if use amd64 ; then
27                 emake all64 || die "make failed"
28         else
29                 emake || die "make failed"
30         fi
31         if use gmp ; then
32                 emake gmp || die "make failed"
33         fi
34 }
35
36 src_install() {
37         dobin lrs redund redund1 || die
38         # Collides with sys-block/buffer
39         newbin buffer lrsbuffer || die
40         if use x86; then
41                 dobin nash setupnash setupnash2 2nash || die
42                 # Prevent clash with cddlib:
43                 newbin fourier lrsfourier || die
44         fi
45         if use gmp; then
46                 dobin glrs gredund gfourier || die
47                 # Clash with www-plugins/gnash
48                 newbin gnash lrsgnash || die
49         fi
50         dodoc readme || die
51         dohtml lrslib.html || die
52 }