1 |
zlin 08/03/10 21:41:56 |
2 |
|
3 |
Modified: kde4-base.eclass |
4 |
Log: |
5 |
Add support for split qt-4.4. Add {CPPUNIT,OPENGL}_REQUIRED. Split out kde4-base_apply_patches(). |
6 |
|
7 |
Revision Changes Path |
8 |
1.4 eclass/kde4-base.eclass |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/kde4-base.eclass?rev=1.4&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/kde4-base.eclass?rev=1.4&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/kde4-base.eclass?r1=1.3&r2=1.4 |
13 |
|
14 |
Index: kde4-base.eclass |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v |
17 |
retrieving revision 1.3 |
18 |
retrieving revision 1.4 |
19 |
diff -u -r1.3 -r1.4 |
20 |
--- kde4-base.eclass 18 Feb 2008 17:00:32 -0000 1.3 |
21 |
+++ kde4-base.eclass 10 Mar 2008 21:41:56 -0000 1.4 |
22 |
@@ -1,6 +1,6 @@ |
23 |
# Copyright 2007-2008 Gentoo Foundation |
24 |
# Distributed under the terms of the GNU General Public License v2 |
25 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.3 2008/02/18 17:00:32 ingmar Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.4 2008/03/10 21:41:56 zlin Exp $ |
27 |
|
28 |
# @ECLASS: kde4-base.eclass |
29 |
# @MAINTAINER: |
30 |
@@ -17,7 +17,37 @@ |
31 |
|
32 |
EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_test src_install pkg_postinst pkg_postrm |
33 |
|
34 |
-COMMONDEPEND=">=x11-libs/qt-4.3.3:4" |
35 |
+COMMONDEPEND="|| ( ( |
36 |
+ x11-libs/qt-core:4 |
37 |
+ x11-libs/qt-gui:4 |
38 |
+ x11-libs/qt-qt3support:4 |
39 |
+ x11-libs/qt-svg:4 |
40 |
+ x11-libs/qt-test:4 ) |
41 |
+ >=x11-libs/qt-4.3.3:4 )" |
42 |
+ |
43 |
+# @ECLASS-VARIABLE: OPENGL_REQUIRED |
44 |
+# @DESCRIPTION: |
45 |
+# Is qt-opengl required? Possible values are 'always', 'optional' and 'never'. |
46 |
+# This variable must be set before inheriting any eclasses. Defaults to 'never'. |
47 |
+OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}" |
48 |
+ |
49 |
+OPENGLDEPEND="|| ( x11-libs/qt-opengl:4 |
50 |
+ >=x11-libs/qt-4.3.3:4 )" |
51 |
+case "${OPENGL_REQUIRED}" in |
52 |
+ always) |
53 |
+ COMMONDEPEND="${COMMONDEPEND} |
54 |
+ ${OPENGLDEPEND}" |
55 |
+ ;; |
56 |
+ optional) |
57 |
+ IUSE="${IUSE} opengl" |
58 |
+ COMMONDEPEND="${COMMONDEPEND} |
59 |
+ opengl? ( ${OPENGLDEPEND} )" |
60 |
+ ;; |
61 |
+ *) |
62 |
+ OPENGL_REQUIRED="never" |
63 |
+ ;; |
64 |
+esac |
65 |
+ |
66 |
DEPEND="${DEPEND} ${COMMONDEPEND} |
67 |
>=dev-util/cmake-2.4.7-r1 |
68 |
dev-util/pkgconfig |
69 |
@@ -25,10 +55,25 @@ |
70 |
x11-proto/xf86vidmodeproto" |
71 |
RDEPEND="${RDEPEND} ${COMMONDEPEND}" |
72 |
|
73 |
-if has test ${IUSE//+}; then |
74 |
+# @ECLASS-VARIABLE: CPPUNIT_REQUIRED |
75 |
+# @DESCRIPTION: |
76 |
+# Is cppunit required for tests? Possible values are 'always', 'optional' and 'never'. |
77 |
+# This variable must be set before inheriting any eclasses. Defaults to 'never'. |
78 |
+CPPUNIT_REQUIRED="${CPPUNIT_REQUIRED:-never}" |
79 |
+ |
80 |
+case "${CPPUNIT_REQUIRED}" in |
81 |
+ always) |
82 |
+ DEPEND="${DEPEND} dev-util/cppunit" |
83 |
+ ;; |
84 |
+ optional) |
85 |
+ IUSE="${IUSE} test" |
86 |
DEPEND="${DEPEND} |
87 |
test? ( dev-util/cppunit )" |
88 |
-fi |
89 |
+ ;; |
90 |
+ *) |
91 |
+ CPPUNIT_REQUIRED="never" |
92 |
+ ;; |
93 |
+esac |
94 |
|
95 |
# @ECLASS-VARIABLE: NEED_KDE |
96 |
# @DESCRIPTION: |
97 |
@@ -207,25 +252,44 @@ |
98 |
debug-print-function $FUNCNAME "$@" |
99 |
|
100 |
# KDE4 applications require qt4 compiled with USE="accessibility dbus gif jpeg png qt3support ssl zlib". |
101 |
- QT4_BUILT_WITH_USE_CHECK="${QT4_BUILT_WITH_USE_CHECK} accessibility dbus gif jpeg png qt3support ssl zlib" |
102 |
+ if has_version '<x11-libs/qt-4.4_alpha:4'; then |
103 |
+ QT4_BUILT_WITH_USE_CHECK="${QT4_BUILT_WITH_USE_CHECK} accessibility dbus gif jpeg png qt3support ssl zlib" |
104 |
+ else |
105 |
+ KDE4_BUILT_WITH_USE_CHECK="${KDE4_BUILT_WITH_USE_CHECK} |
106 |
+ x11-libs/qt-core qt3support ssl |
107 |
+ x11-libs/qt-gui accessibility dbus |
108 |
+ x11-libs/qt-qt3support accessibility" |
109 |
+ fi |
110 |
|
111 |
if has debug ${IUSE//+} && use debug; then |
112 |
- QT4_BUILT_WITH_USE_CHECK="${QT4_BUILT_WITH_USE_CHECK} debug" |
113 |
+ if has_version '<x11-libs/qt-4.4.0_alpha:4'; then |
114 |
+ QT4_BUILT_WITH_USE_CHECK="${QT4_BUILT_WITH_USE_CHECK} debug" |
115 |
+ else |
116 |
+ KDE4_BUILT_WITH_USE_CHECK="${KDE4_BUILT_WITH_USE_CHECK} |
117 |
+ x11-libs/qt-core:4 debug |
118 |
+ x11-libs/qt-gui:4 debug |
119 |
+ x11-libs/qt-qt3support:4 debug |
120 |
+ x11-libs/qt-svg:4 debug |
121 |
+ x11-libs/qt-test:4 debug" |
122 |
+ if [[ ${OPENGL_REQUIRED} == always ]] || has opengl ${IUSE//+} && use opengl; then |
123 |
+ KDE4_BUILT_WITH_USE_CHECK="${KDE4_BUILT_WITH_USE_CHECK} |
124 |
+ x11-libs/qt-opengl:4 debug" |
125 |
+ fi |
126 |
+ fi |
127 |
fi |
128 |
|
129 |
- if has opengl ${IUSE//+} && use opengl; then |
130 |
- QT4_BUILT_WITH_USE_CHECK="${QT4_BUILT_WITH_USE_CHECK} opengl" |
131 |
+ if [[ ${OPENGL_REQUIRED} == always ]] || has opengl ${IUSE//+} && use opengl; then |
132 |
+ if has_version '<x11-libs/qt-4.4.0_alpha:4'; then |
133 |
+ QT4_BUILT_WITH_USE_CHECK="${QT4_BUILT_WITH_USE_CHECK} opengl" |
134 |
+ fi |
135 |
fi |
136 |
|
137 |
kde4-functions_check_use |
138 |
} |
139 |
|
140 |
-# @FUNCTION: kde4-base_src_unpack |
141 |
+# @FUNCTION: kde4-base_apply_patches |
142 |
# @DESCRIPTION: |
143 |
-# This function unpacks the source tarballs for KDE4 applications. |
144 |
-# |
145 |
-# If no argument is passed to this function, then standard src_unpack is |
146 |
-# executed. Otherwise options are passed to base_src_unpack. |
147 |
+# This function applies patches. |
148 |
# |
149 |
# If the directory ${WORKDIR}/patches/ exists, we apply all patches in that |
150 |
# directory, provided they follow this format: |
151 |
@@ -243,33 +307,46 @@ |
152 |
# @CODE |
153 |
# |
154 |
# If ${PATCHES} is non-zero all patches in it gets applied. |
155 |
+kde4-base_apply_patches() { |
156 |
+ local _patchdir _packages _p |
157 |
+ _patchdir="${WORKDIR}/patches/" |
158 |
+ if [[ -d "${_patchdir}" ]]; then |
159 |
+ if is-parent-package ${CATEGORY}/${PN} ; then |
160 |
+ _packages="$(get-child-packages ${CATEGORY}/${PN})" |
161 |
+ _packages="${_packages//${CATEGORY}\//} ${PN}" |
162 |
+ else |
163 |
+ _packages="${PN}" |
164 |
+ fi |
165 |
+ for _p in ${_packages}; do |
166 |
+ PATCHES="${PATCHES} $(ls ${_patchdir}/${_p}-${PV}-*{diff,patch} 2>/dev/null)" |
167 |
+ if [[ -n "${KDEBASE}" ]]; then |
168 |
+ PATCHES="${PATCHES} $(ls ${_patchdir}/${_p}-${SLOT}-*{diff,patch} 2>/dev/null)" |
169 |
+ fi |
170 |
+ done |
171 |
+ fi |
172 |
+ [[ -n ${PATCHES} ]] && base_src_unpack autopatch |
173 |
+} |
174 |
+ |
175 |
+# @FUNCTION: kde4-base_src_unpack |
176 |
+# @DESCRIPTION: |
177 |
+# This function unpacks the source tarballs for KDE4 applications. |
178 |
+# |
179 |
+# If no argument is passed to this function, then standard src_unpack is |
180 |
+# executed. Otherwise options are passed to base_src_unpack. |
181 |
+# |
182 |
+# In addition it calls kde4-base_apply_patches when no arguments are passed to |
183 |
+# this function. |
184 |
kde4-base_src_unpack() { |
185 |
debug-print-function $FUNCNAME "$@" |
186 |
|
187 |
[[ -z "${KDE_S}" ]] && KDE_S="${S}" |
188 |
|
189 |
- local _patchdir _packages _p |
190 |
- _patchdir="${WORKDIR}/patches/" |
191 |
if [[ -z $* ]]; then |
192 |
# Unpack first and deal with KDE patches after examing possible patch sets. |
193 |
# To be picked up, patches need to conform to the guidelines stated before. |
194 |
# Monolithic ebuilds will use the split ebuild patches. |
195 |
[[ -d "${KDE_S}" ]] || unpack ${A} |
196 |
- if [[ -d "${_patchdir}" ]]; then |
197 |
- if is-parent-package ${CATEGORY}/${PN} ; then |
198 |
- _packages="$(get-child-packages ${CATEGORY}/${PN})" |
199 |
- _packages="${_packages//${CATEGORY}\//} ${PN}" |
200 |
- else |
201 |
- _packages="${PN}" |
202 |
- fi |
203 |
- for _p in ${_packages}; do |
204 |
- PATCHES="${PATCHES} $(ls ${_patchdir}/${_p}-${PV}-*{diff,patch} 2>/dev/null)" |
205 |
- if [[ -n "${KDEBASE}" ]]; then |
206 |
- PATCHES="${PATCHES} $(ls ${_patchdir}/${_p}-${SLOT}-*{diff,patch} 2>/dev/null)" |
207 |
- fi |
208 |
- done |
209 |
- fi |
210 |
- [[ -n ${PATCHES} ]] && base_src_unpack autopatch |
211 |
+ kde4-base_apply_patches |
212 |
else |
213 |
# Call base_src_unpack, which unpacks and patches |
214 |
# step by step transparently as defined in the ebuild. |
215 |
|
216 |
|
217 |
|
218 |
-- |
219 |
gentoo-commits@l.g.o mailing list |