lrslib-042c-r2.ebuild 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # Copyright 1999-2012 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=4
  4. inherit toolchain-funcs
  5. DESCRIPTION="self-contained ANSI C implementation of the reverse search algorithm"
  6. HOMEPAGE="http://cgm.cs.mcgill.ca/~avis/C/lrs.html"
  7. SRC_URI="http://cgm.cs.mcgill.ca/~avis/C/lrslib/${P}.tar.gz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="amd64 x86"
  11. IUSE="gmp"
  12. DEPEND="gmp? ( dev-libs/gmp )"
  13. RDEPEND="${DEPEND}"
  14. src_prepare(){
  15. sed -i "s/gcc/$(tc-getCC)/g" makefile || die
  16. sed -i "s/-O3/${CFLAGS} ${LDFLAGS}/g" makefile || die
  17. # We don't like static linking to gmp or anywhere.
  18. if use amd64 ; then
  19. # This macro may only change messages that the
  20. # binary outputs, but just in case... (Bug 384195)
  21. sed -i "s/-static/-DB64/g" makefile || die
  22. else
  23. sed -i "s/-static//g" makefile || die
  24. fi
  25. }
  26. src_compile () {
  27. if use amd64 ; then
  28. emake all64
  29. else
  30. emake
  31. fi
  32. if use gmp ; then
  33. emake gmp
  34. fi
  35. }
  36. src_install() {
  37. dobin lrs redund redund1
  38. # Collides with sys-block/buffer
  39. newbin buffer lrsbuffer
  40. if use x86; then
  41. dobin nash setupnash setupnash2 2nash
  42. # Prevent clash with cddlib:
  43. newbin fourier lrsfourier
  44. fi
  45. if use gmp; then
  46. dobin glrs gredund gfourier
  47. # Clash with www-plugins/gnash
  48. newbin gnash lrsgnash
  49. fi
  50. dodoc readme
  51. dohtml lrslib.html
  52. }