1 |
Dnia 2015-02-21, o godz. 15:46:31 |
2 |
"Justin Lecher (jlec)" <jlec@g.o> napisał(a): |
3 |
|
4 |
> # Copyright 1999-2015 Gentoo Foundation |
5 |
> # Distributed under the terms of the GNU General Public License v2 |
6 |
> # $Header: $ |
7 |
> |
8 |
> # @ECLASS: emboss-r1.eclass |
9 |
> # @MAINTAINER: |
10 |
> # sci-biology@g.o |
11 |
> # jlec@g.o |
12 |
> # ted.tanberry@×××××.com |
13 |
> # @AUTHOR: |
14 |
> # Original author: Author Olivier Fisette <ofisette@×××××.com> |
15 |
> # Next gen author: Justin Lecher <jlec@g.o> |
16 |
> # Next gen author: Ted Tanberry <ted.tanberry@×××××.com> |
17 |
> # @BLURB: Use this to easy install EMBOSS and EMBASSY programs (EMBOSS add-ons). |
18 |
> # @DESCRIPTION: |
19 |
> # The inheriting ebuild must set at least EAPI=5 and provide EBO_DESCRIPTION before the inherit line. |
20 |
> # KEYWORDS should be set. Additionally "(R|P)DEPEND"encies and other standard |
21 |
> # ebuild variables can be extended (FOO+=" bar"). |
22 |
> # |
23 |
> # Example: |
24 |
> # |
25 |
> # EAPI="5" |
26 |
> # |
27 |
> # EBO_DESCRIPTION="applications from the CBS group" |
28 |
> # |
29 |
> # inherit emboss-r1 |
30 |
> |
31 |
> # @ECLASS-VARIABLE: EBO_DESCRIPTION |
32 |
> # @DESCRIPTION: |
33 |
> # Should be set. Completes the generic description of the embassy module as follows: |
34 |
> # |
35 |
> # EMBOSS integrated version of ${EBO_DESCRIPTION}, |
36 |
> # e.g. |
37 |
> # "EMBOSS integrated version of applications from the CBS group" |
38 |
> # |
39 |
> # Defaults to the upstream name of the module. |
40 |
> |
41 |
> # @ECLASS-VARIABLE: EBO_EXTRA_ECONF |
42 |
> # @DEFAULT_UNSET |
43 |
> # @DESCRIPTION: |
44 |
> # Extra config options passed to econf, similar to EXTRA_ECONF. |
45 |
|
46 |
Similar as in how? That it must not be used in ebuilds but in make.conf? |
47 |
|
48 |
> |
49 |
> case ${EAPI:-0} in |
50 |
> 5) ;; |
51 |
> *) die "this eclass doesn't support < EAPI 5" ;; |
52 |
> esac |
53 |
> |
54 |
> if [[ -f "${FILESDIR}"/${P}_fix-build-system.patch ]]; then |
55 |
|
56 |
This looks terribly hacky. I'm not convinced you can rely on test like |
57 |
this working properly in all cases, and I'm pretty convinced it's |
58 |
a terribly unpredictable form of an API. |
59 |
|
60 |
> AUTOTOOLS_AUTORECONF=1 |
61 |
> fi |
62 |
> |
63 |
> inherit autotools-utils eutils flag-o-matic |
64 |
> |
65 |
> HOMEPAGE="http://emboss.sourceforge.net/" |
66 |
> LICENSE="LGPL-2 GPL-2" |
67 |
> |
68 |
> SLOT="0" |
69 |
> IUSE="mysql pdf png postgres static-libs X" |
70 |
> |
71 |
> DEPEND=" |
72 |
> dev-libs/expat |
73 |
> dev-libs/libpcre:3 |
74 |
> sci-libs/plplot |
75 |
> sys-libs/zlib |
76 |
> mysql? ( virtual/mysql ) |
77 |
> pdf? ( media-libs/libharu ) |
78 |
> png? ( media-libs/gd[png] ) |
79 |
> postgres? ( dev-db/postgresql:= ) |
80 |
> X? ( x11-libs/libXt )" |
81 |
> RDEPEND="${DEPEND}" |
82 |
> |
83 |
> if [[ ${PN} == embassy-* ]]; then |
84 |
> EMBASSY_PACKAGE=yes |
85 |
> # The EMBASSY package name, retrieved from the inheriting ebuild's name |
86 |
> EN=${PN:8} |
87 |
> # The full name and version of the EMBASSY package (excluding the Gentoo |
88 |
> # revision number) |
89 |
> EF=$(echo ${EN} | tr "[:lower:]" "[:upper:]")-${PV} |
90 |
|
91 |
I would prefer avoid calling external tools in global scope. But I think |
92 |
we scheduled the new bash version for EAPI 6... |
93 |
|
94 |
> : ${EBO_DESCRIPTION:=${EN}} |
95 |
> DESCRIPTION="EMBOSS integrated version of ${EBO_DESCRIPTION}" |
96 |
> SRC_URI="ftp://emboss.open-bio.org/pub/EMBOSS/${EF}.tar.gz -> embassy-${EN}-${PVR}.tar.gz" |
97 |
|
98 |
Why PVR? Why not just ${EF}? :P |
99 |
|
100 |
> DEPEND+=" >=sci-biology/emboss-6.6.0[mysql=,pdf=,png=,postgres=,static-libs=,X=]" |
101 |
> |
102 |
> S="${WORKDIR}"/${EF} |
103 |
> fi |
104 |
> |
105 |
> # @FUNCTION: emboss_src_prepare |
106 |
> # @DESCRIPTION: |
107 |
> # Does the following things |
108 |
> # |
109 |
> # 1. Patches with "${FILESDIR}"/${P}_fix-build-system.patch, if present, |
110 |
> # and eventually runs eautoreconf in autotools-utils |
111 |
> # 2. Patches with "${FILESDIR}"/${PF}.patch, if present |
112 |
|
113 |
Ugly API, I dare say. Prefer explicit. |
114 |
|
115 |
> # 3. Applies ${PATCHES[@]} via autotools-utils.eclass |
116 |
> # |
117 |
> |
118 |
> emboss-r1_src_prepare() { |
119 |
> if [[ -f "${FILESDIR}"/${P}_fix-build-system.patch ]]; then |
120 |
> mv configure.{in,ac} || die |
121 |
> epatch "${FILESDIR}"/${P}_fix-build-system.patch |
122 |
> fi |
123 |
> |
124 |
> [[ -f "${FILESDIR}"/${PF}.patch ]] && epatch "${FILESDIR}"/${PF}.patch |
125 |
> |
126 |
> autotools-utils_src_prepare |
127 |
> } |
128 |
> |
129 |
> # @FUNCTION: emboss_src_configure |
130 |
> # @DESCRIPTION: |
131 |
> # runs econf with following options. |
132 |
> # |
133 |
> # $(use_with X x) |
134 |
> # $(use_with png pngdriver) |
135 |
> # $(use_with pdf hpdf) |
136 |
> # $(use_with mysql mysql) |
137 |
> # $(use_with postgres postgresql) |
138 |
> # $(use_enable static-libs static) |
139 |
> # --enable-large |
140 |
> # --without-java |
141 |
> # --enable-systemlibs |
142 |
> # --docdir="${EPREFIX}/usr/share/doc/${PF}" |
143 |
> # ${EBO_EXTRA_ECONF} |
144 |
> |
145 |
> emboss-r1_src_configure() { |
146 |
> local myeconfargs=( |
147 |
> $(use_with X x) |
148 |
> $(use_with png pngdriver "${EPREFIX}/usr") |
149 |
> $(use_with pdf hpdf "${EPREFIX}/usr") |
150 |
> $(use_with mysql mysql "${EPREFIX}/usr/bin/mysql_config") |
151 |
> $(use_with postgres postgresql "${EPREFIX}/usr/bin/pg_config") |
152 |
> --enable-large |
153 |
> --without-java |
154 |
> --enable-systemlibs |
155 |
> --docdir="${EPREFIX}/usr/share/doc/${PF}" |
156 |
|
157 |
The eclass does --docdir. |
158 |
|
159 |
> ${EBO_EXTRA_ECONF} |
160 |
> ) |
161 |
> |
162 |
> [[ ${EMBASSY_PACKAGE} == yes ]] && \ |
163 |
> append-cppflags "-I${EPREFIX}/usr/include/emboss" |
164 |
> |
165 |
> autotools-utils_src_configure |
166 |
> } |
167 |
> |
168 |
> EXPORT_FUNCTIONS src_prepare src_configure |
169 |
|
170 |
-- |
171 |
Best regards, |
172 |
Michał Górny |