1 |
commit: ef2109df4cd719ce0d14760b5df18a825772d71f |
2 |
Author: Davide Pesavento <davidepesa <AT> gmail <DOT> com> |
3 |
AuthorDate: Mon May 21 23:27:38 2012 +0000 |
4 |
Commit: Davide Pesavento <pesa <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon May 21 23:27:38 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/qt.git;a=commit;h=ef2109df |
7 |
|
8 |
[qt4-r2.eclass] Improvements to qt4-r2_src_install(). |
9 |
|
10 |
Allow DOCS to be an array variable, add support for HTML_DOCS. The |
11 |
implementation is mostly copied from cmake-utils and base eclasses. |
12 |
Remove support for DOCSDIR (used by only 2 ebuilds in the tree). |
13 |
Improve variables documentation. |
14 |
|
15 |
--- |
16 |
eclass/qt4-r2.eclass | 83 +++++++++++++++++++++++++++---------------------- |
17 |
1 files changed, 46 insertions(+), 37 deletions(-) |
18 |
|
19 |
diff --git a/eclass/qt4-r2.eclass b/eclass/qt4-r2.eclass |
20 |
index c8b007d..362ceaf 100644 |
21 |
--- a/eclass/qt4-r2.eclass |
22 |
+++ b/eclass/qt4-r2.eclass |
23 |
@@ -19,16 +19,30 @@ inherit base eutils multilib toolchain-funcs |
24 |
|
25 |
export XDG_CONFIG_HOME="${T}" |
26 |
|
27 |
+# @ECLASS-VARIABLE: DOCS |
28 |
+# @DEFAULT_UNSET |
29 |
+# @DESCRIPTION: |
30 |
+# Array containing documents passed to dodoc command. |
31 |
+# Paths can be absolute or relative to ${S}. |
32 |
+# |
33 |
+# Example: DOCS=( ChangeLog README "${WORKDIR}/doc_folder/" ) |
34 |
+ |
35 |
+# @ECLASS-VARIABLE: HTML_DOCS |
36 |
+# @DEFAULT_UNSET |
37 |
+# @DESCRIPTION: |
38 |
+# Array containing documents passed to dohtml command. |
39 |
+# Paths can be absolute or relative to ${S}. |
40 |
+# |
41 |
+# Example: HTML_DOCS=( "doc/document.html" "${WORKDIR}/html_folder/" ) |
42 |
+ |
43 |
# @ECLASS-VARIABLE: LANGS |
44 |
# @DEFAULT_UNSET |
45 |
# @DESCRIPTION: |
46 |
# In case your Qt4 application provides various translations, use this variable |
47 |
# to specify them in order to populate "linguas_*" IUSE automatically. Make sure |
48 |
# that you set this variable before inheriting qt4-r2 eclass. |
49 |
-# Example: |
50 |
-# @CODE |
51 |
-# LANGS="en el de" |
52 |
-# @CODE |
53 |
+# |
54 |
+# Example: LANGS="de el it ja" |
55 |
for x in ${LANGS}; do |
56 |
IUSE+=" linguas_${x}" |
57 |
done |
58 |
@@ -36,14 +50,31 @@ done |
59 |
# @ECLASS-VARIABLE: LANGSLONG |
60 |
# @DEFAULT_UNSET |
61 |
# @DESCRIPTION: |
62 |
-# Same as above, but this variable is for LINGUAS that must be in long format. |
63 |
+# Same as LANGS, but this variable is for LINGUAS that must be in long format. |
64 |
# Remember to set this variable before inheriting qt4-r2 eclass. |
65 |
# Look at ${PORTDIR}/profiles/desc/linguas.desc for details. |
66 |
+# |
67 |
+# Example: LANGSLONG="en_GB ru_RU" |
68 |
for x in ${LANGSLONG}; do |
69 |
IUSE+=" linguas_${x%_*}" |
70 |
done |
71 |
unset x |
72 |
|
73 |
+# @ECLASS-VARIABLE: PATCHES |
74 |
+# @DEFAULT_UNSET |
75 |
+# @DESCRIPTION: |
76 |
+# Array variable containing all the patches to be applied. This variable |
77 |
+# is expected to be defined in the global scope of ebuilds. Make sure to |
78 |
+# specify the full path. This variable is used in src_prepare phase. |
79 |
+# |
80 |
+# Example: |
81 |
+# @CODE |
82 |
+# PATCHES=( |
83 |
+# "${FILESDIR}/mypatch.patch" |
84 |
+# "${FILESDIR}/patches_folder/" |
85 |
+# ) |
86 |
+# @CODE |
87 |
+ |
88 |
# @FUNCTION: qt4-r2_src_unpack |
89 |
# @DESCRIPTION: |
90 |
# Default src_unpack function for packages that depend on qt4. If you have to |
91 |
@@ -64,17 +95,6 @@ qt4-r2_src_unpack() { |
92 |
base_src_unpack "$@" |
93 |
} |
94 |
|
95 |
-# @ECLASS-VARIABLE: PATCHES |
96 |
-# @DEFAULT_UNSET |
97 |
-# @DESCRIPTION: |
98 |
-# In case you have patches to apply, specify them here. Make sure to |
99 |
-# specify the full path. This variable is used in src_prepare phase. |
100 |
-# Example: |
101 |
-# @CODE |
102 |
-# PATCHES=( "${FILESDIR}"/mypatch.patch |
103 |
-# "${FILESDIR}"/mypatch2.patch ) |
104 |
-# @CODE |
105 |
- |
106 |
# @FUNCTION: qt4-r2_src_prepare |
107 |
# @DESCRIPTION: |
108 |
# Default src_prepare function for packages that depend on qt4. If you have to |
109 |
@@ -113,34 +133,23 @@ qt4-r2_src_compile() { |
110 |
base_src_compile "$@" |
111 |
} |
112 |
|
113 |
-# @ECLASS-VARIABLE: DOCS |
114 |
-# @DEFAULT_UNSET |
115 |
-# @DESCRIPTION: |
116 |
-# Use this variable if you want to install any documentation. |
117 |
-# Example: |
118 |
-# @CODE |
119 |
-# DOCS="README AUTHORS" |
120 |
-# @CODE |
121 |
- |
122 |
-# @ECLASS-VARIABLE: DOCSDIR |
123 |
-# @DESCRIPTION: |
124 |
-# Directory containing documentation, defaults to ${S}. |
125 |
- |
126 |
# @FUNCTION: qt4-r2_src_install |
127 |
# @DESCRIPTION: |
128 |
# Default src_install function for qt4-based packages. Installs compiled code, |
129 |
-# documentation (via DOCS variable) and translations (via LANGS and |
130 |
-# LANGSLONG variables). |
131 |
+# documentation (via DOCS and HTML_DOCS variables) and translations (via LANGS |
132 |
+# and LANGSLONG variables). |
133 |
qt4-r2_src_install() { |
134 |
debug-print-function $FUNCNAME "$@" |
135 |
|
136 |
- emake INSTALL_ROOT="${D}" DESTDIR="${D}" install || die "emake install failed" |
137 |
+ base_src_install INSTALL_ROOT="${D}" "$@" |
138 |
|
139 |
- # install documentation |
140 |
- local doc= dir=${DOCSDIR:-${S}} |
141 |
- for doc in ${DOCS}; do |
142 |
- dodoc "${dir}/${doc}" || die "dodoc failed" |
143 |
- done |
144 |
+ # backward compatibility for non-array variables |
145 |
+ if [[ -n ${DOCS} ]] && [[ "$(declare -p DOCS 2>/dev/null 2>&1)" != "declare -a"* ]]; then |
146 |
+ dodoc ${DOCS} || die "dodoc failed" |
147 |
+ fi |
148 |
+ if [[ -n ${HTML_DOCS} ]] && [[ "$(declare -p HTML_DOCS 2>/dev/null 2>&1)" != "declare -a"* ]]; then |
149 |
+ dohtml -r ${HTML_DOCS} || die "dohtml failed" |
150 |
+ fi |
151 |
|
152 |
# install translations |
153 |
# need to have specified LANGS or LANGSLONG for this to work |