1 # Copyright 1999-2019 Gentoo Authors
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>
14 # @BLURB: Use this to easy install EMBOSS and EMBASSY programs (EMBOSS add-ons).
16 # The inheriting ebuild must set at least EAPI=6 and provide EBO_DESCRIPTION before the inherit line.
17 # KEYWORDS should be set. Additionally "(R|P)DEPEND"encies and other standard
18 # ebuild variables can be extended (FOO+=" bar").
24 # EBO_DESCRIPTION="applications from the CBS group"
28 # @ECLASS-VARIABLE: EBO_DESCRIPTION
31 # Should be set. Completes the generic description of the embassy module as follows:
33 # EMBOSS integrated version of ${EBO_DESCRIPTION}, e.g.
35 # "EMBOSS integrated version of applications from the CBS group"
37 # Defaults to the upstream name of the module.
39 if [[ ! ${_EMBOSS_R2} ]]; then
43 *) die "EAPI=${EAPI} is not supported" ;;
46 inherit autotools flag-o-matic
48 EXPORT_FUNCTIONS src_prepare src_configure src_install
50 HOMEPAGE="http://emboss.sourceforge.net/"
51 LICENSE="LGPL-2 GPL-2"
54 IUSE="mysql pdf png postgres static-libs X"
61 mysql? ( dev-db/mysql-connector-c:0= )
62 pdf? ( media-libs/libharu:= )
63 png? ( media-libs/gd:2=[png] )
64 postgres? ( dev-db/postgresql:= )
65 X? ( x11-libs/libXt )"
67 if [[ ${PN} == embassy-* ]]; then
69 # The EMBASSY package name, retrieved from the inheriting ebuild's name
71 # The full name and version of the EMBASSY package (excluding the Gentoo
75 [[ ${EBO_DESCRIPTION} ]] || die "EBO_DESCRIPTION was not set before inheriting emboss-r2.eclass"
77 DESCRIPTION="EMBOSS integrated version of ${EBO_DESCRIPTION}"
78 SRC_URI="ftp://emboss.open-bio.org/pub/EMBOSS/${EF}.tar.gz -> embassy-${EN}-${PV}.tar.gz"
79 RDEPEND+=" >=sci-biology/emboss-6.6.0-r1[mysql=,pdf=,png=,postgres=,static-libs=,X=]"
86 # @ECLASS-VARIABLE: EBO_EAUTORECONF
89 # If set, run eautoreconf from autotools.eclass after applying patches
90 # in emboss-r2_src_prepare.
92 # @FUNCTION: emboss-r2_src_prepare
94 # Does the following things
96 # 1. Renames configure.in to configure.ac, if possible
97 # 2. Calls default_src_prepare (i.e.
98 # applies Gentoo and user patches in EAPI>=6)
99 # 3. If EBO_EAUTORECONF is set, run eautoreconf
102 emboss-r2_src_prepare() {
103 if [[ -e configure.in ]]; then
104 mv configure.{in,ac} || die
108 [[ ${EBO_EAUTORECONF} ]] && eautoreconf
111 # @FUNCTION: emboss-r2_src_configure
113 # runs econf with following options.
116 # $(use_enable static-libs static)
118 # $(use_with png pngdriver)
119 # $(use_with pdf hpdf)
120 # $(use_with mysql mysql)
121 # $(use_with postgres postgresql)
124 # --enable-systemlibs
126 # can be appended to like econf, e.g.
127 # emboss-r2_src_configure --disable-shared
129 emboss-r2_src_configure() {
132 $(use_enable static-libs static)
134 $(use_with png pngdriver "${EPREFIX}/usr")
135 $(use_with pdf hpdf "${EPREFIX}/usr")
136 $(use_with mysql mysql "${EPREFIX}/usr/bin/mysql_config")
137 $(use_with postgres postgresql "${EPREFIX}/usr/bin/pg_config")
143 [[ ${EMBASSY_PACKAGE} == yes ]] && \
144 append-cppflags "-I${EPREFIX}/usr/include/emboss"
146 econf "${myconf[@]}" "$@"
149 # @FUNCTION: emboss-r2_src_install
151 # Installs the package into the staging area and removes
152 # extraneous .la files, if USE="-static-libs"
154 emboss-r2_src_install() {
158 if ! use static-libs; then
159 find "${D}" -name '*.la' -delete || die