molmol-2k_p2-r2.ebuild 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. # Copyright 1999-2013 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=4
  4. inherit eutils multilib prefix toolchain-funcs
  5. MY_PV="${PV/_p/.}.0"
  6. MY_P="${PN}-${MY_PV}"
  7. DESCRIPTION="Publication-quality molecular visualization package"
  8. HOMEPAGE="http://hugin.ethz.ch/wuthrich/software/molmol/index.html"
  9. SRC_URI="
  10. ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-src.tar.gz
  11. ftp://ftp.mol.biol.ethz.ch/software/MOLMOL/unix-gzip/${MY_P}-doc.tar.gz"
  12. LICENSE="molmol"
  13. SLOT="0"
  14. KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux"
  15. IUSE=""
  16. DEPEND="
  17. || (
  18. ( media-libs/mesa
  19. x11-libs/libGLw )
  20. media-libs/mesa[motif] )
  21. media-libs/libpng:0
  22. media-libs/tiff:0
  23. sys-libs/zlib
  24. virtual/glu
  25. virtual/jpeg
  26. x11-libs/libXpm
  27. x11-libs/motif:0
  28. x11-apps/xdpyinfo"
  29. RDEPEND="${DEPEND}"
  30. S="${WORKDIR}"
  31. MAKEOPTS="${MAKEOPTS} -j1"
  32. pkg_setup() {
  33. MMDIR="/usr/$(get_libdir)/molmol"
  34. }
  35. src_prepare() {
  36. rm -rf tiff*
  37. # Patch from http://pjf.net/science/molmol.html, where src.rpm is provided
  38. epatch "${FILESDIR}"/pjf_RH9_molmol2k2.diff
  39. epatch "${FILESDIR}"/prefix.patch
  40. eprefixify molmol
  41. epatch "${FILESDIR}"/ldflags.patch
  42. ln -s makedef.lnx "${S}"/makedef || die
  43. sed \
  44. -e "s:/bin/ksh:${EPREFIX}/bin/sh:" \
  45. -e "s:^MOLMOLHOME.*:MOLMOLHOME=${EPREFIX}/${MMDIR}:" \
  46. -i "${S}"/molmol || die
  47. sed \
  48. -e "s:^MCFLAGS.*:MCFLAGS = ${CFLAGS}:" \
  49. -e "s:^CC.*:CC = $(tc-getCC):" \
  50. -i "${S}"/makedef || die
  51. epatch "${FILESDIR}"/cast.patch
  52. epatch "${FILESDIR}"/libpng15.patch
  53. }
  54. src_install() {
  55. dobin molmol
  56. exeinto ${MMDIR}
  57. newexe src/main/molmol molmol.lnx
  58. insinto ${MMDIR}
  59. doins -r auxil help macros man setup tips
  60. dodoc HISTORY README
  61. }