emboss-r2.eclass 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # @ECLASS: emboss-r2.eclass
  4. # @MAINTAINER:
  5. # sci-biology@gentoo.org
  6. # jlec@gentoo.org
  7. # ted.tanberry@gmail.com
  8. # @AUTHOR:
  9. # Original author: Author Olivier Fisette <ofisette@gmail.com>
  10. # Next gen author: Justin Lecher <jlec@gentoo.org>
  11. # Next gen author: Ted Tanberry <ted.tanberry@gmail.com>
  12. # @BLURB: Use this to easy install EMBOSS and EMBASSY programs (EMBOSS add-ons).
  13. # @DESCRIPTION:
  14. # The inheriting ebuild must set at least EAPI=6 and provide EBO_DESCRIPTION before the inherit line.
  15. # KEYWORDS should be set. Additionally "(R|P)DEPEND"encies and other standard
  16. # ebuild variables can be extended (FOO+=" bar").
  17. #
  18. # Example:
  19. #
  20. # EAPI=6
  21. #
  22. # EBO_DESCRIPTION="applications from the CBS group"
  23. #
  24. # inherit emboss-r2
  25. # @ECLASS-VARIABLE: EBO_DESCRIPTION
  26. # @DEFAULT_UNSET
  27. # @DESCRIPTION:
  28. # Should be set. Completes the generic description of the embassy module as follows:
  29. #
  30. # EMBOSS integrated version of ${EBO_DESCRIPTION}, e.g.
  31. #
  32. # "EMBOSS integrated version of applications from the CBS group"
  33. #
  34. # Defaults to the upstream name of the module.
  35. if [[ ! ${_EMBOSS_R2} ]]; then
  36. case ${EAPI:-0} in
  37. 6) ;;
  38. *) die "EAPI=${EAPI} is not supported" ;;
  39. esac
  40. inherit autotools flag-o-matic
  41. EXPORT_FUNCTIONS src_prepare src_configure src_install
  42. HOMEPAGE="http://emboss.sourceforge.net/"
  43. LICENSE="LGPL-2 GPL-2"
  44. SLOT="0"
  45. IUSE="mysql pdf png postgres static-libs X"
  46. RDEPEND="
  47. dev-libs/expat
  48. dev-libs/libpcre:3
  49. sci-libs/plplot:=
  50. sys-libs/zlib
  51. mysql? ( virtual/mysql )
  52. pdf? ( media-libs/libharu:= )
  53. png? ( media-libs/gd:2=[png] )
  54. postgres? ( dev-db/postgresql:= )
  55. X? ( x11-libs/libXt )"
  56. if [[ ${PN} == embassy-* ]]; then
  57. EMBASSY_PACKAGE=yes
  58. # The EMBASSY package name, retrieved from the inheriting ebuild's name
  59. EN=${PN:8}
  60. # The full name and version of the EMBASSY package (excluding the Gentoo
  61. # revision number)
  62. EF="${EN^^}-${PV}"
  63. [[ ${EBO_DESCRIPTION} ]] || die "EBO_DESCRIPTION was not set before inheriting emboss-r2.eclass"
  64. DESCRIPTION="EMBOSS integrated version of ${EBO_DESCRIPTION}"
  65. SRC_URI="ftp://emboss.open-bio.org/pub/EMBOSS/${EF}.tar.gz -> embassy-${EN}-${PV}.tar.gz"
  66. RDEPEND+=" >=sci-biology/emboss-6.6.0-r1[mysql=,pdf=,png=,postgres=,static-libs=,X=]"
  67. S="${WORKDIR}/${EF}"
  68. fi
  69. DEPEND="${RDEPEND}"
  70. # @ECLASS-VARIABLE: EBO_EAUTORECONF
  71. # @DEFAULT_UNSET
  72. # @DESCRIPTION:
  73. # If set, run eautoreconf from autotools.eclass after applying patches
  74. # in emboss-r2_src_prepare.
  75. # @FUNCTION: emboss-r2_src_prepare
  76. # @DESCRIPTION:
  77. # Does the following things
  78. #
  79. # 1. Renames configure.in to configure.ac, if possible
  80. # 2. Calls default_src_prepare (i.e.
  81. # applies Gentoo and user patches in EAPI>=6)
  82. # 3. If EBO_EAUTORECONF is set, run eautoreconf
  83. #
  84. emboss-r2_src_prepare() {
  85. if [[ -e configure.in ]]; then
  86. mv configure.{in,ac} || die
  87. fi
  88. default
  89. [[ ${EBO_EAUTORECONF} ]] && eautoreconf
  90. }
  91. # @FUNCTION: emboss-r2_src_configure
  92. # @DESCRIPTION:
  93. # runs econf with following options.
  94. #
  95. # --enable-shared
  96. # $(use_enable static-libs static)
  97. # $(use_with X x)
  98. # $(use_with png pngdriver)
  99. # $(use_with pdf hpdf)
  100. # $(use_with mysql mysql)
  101. # $(use_with postgres postgresql)
  102. # --enable-large
  103. # --without-java
  104. # --enable-systemlibs
  105. #
  106. # can be appended to like econf, e.g.
  107. # emboss-r2_src_configure --disable-shared
  108. emboss-r2_src_configure() {
  109. local myconf=(
  110. --enable-shared
  111. $(use_enable static-libs static)
  112. $(use_with X x)
  113. $(use_with png pngdriver "${EPREFIX}/usr")
  114. $(use_with pdf hpdf "${EPREFIX}/usr")
  115. $(use_with mysql mysql "${EPREFIX}/usr/bin/mysql_config")
  116. $(use_with postgres postgresql "${EPREFIX}/usr/bin/pg_config")
  117. --enable-large
  118. --without-java
  119. --enable-systemlibs
  120. )
  121. [[ ${EMBASSY_PACKAGE} == yes ]] && \
  122. append-cppflags "-I${EPREFIX}/usr/include/emboss"
  123. econf "${myconf[@]}" "$@"
  124. }
  125. # @FUNCTION: emboss-r2_src_install
  126. # @DESCRIPTION:
  127. # Installs the package into the staging area and removes
  128. # extraneous .la files, if USE="-static-libs"
  129. emboss-r2_src_install() {
  130. default
  131. # delete .la files
  132. if ! use static-libs; then
  133. find "${D}" -name '*.la' -delete || die
  134. fi
  135. }
  136. _EMBOSS_R2=1
  137. fi