| 1 | # Copyright 1999-2010 Gentoo Foundation |
1 | # Copyright 1999-2010 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.46 2010/12/29 17:06:51 tampakrap Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.50 2011/03/11 19:50:52 dilfridge Exp $ |
| 4 | # |
4 | # |
| 5 | # @ECLASS: kde4-meta.eclass |
5 | # @ECLASS: kde4-meta.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # kde@gentoo.org |
7 | # kde@gentoo.org |
| 8 | # @BLURB: Eclass for writing "split" KDE packages. |
8 | # @BLURB: Eclass for writing "split" KDE packages. |
| … | |
… | |
| 10 | # This eclass provides all necessary functions for writing split KDE ebuilds. |
10 | # This eclass provides all necessary functions for writing split KDE ebuilds. |
| 11 | # |
11 | # |
| 12 | # You must define KMNAME to use this eclass, and do so before inheriting it. All other variables are optional. |
12 | # You must define KMNAME to use this eclass, and do so before inheriting it. All other variables are optional. |
| 13 | # Do not include the same item in more than one of KMMODULE, KMMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY. |
13 | # Do not include the same item in more than one of KMMODULE, KMMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY. |
| 14 | |
14 | |
| 15 | inherit kde4-base versionator |
15 | inherit kde4-base toolchain-funcs versionator |
| 16 | |
16 | |
|
|
17 | case ${EAPI:-0} in |
|
|
18 | 3) |
| 17 | EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm |
19 | KDEMETA_EXPF="pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm" |
|
|
20 | ;; |
|
|
21 | *) |
|
|
22 | KDEMETA_EXPF="pkg_pretend pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm" |
|
|
23 | ;; |
|
|
24 | esac |
|
|
25 | EXPORT_FUNCTIONS ${KDEMETA_EXPF} |
| 18 | |
26 | |
| 19 | [[ -z ${KMNAME} ]] && die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild" |
27 | [[ -z ${KMNAME} ]] && die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild" |
| 20 | |
28 | |
| 21 | # Add dependencies that all packages in a certain module share. |
29 | # Add dependencies that all packages in a certain module share. |
| 22 | case ${KMNAME} in |
30 | case ${KMNAME} in |
| … | |
… | |
| 125 | # @ECLASS-VARIABLE: KMTARPARAMS |
133 | # @ECLASS-VARIABLE: KMTARPARAMS |
| 126 | # @DESCRIPTION: |
134 | # @DESCRIPTION: |
| 127 | # Specify extra parameters to pass to tar, in kde4-meta_src_extract. |
135 | # Specify extra parameters to pass to tar, in kde4-meta_src_extract. |
| 128 | # '-xpf -j' are passed to tar by default. |
136 | # '-xpf -j' are passed to tar by default. |
| 129 | |
137 | |
|
|
138 | # @FUNCTION: kde4-meta_pkg_pretend |
|
|
139 | # @DESCRIPTION: |
|
|
140 | # Currently only checks the gcc version. |
|
|
141 | kde4-meta_pkg_pretend() { |
|
|
142 | debug-print-function ${FUNCNAME} "$@" |
|
|
143 | |
|
|
144 | slot_is_at_least 4.6 ${SLOT} && ( [[ $(gcc-major-version) -lt 4 ]] || \ |
|
|
145 | ( [[ $(gcc-major-version) -eq 4 ]] && [[ $(gcc-minor-version) -le 3 ]] ) ) \ |
|
|
146 | && die "Sorry, but gcc-4.3 and earlier wont work for KDE SC 4.6 (see bug 354837)." |
|
|
147 | } |
|
|
148 | |
| 130 | # @FUNCTION: kde4-meta_pkg_setup |
149 | # @FUNCTION: kde4-meta_pkg_setup |
| 131 | # @DESCRIPTION: |
150 | # @DESCRIPTION: |
| 132 | # Currently just calls its equivalent in kde4-base.eclass(5). Use this one in |
151 | # Currently calls its equivalent in kde4-base.eclass(5) and checks the gcc version. |
| 133 | # split ebuilds. |
152 | # Use this one in split ebuilds. |
| 134 | kde4-meta_pkg_setup() { |
153 | kde4-meta_pkg_setup() { |
| 135 | debug-print-function ${FUNCNAME} "$@" |
154 | debug-print-function ${FUNCNAME} "$@" |
|
|
155 | |
|
|
156 | has pkg_pretend ${KDEMETA_EXPF} || kde4-meta_pkg_pretend |
| 136 | |
157 | |
| 137 | kde4-base_pkg_setup |
158 | kde4-base_pkg_setup |
| 138 | } |
159 | } |
| 139 | |
160 | |
| 140 | # @FUNCTION: kde4-meta_src_unpack |
161 | # @FUNCTION: kde4-meta_src_unpack |
| … | |
… | |
| 214 | esac |
235 | esac |
| 215 | case ${KMNAME} in |
236 | case ${KMNAME} in |
| 216 | kdebase-apps) |
237 | kdebase-apps) |
| 217 | # kdebase/apps -> kdebase-apps |
238 | # kdebase/apps -> kdebase-apps |
| 218 | tarball="kdebase-${PV}.tar.${postfix}" |
239 | tarball="kdebase-${PV}.tar.${postfix}" |
|
|
240 | case ${PV} in |
|
|
241 | 4.6.1) |
|
|
242 | ;; |
|
|
243 | *) |
| 219 | # Go one level deeper for kdebase-apps in tarballs |
244 | # Go one level deeper for kdebase-apps in tarballs |
| 220 | moduleprefix=apps/ |
245 | moduleprefix=apps/ |
| 221 | KMTARPARAMS+=" --transform=s|apps/||" |
246 | KMTARPARAMS+=" --transform=s|apps/||" |
|
|
247 | ;; |
|
|
248 | esac |
| 222 | ;; |
249 | ;; |
| 223 | kdepim) |
250 | kdepim) |
| 224 | if [[ ${PV} == 4.5.93 ]] ; then |
251 | if [[ ${PV} == 4.5.93 ]] ; then |
| 225 | tarball="kdepim-4.6beta3.tar.${postfix}" |
252 | tarball="kdepim-4.6beta3.tar.${postfix}" |
|
|
253 | else |
|
|
254 | tarball="${KMNAME}-${PV}.tar.${postfix}" |
| 226 | fi |
255 | fi |
| 227 | ;; |
256 | ;; |
| 228 | *) |
257 | *) |
| 229 | # Create tarball name from module name (this is the default) |
258 | # Create tarball name from module name (this is the default) |
| 230 | tarball="${KMNAME}-${PV}.tar.${postfix}" |
259 | tarball="${KMNAME}-${PV}.tar.${postfix}" |
| … | |
… | |
| 249 | done |
278 | done |
| 250 | extractlist+=" $(__list_needed_subdirectories)" |
279 | extractlist+=" $(__list_needed_subdirectories)" |
| 251 | |
280 | |
| 252 | pushd "${WORKDIR}" > /dev/null |
281 | pushd "${WORKDIR}" > /dev/null |
| 253 | [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} |
282 | [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} |
|
|
283 | if [[ ${I_KNOW_WHAT_I_AM_DOING} ]]; then |
|
|
284 | # to make the devs happy - bug 338397 |
| 254 | tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} || ewarn "tar extract command failed at least partially - continuing anyway" |
285 | tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} || ewarn "tar extract command failed at least partially - continuing anyway" |
|
|
286 | else |
|
|
287 | tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null || echo "tar extract command failed at least partially - continuing anyway" |
|
|
288 | fi |
| 255 | |
289 | |
| 256 | # Default $S is based on $P; rename the extracted directory to match $S if necessary |
290 | # Default $S is based on $P; rename the extracted directory to match $S if necessary |
| 257 | mv ${topdir} ${P} || die "Died while moving \"${topdir}\" to \"${P}\"" |
291 | mv ${topdir} ${P} || die "Died while moving \"${topdir}\" to \"${P}\"" |
| 258 | |
292 | |
| 259 | popd > /dev/null |
293 | popd > /dev/null |
| … | |
… | |
| 303 | # Add some CMake-files to KMEXTRACTONLY. |
337 | # Add some CMake-files to KMEXTRACTONLY. |
| 304 | # Note that this actually doesn't include KMEXTRA handling. |
338 | # Note that this actually doesn't include KMEXTRA handling. |
| 305 | # In those cases you should care to add the relevant files to KMEXTRACTONLY |
339 | # In those cases you should care to add the relevant files to KMEXTRACTONLY |
| 306 | case ${KMNAME} in |
340 | case ${KMNAME} in |
| 307 | kdebase) |
341 | kdebase) |
|
|
342 | case ${PV} in |
|
|
343 | 4.6.1) |
| 308 | KMEXTRACTONLY+=" |
344 | KMEXTRACTONLY+=" |
|
|
345 | config-apps.h.cmake |
|
|
346 | ConfigureChecks.cmake" |
|
|
347 | ;; |
|
|
348 | *) |
|
|
349 | KMEXTRACTONLY+=" |
| 309 | apps/config-apps.h.cmake |
350 | apps/config-apps.h.cmake |
| 310 | apps/ConfigureChecks.cmake" |
351 | apps/ConfigureChecks.cmake" |
|
|
352 | ;; |
|
|
353 | esac |
| 311 | ;; |
354 | ;; |
| 312 | kdebase-apps) |
355 | kdebase-apps) |
| 313 | KMEXTRACTONLY+=" |
356 | KMEXTRACTONLY+=" |
| 314 | config-apps.h.cmake |
357 | config-apps.h.cmake |
| 315 | ConfigureChecks.cmake" |
358 | ConfigureChecks.cmake" |