viewmol-2.4.1-r3.ebuild 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. PYTHON_COMPAT=( python2_7 )
  5. PYTHON_REQ_USE="tk(-)"
  6. inherit prefix python-single-r1 toolchain-funcs
  7. DESCRIPTION="Open-source graphical front end for computational chemistry programs"
  8. HOMEPAGE="http://viewmol.sourceforge.net/"
  9. SRC_URI="mirror://sourceforge/viewmol/${P}.src.tgz"
  10. LICENSE="GPL-2"
  11. SLOT="0"
  12. KEYWORDS="~amd64 ~x86"
  13. IUSE=""
  14. REQUIRED_USE="${PYTHON_REQUIRED_USE}"
  15. RDEPEND="
  16. media-libs/libpng:0=
  17. media-libs/tiff:0
  18. virtual/glu
  19. virtual/opengl
  20. x11-libs/libX11
  21. x11-libs/libXi
  22. x11-libs/libXmu
  23. x11-libs/libXt
  24. x11-libs/motif:0
  25. ${PYTHON_DEPS}"
  26. DEPEND="${RDEPEND}
  27. x11-proto/inputproto
  28. x11-proto/xproto"
  29. S="${WORKDIR}/${P}/source"
  30. PATCHES=(
  31. "${FILESDIR}"/${PV}-remove-icc-check.patch
  32. "${FILESDIR}"/${PV}-change-default-paths.patch
  33. )
  34. src_prepare() {
  35. default
  36. eprefixify getrc.c
  37. sed "s:GENTOOLIBDIR:$(get_libdir):g" -i install getrc.c || die
  38. sed "s:GENTOODOCDIR:${PF}:g" -i install || die
  39. mkdir "$(uname -s)" || die
  40. cd "$(uname -s)" || die
  41. cat >> ".config.$(uname -s)" <<- EOF || die
  42. LIBTIFF = -L"${EPREFIX}/usr/$(get_libdir)"
  43. TIFFINCLUDE = "${EPREFIX}/usr/include"
  44. LIBPNG = -L"${EPREFIX}/usr/$(get_libdir)"
  45. PNGINCLUDE = "${EPREFIX}/usr/include"
  46. PYTHONVERSION = ${EPYTHON}
  47. PYTHONINCLUDE = $(python_get_CFLAGS)
  48. PYTHONLIB = $(python_get_LIBS)
  49. COMPILER = $(tc-getCC)
  50. CFLAGS = ${CFLAGS} -DLINUX
  51. LDFLAGS = ${LDFLAGS}
  52. SCANDIR=
  53. INCLUDE=\$(TIFFINCLUDE) -I\$(PNGINCLUDE) \$(PYTHONINCLUDE)
  54. LIBRARY=\$(LIBTIFF) \$(LIBPNG) \$(PYTHONLIB)
  55. LIBS=-L"${EPREFIX}/usr/$(get_libdir)" -ltiff -lpng -lz -lGLU -lGL -L"${EPREFIX}/usr/X11R6/lib" -lXm -lXmu -lXp -lXi -lXext -lXt -lX11 -lpthread -lutil -ldl -lm
  56. EOF
  57. cp .config.$(uname -s) makefile || die
  58. cat ../Makefile >> makefile || die
  59. }
  60. src_compile() {
  61. emake -C "$(uname -s)" viewmol_ tm_ bio_ readgamess_ readgauss_ readmopac_ readpdb_
  62. "${EPREFIX}"/bin/bash makeTranslations || die
  63. }
  64. src_install() {
  65. ./install "${ED%/}"/usr || die
  66. # fix broken layout
  67. mv "${ED%/}"/usr/{usr/share,} || die
  68. rm -rf "${ED%/}"/usr/usr || die
  69. mv "${ED%/}"/usr/{$(get_libdir)/${PN}/locale,share} || die
  70. mv "${ED%/}"/usr/{$(get_libdir),libexec} || die
  71. }