coot-0.8.2-r1.ebuild 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. PYTHON_COMPAT=( python2_7 )
  5. AUTOTOOLS_AUTORECONF="true"
  6. inherit autotools-utils python-single-r1 toolchain-funcs versionator
  7. MY_S2_PV=$(replace_version_separator 2 - ${PV})
  8. MY_S2_P=${PN}-${MY_S2_PV/pre1/pre-1}
  9. MY_S_P=${MY_S2_P}-${PR/r/revision-}
  10. MY_PV=${PV}
  11. MY_P=${PN}-${MY_PV}
  12. DESCRIPTION="Crystallographic Object-Oriented Toolkit"
  13. HOMEPAGE="https://www2.mrc-lmb.cam.ac.uk/Personal/pemsley/coot/"
  14. SRC_URI="
  15. http://www2.mrc-lmb.cam.ac.uk/Personal/pemsley/coot/source/releases/${MY_P}.tar.gz
  16. test? ( https://www2.mrc-lmb.cam.ac.uk/Personal/pemsley/coot/data/greg-data.tar.gz -> ${P}-greg-data.tar.gz )"
  17. SLOT="0"
  18. LICENSE="GPL-3"
  19. KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
  20. IUSE="+openmp static-libs test"
  21. REQUIRED_USE="${PYTHON_REQUIRED_USE}"
  22. AUTOTOOLS_IN_SOURCE_BUILD=1
  23. SCIDEPS="
  24. sci-libs/libccp4
  25. sci-libs/clipper
  26. >=sci-libs/coot-data-2
  27. >=sci-libs/gsl-1.3
  28. sci-libs/fftw:2.1=
  29. sci-libs/mmdb:2
  30. sci-libs/monomer-db
  31. sci-libs/ssm
  32. sci-chemistry/reduce
  33. sci-chemistry/probe"
  34. XDEPS="
  35. gnome-base/libgnomecanvas
  36. gnome-base/librsvg:2
  37. media-libs/libpng:0=
  38. media-libs/freeglut
  39. x11-libs/gtk+:2
  40. x11-libs/goocanvas:0
  41. x11-libs/gtkglext
  42. virtual/opengl"
  43. SCHEMEDEPS="
  44. <dev-scheme/guile-2
  45. dev-scheme/net-http
  46. dev-scheme/guile-gui
  47. >=dev-scheme/guile-lib-0.1.6
  48. dev-scheme/guile-www
  49. >=x11-libs/guile-gtk-2.1"
  50. RDEPEND="
  51. ${SCIDEPS}
  52. ${XDEPS}
  53. ${SCHEMEDEPS}
  54. ${PYTHON_DEPS}
  55. dev-db/sqlite:3
  56. dev-libs/boost:0=[python,${PYTHON_USEDEP}]
  57. dev-libs/glib:2
  58. >=dev-libs/gmp-4.2.2-r2:0=
  59. dev-python/pygobject:2[${PYTHON_USEDEP}]
  60. dev-python/pygtk:2[${PYTHON_USEDEP}]
  61. >=net-misc/curl-7.19.6
  62. net-dns/libidn
  63. sys-libs/readline:0=
  64. "
  65. DEPEND="${RDEPEND}
  66. virtual/pkgconfig
  67. >=sys-devel/libtool-2.4-r2
  68. dev-lang/swig
  69. sys-devel/bc
  70. test? ( dev-scheme/greg )"
  71. S="${WORKDIR}/${MY_P}"
  72. pkg_setup() {
  73. if use openmp; then
  74. tc-has-openmp || die "Please use an OPENMP capable compiler"
  75. fi
  76. python-single-r1_pkg_setup
  77. }
  78. PATCHES=(
  79. "${FILESDIR}"/${P}-desktop.patch
  80. "${FILESDIR}"/${P}-sandbox-icons.patch
  81. "${FILESDIR}"/${P}-libtool.patch
  82. "${FILESDIR}"/${P}-libguile.patch
  83. )
  84. src_unpack() {
  85. default
  86. if use test; then
  87. cd "${S}" || die
  88. ln -sf ../greg-data || die
  89. fi
  90. }
  91. src_prepare() {
  92. sed \
  93. -e '/export LD_LIBRARY/s:^:#:g' \
  94. -i src/coot.in || die
  95. sed \
  96. -e "s:AM_COOT_SYS_BUILD_TYPE:COOT_SYS_BUILD_TYPE=Gentoo-Linux-${EPYTHON}-gtk2 ; AC_MSG_RESULT([\$COOT_SYS_BUILD_TYPE]); AC_SUBST(COOT_SYS_BUILD_TYPE):g" \
  97. -i configure.ac || die
  98. autotools-utils_src_prepare
  99. }
  100. src_configure() {
  101. # All the --with's are used to activate various parts.
  102. # Yes, this is broken behavior.
  103. local myeconfargs=(
  104. --with-goocanvas-prefix="${EPREFIX}/usr"
  105. --with-guile="${EPREFIX}/usr"
  106. --with-python="${EPREFIX}/usr"
  107. --with-guile-gtk
  108. --with-pygtk="${EPREFIX}/usr"
  109. --with-sqlite3
  110. --with-boost="${EPREFIX}/usr"
  111. )
  112. autotools-utils_src_configure
  113. }
  114. src_test() {
  115. source "${EPREFIX}/etc/profile.d/40ccp4.setup.sh"
  116. mkdir "${T}"/coot_test || die
  117. export COOT_STANDARD_RESIDUES="${S}/standard-residues.pdb"
  118. export COOT_SCHEME_DIR="${S}/scheme/"
  119. export COOT_RESOURCES_FILE="${S}/cootrc"
  120. export COOT_PIXMAPS_DIR="${S}/pixmaps/"
  121. export COOT_DATA_DIR="${S}/"
  122. export COOT_PYTHON_DIR="${S}/python/"
  123. export PYTHONPATH="${COOT_PYTHON_DIR}:${S}/src:${PYTHONPATH}"
  124. export PYTHONHOME="${EPREFIX}"/usr/
  125. export CCP4_SCR="${T}"/coot_test/
  126. export CLIBD_MON="${EPREFIX}/usr/share/data/monomers/"
  127. export COOT_REF_STRUCTS="${EPREFIX}/usr/share/data/monomers/"
  128. export SYMINFO="${S}/syminfo.lib"
  129. export COOT_TEST_DATA_DIR="${S}"/greg-data/
  130. cat > command-line-greg.scm <<- EOF
  131. (use-modules (ice-9 greg))
  132. (set! greg-tools (list "greg-tests"))
  133. (set! greg-debug #t)
  134. (set! greg-verbose 5)
  135. (let ((r (greg-test-run)))
  136. (if r
  137. (coot-real-exit 0)
  138. (coot-real-exit 1)))
  139. EOF
  140. einfo "Running test with following paths ..."
  141. einfo "COOT_STANDARD_RESIDUES $COOT_STANDARD_RESIDUES"
  142. einfo "COOT_SCHEME_DIR $COOT_SCHEME_DIR"
  143. einfo "COOT_RESOURCES_FILE $COOT_RESOURCES_FILE"
  144. einfo "COOT_PIXMAPS_DIR $COOT_PIXMAPS_DIR"
  145. einfo "COOT_DATA_DIR $COOT_DATA_DIR"
  146. einfo "COOT_PYTHON_DIR $COOT_PYTHON_DIR"
  147. einfo "PYTHONPATH $PYTHONPATH"
  148. einfo "PYTHONHOME $PYTHONHOME"
  149. einfo "CCP4_SCR ${CCP4_SCR}"
  150. einfo "CLIBD_MON ${CLIBD_MON}"
  151. einfo "SYMINFO ${SYMINFO}"
  152. "${S}"/src/coot-bin --no-graphics --script command-line-greg.scm || die
  153. "${S}"/src/coot-bin --no-graphics --script python-tests/coot_unittest.py || die
  154. }