dev-qt/qttest: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / eclass / emboss-r2.eclass
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 # @ECLASS: emboss-r2.eclass
5 # @MAINTAINER:
6 # sci-biology@gentoo.org
7 # jlec@gentoo.org
8 # ted.tanberry@gmail.com
9 # @AUTHOR:
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 # @SUPPORTED_EAPIS: 6
14 # @BLURB: Use this to easy install EMBOSS and EMBASSY programs (EMBOSS add-ons).
15 # @DESCRIPTION:
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").
19 #
20 # Example:
21 #
22 # EAPI=6
23 #
24 # EBO_DESCRIPTION="applications from the CBS group"
25 #
26 # inherit emboss-r2
27
28 # @ECLASS-VARIABLE: EBO_DESCRIPTION
29 # @DEFAULT_UNSET
30 # @DESCRIPTION:
31 # Should be set. Completes the generic description of the embassy module as follows:
32 #
33 # EMBOSS integrated version of ${EBO_DESCRIPTION}, e.g.
34 #
35 # "EMBOSS integrated version of applications from the CBS group"
36 #
37 # Defaults to the upstream name of the module.
38
39 if [[ ! ${_EMBOSS_R2} ]]; then
40
41 case ${EAPI:-0} in
42         6) ;;
43         *) die "EAPI=${EAPI} is not supported" ;;
44 esac
45
46 inherit autotools flag-o-matic
47
48 EXPORT_FUNCTIONS src_prepare src_configure src_install
49
50 HOMEPAGE="http://emboss.sourceforge.net/"
51 LICENSE="LGPL-2 GPL-2"
52
53 SLOT="0"
54 IUSE="mysql pdf png postgres static-libs X"
55
56 RDEPEND="
57         dev-libs/expat
58         dev-libs/libpcre:3
59         sci-libs/plplot:=
60         sys-libs/zlib
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 )"
66
67 if [[ ${PN} == embassy-* ]]; then
68         EMBASSY_PACKAGE=yes
69         # The EMBASSY package name, retrieved from the inheriting ebuild's name
70         EN=${PN:8}
71         # The full name and version of the EMBASSY package (excluding the Gentoo
72         # revision number)
73         EF="${EN^^}-${PV}"
74
75         [[ ${EBO_DESCRIPTION} ]] || die "EBO_DESCRIPTION was not set before inheriting emboss-r2.eclass"
76
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=]"
80
81         S="${WORKDIR}/${EF}"
82 fi
83
84 DEPEND="${RDEPEND}"
85
86 # @ECLASS-VARIABLE: EBO_EAUTORECONF
87 # @DEFAULT_UNSET
88 # @DESCRIPTION:
89 # If set, run eautoreconf from autotools.eclass after applying patches
90 # in emboss-r2_src_prepare.
91
92 # @FUNCTION: emboss-r2_src_prepare
93 # @DESCRIPTION:
94 # Does the following things
95 #
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
100 #
101
102 emboss-r2_src_prepare() {
103         if [[ -e configure.in ]]; then
104                 mv configure.{in,ac} || die
105         fi
106
107         default
108         [[ ${EBO_EAUTORECONF} ]] && eautoreconf
109 }
110
111 # @FUNCTION: emboss-r2_src_configure
112 # @DESCRIPTION:
113 # runs econf with following options.
114 #
115 #  --enable-shared
116 #  $(use_enable static-libs static)
117 #  $(use_with X x)
118 #  $(use_with png pngdriver)
119 #  $(use_with pdf hpdf)
120 #  $(use_with mysql mysql)
121 #  $(use_with postgres postgresql)
122 #  --enable-large
123 #  --without-java
124 #  --enable-systemlibs
125 #
126 #  can be appended to like econf, e.g.
127 #    emboss-r2_src_configure --disable-shared
128
129 emboss-r2_src_configure() {
130         local myconf=(
131                 --enable-shared
132                 $(use_enable static-libs static)
133                 $(use_with X x)
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")
138                 --enable-large
139                 --without-java
140                 --enable-systemlibs
141         )
142
143         [[ ${EMBASSY_PACKAGE} == yes ]] && \
144                 append-cppflags "-I${EPREFIX}/usr/include/emboss"
145
146         econf "${myconf[@]}" "$@"
147 }
148
149 # @FUNCTION: emboss-r2_src_install
150 # @DESCRIPTION:
151 # Installs the package into the staging area and removes
152 # extraneous .la files, if USE="-static-libs"
153
154 emboss-r2_src_install() {
155         default
156
157         # delete .la files
158         if ! use static-libs; then
159                 find "${D}" -name '*.la' -delete || die
160         fi
161 }
162
163 _EMBOSS_R2=1
164 fi