1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
4 # @ECLASS: emboss-r2.eclass
6 # sci-biology@gentoo.org
8 # ted.tanberry@gmail.com
10 # Original author: Author Olivier Fisette <ofisette@gmail.com>
11 # Next gen author: Justin Lecher <jlec@gentoo.org>
12 # Next gen author: Ted Tanberry <ted.tanberry@gmail.com>
13 # @BLURB: Use this to easy install EMBOSS and EMBASSY programs (EMBOSS add-ons).
15 # The inheriting ebuild must set at least EAPI=6 and provide EBO_DESCRIPTION before the inherit line.
16 # KEYWORDS should be set. Additionally "(R|P)DEPEND"encies and other standard
17 # ebuild variables can be extended (FOO+=" bar").
23 # EBO_DESCRIPTION="applications from the CBS group"
27 # @ECLASS-VARIABLE: EBO_DESCRIPTION
30 # Should be set. Completes the generic description of the embassy module as follows:
32 # EMBOSS integrated version of ${EBO_DESCRIPTION}, e.g.
34 # "EMBOSS integrated version of applications from the CBS group"
36 # Defaults to the upstream name of the module.
38 if [[ ! ${_EMBOSS_R2} ]]; then
42 *) die "EAPI=${EAPI} is not supported" ;;
45 inherit autotools flag-o-matic
47 EXPORT_FUNCTIONS src_prepare src_configure src_install
49 HOMEPAGE="http://emboss.sourceforge.net/"
50 LICENSE="LGPL-2 GPL-2"
53 IUSE="mysql pdf png postgres static-libs X"
60 mysql? ( virtual/mysql )
61 pdf? ( media-libs/libharu:= )
62 png? ( media-libs/gd:2=[png] )
63 postgres? ( dev-db/postgresql:= )
64 X? ( x11-libs/libXt )"
66 if [[ ${PN} == embassy-* ]]; then
68 # The EMBASSY package name, retrieved from the inheriting ebuild's name
70 # The full name and version of the EMBASSY package (excluding the Gentoo
74 [[ ${EBO_DESCRIPTION} ]] || die "EBO_DESCRIPTION was not set before inheriting emboss-r2.eclass"
76 DESCRIPTION="EMBOSS integrated version of ${EBO_DESCRIPTION}"
77 SRC_URI="ftp://emboss.open-bio.org/pub/EMBOSS/${EF}.tar.gz -> embassy-${EN}-${PV}.tar.gz"
78 RDEPEND+=" >=sci-biology/emboss-6.6.0-r1[mysql=,pdf=,png=,postgres=,static-libs=,X=]"
85 # @ECLASS-VARIABLE: EBO_EAUTORECONF
88 # If set, run eautoreconf from autotools.eclass after applying patches
89 # in emboss-r2_src_prepare.
91 # @FUNCTION: emboss-r2_src_prepare
93 # Does the following things
95 # 1. Renames configure.in to configure.ac, if possible
96 # 2. Calls default_src_prepare (i.e.
97 # applies Gentoo and user patches in EAPI>=6)
98 # 3. If EBO_EAUTORECONF is set, run eautoreconf
101 emboss-r2_src_prepare() {
102 if [[ -e configure.in ]]; then
103 mv configure.{in,ac} || die
107 [[ ${EBO_EAUTORECONF} ]] && eautoreconf
110 # @FUNCTION: emboss-r2_src_configure
112 # runs econf with following options.
115 # $(use_enable static-libs static)
117 # $(use_with png pngdriver)
118 # $(use_with pdf hpdf)
119 # $(use_with mysql mysql)
120 # $(use_with postgres postgresql)
123 # --enable-systemlibs
125 # can be appended to like econf, e.g.
126 # emboss-r2_src_configure --disable-shared
128 emboss-r2_src_configure() {
131 $(use_enable static-libs static)
133 $(use_with png pngdriver "${EPREFIX}/usr")
134 $(use_with pdf hpdf "${EPREFIX}/usr")
135 $(use_with mysql mysql "${EPREFIX}/usr/bin/mysql_config")
136 $(use_with postgres postgresql "${EPREFIX}/usr/bin/pg_config")
142 [[ ${EMBASSY_PACKAGE} == yes ]] && \
143 append-cppflags "-I${EPREFIX}/usr/include/emboss"
145 econf "${myconf[@]}" "$@"
148 # @FUNCTION: emboss-r2_src_install
150 # Installs the package into the staging area and removes
151 # extraneous .la files, if USE="-static-libs"
153 emboss-r2_src_install() {
157 if ! use static-libs; then
158 find "${D}" -name '*.la' -delete || die