molden-5.5.ebuild 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  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. PATCHES=(
  25. "${FILESDIR}"/${PN}-5.0-ambfor.patch
  26. "${FILESDIR}"/${PN}-5.0-overflow.patch
  27. "${FILESDIR}"/${PN}-4.8-ldflags.patch
  28. "${FILESDIR}"/${PN}-4.7-implicit-dec.patch
  29. )
  30. src_prepare() {
  31. default
  32. sed \
  33. -e 's:makedepend:gccmakedep:g' \
  34. -i surf/Makefile || die
  35. sed 's:shell g77:shell $(FC):g' -i makefile || die
  36. }
  37. src_compile() {
  38. local args=()
  39. # Use -mieee on alpha, according to the Makefile
  40. use alpha && append-flags -mieee
  41. args=(
  42. CC="$(tc-getCC) ${CFLAGS}"
  43. FC="$(tc-getFC)"
  44. LDR="$(tc-getFC)"
  45. FFLAGS="${FFLAGS}"
  46. )
  47. einfo "Building Molden..."
  48. emake -j1 "${args[@]}"
  49. if use opengl ; then
  50. einfo "Building Molden OpenGL helper..."
  51. emake -j1 "${args[@]}" moldenogl
  52. fi
  53. }
  54. src_install() {
  55. dobin ${PN} g${PN} $(usex opengl ${PN}ogl "")
  56. dodoc HISTORY README REGISTER
  57. cd doc || die
  58. uncompress * && dodoc *
  59. }