molden-4.8-r2.ebuild 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=4
  4. inherit eutils fortran-2 flag-o-matic toolchain-funcs
  5. MY_P="${PN}${PV}"
  6. DESCRIPTION="Display molecular density from GAMESS-UK, GAMESS-US, GAUSSIAN and Mopac/Ampac"
  7. HOMEPAGE="http://www.cmbi.ru.nl/molden/"
  8. SRC_URI="ftp://ftp.cmbi.ru.nl/pub/molgraph/${PN}/${MY_P}.tar.gz"
  9. LICENSE="MOLDEN"
  10. SLOT="0"
  11. KEYWORDS="amd64 x86"
  12. IUSE="opengl"
  13. RDEPEND="
  14. x11-libs/libXmu
  15. virtual/glu
  16. opengl? (
  17. media-libs/freeglut
  18. virtual/opengl )"
  19. DEPEND="${RDEPEND}
  20. x11-misc/gccmakedep
  21. app-editors/vim"
  22. # vim provides ex, which the build system uses (surf/Makefile, at least)
  23. S="${WORKDIR}/${MY_P}"
  24. src_prepare() {
  25. epatch \
  26. "${FILESDIR}"/${P}-ambfor.patch \
  27. "${FILESDIR}"/${P}-overflow.patch \
  28. "${FILESDIR}"/${P}-ldflags.patch \
  29. "${FILESDIR}"/${PN}-4.7-implicit-dec.patch
  30. sed \
  31. -e 's:makedepend:gccmakedep:g' \
  32. -e "s:/usr/include/sgidefs.h::g" \
  33. -i surf/Makefile || die
  34. sed 's:shell g77:shell $(FC):g' -i makefile || die
  35. }
  36. src_compile() {
  37. # Use -mieee on alpha, according to the Makefile
  38. use alpha && append-flags -mieee
  39. # Honor CC, CFLAGS, FC, and FFLAGS from environment;
  40. # unfortunately a bash bug prevents us from doing typeset and
  41. # assignment on the same line.
  42. typeset -a args
  43. args=(
  44. CC="$(tc-getCC) ${CFLAGS}" \
  45. FC="$(tc-getFC)" \
  46. LDR="$(tc-getFC)" \
  47. FFLAGS="${FFLAGS}" )
  48. einfo "Building Molden..."
  49. emake -j1 "${args[@]}"
  50. if use opengl ; then
  51. einfo "Building Molden OpenGL helper..."
  52. emake -j1 "${args[@]}" moldenogl
  53. fi
  54. }
  55. src_install() {
  56. dobin ${PN} g${PN}
  57. if use opengl ; then
  58. dobin ${PN}ogl
  59. fi
  60. dodoc HISTORY README REGISTER
  61. cd doc
  62. uncompress * && dodoc *
  63. }