glpk-4.45.ebuild 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=2
  4. inherit eutils flag-o-matic
  5. DESCRIPTION="GNU Linear Programming Kit"
  6. LICENSE="GPL-3"
  7. HOMEPAGE="https://www.gnu.org/software/glpk/"
  8. SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
  9. SLOT="0"
  10. IUSE="doc examples gmp odbc mysql static-libs"
  11. KEYWORDS="alpha amd64 hppa ppc ppc64 sparc x86 ~ppc-aix ~x86-fbsd ~amd64-linux ~x86-linux"
  12. RDEPEND="sys-libs/zlib
  13. odbc? ( || ( dev-db/libiodbc dev-db/unixODBC ) )
  14. gmp? ( dev-libs/gmp )
  15. mysql? ( virtual/mysql )"
  16. DEPEND="${RDEPEND}
  17. virtual/pkgconfig"
  18. src_prepare() {
  19. epatch "${FILESDIR}"/${PN}-4.52.1-mariadb-5.5.patch
  20. }
  21. src_configure() {
  22. local myconf="--disable-dl"
  23. if use mysql || use odbc; then
  24. myconf="--enable-dl"
  25. fi
  26. [[ -z $(type -P odbc-config) ]] && \
  27. append-cppflags $(pkg-config --cflags libiodbc)
  28. econf \
  29. --with-zlib \
  30. $(use_enable static-libs static) \
  31. $(use_with gmp) \
  32. $(use_enable odbc) \
  33. $(use_enable mysql) \
  34. ${myconf}
  35. }
  36. src_install() {
  37. emake DESTDIR="${D}" install || die "emake install failed"
  38. dodoc AUTHORS ChangeLog NEWS README || \
  39. die "failed to install docs"
  40. insinto /usr/share/doc/${PF}
  41. if use examples; then
  42. emake distclean
  43. doins -r examples || die "failed to install examples"
  44. fi
  45. if use doc; then
  46. cd "${S}"/doc
  47. doins *.pdf notes/*.pdf || die "failed to instal djvu and pdf"
  48. dodoc *.txt || die "failed to install manual files"
  49. fi
  50. }