app-editors/kakoune: drop old 0_pre20160620
[gentoo.git] / sci-libs / lrslib / lrslib-042c-r2.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=4
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         # We don't like static linking to gmp or anywhere.
24         if use amd64 ; then
25                 # This macro may only change messages that the
26                 # binary outputs, but just in case... (Bug 384195)
27                 sed -i "s/-static/-DB64/g" makefile || die
28         else
29                 sed -i "s/-static//g" makefile || die
30         fi
31 }
32
33 src_compile () {
34         if use amd64 ; then
35                 emake all64
36         else
37                 emake
38         fi
39         if use gmp ; then
40                 emake gmp
41         fi
42 }
43
44 src_install() {
45         dobin lrs redund redund1
46         # Collides with sys-block/buffer
47         newbin buffer lrsbuffer
48         if use x86; then
49                 dobin nash setupnash setupnash2 2nash
50                 # Prevent clash with cddlib:
51                 newbin fourier lrsfourier
52         fi
53         if use gmp; then
54                 dobin glrs gredund gfourier
55                 # Clash with www-plugins/gnash
56                 newbin gnash lrsgnash
57         fi
58         dodoc readme
59         dohtml lrslib.html
60 }