/[gentoo-x86]/eclass/kde4-meta.eclass
Gentoo

Contents of /eclass/kde4-meta.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.28 - (hide annotations) (download)
Tue Dec 1 10:56:17 2009 UTC (4 years, 9 months ago) by scarabeus
Branch: MAIN
Changes since 1.27: +5 -19 lines
Update kde4 eclasses from overlay:
Changes:
kde-functions
	Update the block resolving case to make it simpler.
kde-meta
	Drop not required elogs.
	Drop redundant dependencies.
kde-base
	introduce kdeenablefinal useflag (masked).
	support unpacking of xz tarballs in eapi2.

1 scarabeus 1.11 # Copyright 1999-2009 Gentoo Foundation
2 ingmar 1.1 # Distributed under the terms of the GNU General Public License v2
3 scarabeus 1.19 # $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.18 2009/05/09 13:23:15 scarabeus Exp $
4 ingmar 1.1 #
5     # @ECLASS: kde4-meta.eclass
6     # @MAINTAINER:
7     # kde@gentoo.org
8     # @BLURB: Eclass for writing "split" KDE packages.
9     # @DESCRIPTION:
10     # This eclass provides all necessary functions for writing split KDE ebuilds.
11     #
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.
14    
15 scarabeus 1.9 inherit kde4-base versionator
16 ingmar 1.1
17 scarabeus 1.9 EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm
18 ingmar 1.1
19     if [[ -z ${KMNAME} ]]; then
20     die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild"
21     fi
22    
23     # Add dependencies that all packages in a certain module share.
24     case ${KMNAME} in
25 scarabeus 1.22 kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphics)
26 wired 1.23 COMMONDEPEND+=" >=kde-base/qimageblitz-0.0.4"
27 scarabeus 1.12 ;;
28 wired 1.23 kdepim|kdepim-runtime)
29 scarabeus 1.28 COMMONDEPEND+=" $(add_kdebase_dep kdepimlibs)"
30 ingmar 1.1 case ${PN} in
31 scarabeus 1.22 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker)
32 wired 1.23 IUSE+=" +kontact"
33 alexxy 1.26 if ! slot_is_at_least 4.4 ${SLOT} || [[ ${SLOT} == 4.4 && ${PV} < 4.3.68 ]]; then
34 scarabeus 1.27 RDEPEND+=" kontact? ( $(add_kdebase_dep kontactinterfaces) )"
35 alexxy 1.26 fi
36 scarabeus 1.9 ;;
37 ingmar 1.1 esac
38 scarabeus 1.9 ;;
39 ingmar 1.1 kdegames)
40 scarabeus 1.11 if [[ ${PN} != libkdegames ]]; then
41 scarabeus 1.27 COMMONDEPEND+=" $(add_kdebase_dep libkdegames)"
42 ingmar 1.1 fi
43 scarabeus 1.9 ;;
44 ingmar 1.1 koffice)
45 wired 1.23 [[ ${PN} != koffice-data ]] && IUSE+=" debug"
46     RDEPEND+="
47 scarabeus 1.19 !app-office/${PN}:0
48     !app-office/koffice:0
49     !app-office/koffice-meta:0
50 scarabeus 1.17 "
51 dagger 1.21 if has openexr ${IUSE//+}; then
52 wired 1.23 COMMONDEPEND+=" media-gfx/imagemagick[openexr?]"
53 dagger 1.21 else
54 wired 1.23 COMMONDEPEND+=" media-gfx/imagemagick"
55 dagger 1.21 fi
56    
57 wired 1.23 COMMONDEPEND+="
58 scarabeus 1.17 dev-cpp/eigen:2
59     media-libs/fontconfig
60     media-libs/freetype:2
61 scarabeus 1.12 "
62 scarabeus 1.17 if [[ ${PN} != koffice-libs && ${PN} != koffice-data ]]; then
63 wired 1.23 COMMONDEPEND+=" >=app-office/koffice-libs-${PV}:${SLOT}"
64 scarabeus 1.17 fi
65 scarabeus 1.9 ;;
66 ingmar 1.1 esac
67    
68 wired 1.23 DEPEND+=" ${COMMONDEPEND}"
69     RDEPEND+=" ${COMMONDEPEND}"
70     unset COMMONDEPEND
71    
72 ingmar 1.1 debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after metapackage-specific dependencies"
73     debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-specific dependencies"
74    
75 scarabeus 1.11 # Useful to build kde4-meta style stuff from extragear/playground (plasmoids etc)
76 scarabeus 1.15 case ${BUILD_TYPE} in
77 scarabeus 1.11 live)
78     case ${KMNAME} in
79     extragear*|playground*)
80     ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}"
81 scarabeus 1.18 ESVN_PROJECT="${KMNAME}${ESVN_PROJECT_SUFFIX}"
82 scarabeus 1.11 ;;
83     esac
84     ;;
85     esac
86    
87 ingmar 1.1 # @ECLASS-VARIABLE: KMNAME
88     # @DESCRIPTION:
89 scarabeus 1.9 # Name of the parent-module (e.g. kdebase, kdepim, ...). You _must_ set it
90     # _before_ inheriting this eclass, (unlike the other parameters), since it's
91     # used to set $SRC_URI.
92 ingmar 1.1
93     # @ECLASS-VARIABLE: KMMODULE
94     # @DESCRIPTION:
95     # Specify exactly one subdirectory of $KMNAME here. Defaults to $PN.
96     # The subdirectory listed here is treated exactly like items in $KMEXTRA.
97     #
98     # Example: The ebuild name of "kdebase/l10n" is kde-base/kdebase-l10n, because
99     # just 'l10n' would be too confusing. Hence it sets KMMODULE="l10n".
100    
101     # @ECLASS-VARIABLE: KMNOMODULE
102     # @DESCRIPTION:
103     # If set to "true", $KMMODULE doesn't have to be defined.
104     #
105     # Example usage: If you're installing subdirectories of a package, like plugins,
106 scarabeus 1.9 # you mark the top subdirectory (containing the package) as $KMEXTRACTONLY, and
107     # set KMNOMODULE="true".
108 scarabeus 1.11 if [[ -z ${KMMODULE} && ${KMNOMODULE} != true ]]; then
109     KMMODULE=${PN}
110 ingmar 1.1 fi
111    
112     # @ECLASS-VARIABLE: KMEXTRA
113     # @DESCRIPTION:
114     # All subdirectories listed here will be extracted, compiled & installed.
115     # $KMMODULE is always added to $KMEXTRA.
116 scarabeus 1.22 # If the handbook USE-flag is set, and if this directory exists,
117 ingmar 1.1 # then "doc/$KMMODULE" is added to $KMEXTRA. In other cases, this should be
118     # handled in the ebuild.
119     # If the documentation is in a different subdirectory, you should add it to KMEXTRA.
120    
121     # @ECLASS-VARIABLE: KMCOMPILEONLY
122     # @DESCRIPTION:
123     # All subdirectories listed here will be extracted & compiled, but not installed.
124    
125 scarabeus 1.9 # TODO: better formulation may be needed
126 ingmar 1.1 # @ECLASS-VARIABLE: KMEXTRACTONLY
127     # @DESCRIPTION:
128 scarabeus 1.9 # All subdirectories listed here will be extracted, but neither compiled nor installed.
129 ingmar 1.1 # This can be used to avoid compilation in a subdirectory of a directory in $KMMODULE or $KMEXTRA
130    
131     # @ECLASS-VARIABLE: KMTARPARAMS
132     # @DESCRIPTION:
133     # Specify extra parameters to pass to tar, in kde4-meta_src_extract.
134     # '-xpf -j' are passed to tar by default.
135    
136     # @FUNCTION: kde4-meta_pkg_setup
137     # @DESCRIPTION:
138 scarabeus 1.9 # Currently just calls its equivalent in kde4-base.eclass(5). Use this one in
139     # split ebuilds.
140 ingmar 1.1 kde4-meta_pkg_setup() {
141 scarabeus 1.11 debug-print-function ${FUNCNAME} "$@"
142    
143 ingmar 1.1 kde4-base_pkg_setup
144     }
145    
146     # @FUNCTION: kde4-meta_src_unpack
147     # @DESCRIPTION:
148     # This function unpacks the source for split ebuilds. See also
149     # kde4-meta-src_extract.
150     kde4-meta_src_unpack() {
151 scarabeus 1.11 debug-print-function ${FUNCNAME} "$@"
152    
153     if [[ ${BUILD_TYPE} = live ]]; then
154 scarabeus 1.10 migrate_store_dir
155 scarabeus 1.11 S="${WORKDIR}/${P}"
156 scarabeus 1.10 mkdir -p "${S}"
157     ESVN_RESTRICT="export" subversion_src_unpack
158     subversion_wc_info
159     subversion_bootstrap
160 scarabeus 1.9 kde4-meta_src_extract
161     else
162     kde4-meta_src_extract
163     fi
164     }
165 ingmar 1.1
166 scarabeus 1.9 # FIXME: the difference between kde4-meta_src_extract and kde4-meta_src_unpack?
167 ingmar 1.1
168     # @FUNCTION: kde4-meta_src_extract
169     # @DESCRIPTION:
170     # A function to unpack the source for a split KDE ebuild.
171 scarabeus 1.9 # Also see KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and
172     # KMTARPARAMS.
173 ingmar 1.1 kde4-meta_src_extract() {
174 scarabeus 1.11 debug-print-function ${FUNCNAME} "$@"
175    
176     if [[ ${BUILD_TYPE} = live ]]; then
177 scarabeus 1.9 local rsync_options subdir kmnamedir targetdir
178     # Export working copy to ${S}
179     einfo "Exporting parts of working copy to ${S}"
180     kde4-meta_create_extractlists
181    
182     rsync_options="--group --links --owner --perms --quiet --exclude=.svn/"
183    
184     # Copy ${KMNAME} non-recursively (toplevel files)
185     rsync ${rsync_options} "${ESVN_WC_PATH}"/${kmnamedir}* "${S}" \
186     || die "${ESVN}: can't export toplevel files to '${S}'."
187     # Copy cmake directory
188     if [[ -d "${ESVN_WC_PATH}/${kmnamedir}cmake" ]]; then
189     rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}cmake" "${S}" \
190     || die "${ESVN}: can't export cmake files to '${S}'."
191     fi
192     # Copy all subdirectories
193     for subdir in $(__list_needed_subdirectories); do
194 scarabeus 1.12 targetdir=""
195     if [[ $subdir = doc/* && ! -e "$ESVN_WC_PATH/$kmnamedir$subdir" ]]; then
196     continue
197     fi
198 scarabeus 1.9
199 scarabeus 1.12 [[ ${subdir%/} = */* ]] && targetdir=${subdir%/} && targetdir=${targetdir%/*} && mkdir -p "${S}/${targetdir}"
200     rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}${subdir%/}" "${S}/${targetdir}" \
201     || die "${ESVN}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'."
202 scarabeus 1.9 done
203 ingmar 1.1
204 scarabeus 1.11 if [[ ${KMNAME} = kdebase-runtime && ${PN} != kdebase-data ]]; then
205 scarabeus 1.9 sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
206     "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
207     fi
208     else
209 scarabeus 1.12 local abort tarball tarfile f extractlist moduleprefix postfix
210     case ${PV} in
211 alexxy 1.26 4.3.85 | 4.3.9[0568])
212 scarabeus 1.18 # block for normally packed upstream unstable snapshots
213 wired 1.23 KMTARPARAMS+=" --bzip2" # bz2
214 scarabeus 1.18 postfix="bz2"
215     ;;
216 alexxy 1.26 4.3.[6-9]*)
217 scarabeus 1.28 # Not passing --xz, as it doesn't work with stable tar
218     KMTARPARAMS+=" --use-compress-program=xz" # xz
219     postfix="xz"
220 scarabeus 1.12 ;;
221     *)
222 wired 1.23 KMTARPARAMS+=" --bzip2" # bz2
223 scarabeus 1.12 postfix="bz2"
224     ;;
225     esac
226     case ${KMNAME} in
227 scarabeus 1.9 kdebase-apps)
228 wired 1.23 # kdebase/apps -> kdebase-apps
229 scarabeus 1.12 tarball="kdebase-${PV}.tar.${postfix}"
230     # Go one level deeper for kdebase-apps in tarballs
231     moduleprefix=apps/
232 wired 1.23 KMTARPARAMS+=" --transform=s|apps/||"
233 scarabeus 1.9 ;;
234     *)
235 scarabeus 1.12 # Create tarball name from module name (this is the default)
236     tarball="${KMNAME}-${PV}.tar.${postfix}"
237 scarabeus 1.9 ;;
238     esac
239 scarabeus 1.12
240 wired 1.23 # Full path to source tarball
241 scarabeus 1.11 tarfile="${DISTDIR}/${tarball}"
242 ingmar 1.1
243 scarabeus 1.12 # Detect real toplevel dir from tarball name - it will be used upon extraction
244     # and in __list_needed_subdirectories
245     topdir="${tarball%.tar.*}/"
246    
247 scarabeus 1.9 ebegin "Unpacking parts of ${tarball} to ${WORKDIR}"
248 ingmar 1.1
249 scarabeus 1.9 kde4-meta_create_extractlists
250 ingmar 1.1
251 scarabeus 1.9 for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake \
252     AUTHORS COPYING INSTALL README NEWS ChangeLog
253     do
254 wired 1.23 extractlist+=" ${topdir}${moduleprefix}${f}"
255 scarabeus 1.9 done
256 wired 1.23 extractlist+=" $(__list_needed_subdirectories)"
257 ingmar 1.1
258 scarabeus 1.9 pushd "${WORKDIR}" > /dev/null
259 scarabeus 1.11 [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} >&2
260     tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null
261 scarabeus 1.9
262 scarabeus 1.11 # Default $S is based on $P; rename the extracted directory to match $S if necessary
263 scarabeus 1.12 mv ${topdir} ${P} || die "Died while moving \"${topdir}\" to \"${P}\""
264 scarabeus 1.9
265     popd > /dev/null
266    
267     eend $?
268    
269 scarabeus 1.11 # We need to clear it here to make verification below work
270     unset moduleprefix
271    
272 scarabeus 1.9 if [[ -n ${KDE4_STRICTER} ]]; then
273     for f in $(__list_needed_subdirectories fatal); do
274 scarabeus 1.11 if [[ ! -e "${S}/${f#*/}" ]]; then
275 scarabeus 1.9 eerror "'${f#*/}' is missing"
276     abort=true
277     fi
278     done
279     [[ -n ${abort} ]] && die "There were missing files."
280     fi
281 scarabeus 1.12
282     # We don't need it anymore
283     unset topdir
284 zlin 1.4 fi
285 ingmar 1.1 }
286    
287 scarabeus 1.9 # @FUNCTION: kde4-meta_create_extractlists
288     # @DESCRIPTION:
289 ingmar 1.1 # Create lists of files and subdirectories to extract.
290 scarabeus 1.9 # Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY,
291     # KMEXTRACTONLY and KMTARPARAMS.
292 ingmar 1.1 kde4-meta_create_extractlists() {
293     debug-print-function ${FUNCNAME} "$@"
294    
295 scarabeus 1.17 # TODO change to KMEXTRA for more strict check
296 scarabeus 1.22 if has handbook ${IUSE//+} && use handbook && [[ -n ${KMMODULE} ]]; then
297 ingmar 1.1 # We use the basename of $KMMODULE because $KMMODULE can contain
298     # the path to the module subdirectory.
299 wired 1.23 KMEXTRA_NONFATAL+="
300     doc/${KMMODULE##*/}"
301 scarabeus 1.22 fi
302 ingmar 1.1
303     # Add some CMake-files to KMEXTRACTONLY.
304     # Note that this actually doesn't include KMEXTRA handling.
305     # In those cases you should care to add the relevant files to KMEXTRACTONLY
306     case ${KMNAME} in
307     kdebase)
308 wired 1.23 KMEXTRACTONLY+="
309 scarabeus 1.9 apps/config-apps.h.cmake
310     apps/ConfigureChecks.cmake"
311     ;;
312     kdebase-apps)
313 wired 1.23 KMEXTRACTONLY+="
314 scarabeus 1.9 config-apps.h.cmake
315     ConfigureChecks.cmake"
316     ;;
317 ingmar 1.1 kdebase-runtime)
318 wired 1.23 KMEXTRACTONLY+="
319 scarabeus 1.9 config-runtime.h.cmake"
320     ;;
321 ingmar 1.1 kdebase-workspace)
322 wired 1.23 KMEXTRACTONLY+="
323 scarabeus 1.9 config-unix.h.cmake
324     ConfigureChecks.cmake
325     config-workspace.h.cmake
326     config-X11.h.cmake
327 scarabeus 1.11 startkde.cmake
328     KDE4WorkspaceConfig.cmake.in"
329 scarabeus 1.9 ;;
330 ingmar 1.1 kdegames)
331 scarabeus 1.11 if [[ ${PN} != libkdegames ]]; then
332 wired 1.23 KMEXTRACTONLY+="
333     libkdegames/"
334 scarabeus 1.9 fi
335     ;;
336     kdepim)
337 scarabeus 1.12 if [[ ${PN} != libkdepim ]]; then
338 wired 1.23 KMEXTRACTONLY+="
339     libkdepim/"
340 scarabeus 1.12 fi
341 alexxy 1.16 case ${SLOT} in
342 wired 1.23 4.3|4.4|live)
343     KMEXTRACTONLY+="
344     kdepim-version.h
345     config-enterprise.h.cmake"
346 alexxy 1.16 ;;
347     esac
348 wired 1.23 KMEXTRACTONLY+="
349 scarabeus 1.12 kleopatra/ConfigureChecks.cmake"
350 scarabeus 1.9 if has kontact ${IUSE//+} && use kontact; then
351 wired 1.23 KMEXTRA+="
352     kontact/plugins/${PLUGINNAME:-${PN}}/"
353 alexxy 1.26 if ! slot_is_at_least 4.4 ${SLOT} || [[ ${SLOT} == 4.4 && ${PV} < 4.3.68 ]]; then
354     KMEXTRACTONLY+="
355     kontactinterfaces/"
356     fi
357 scarabeus 1.9 fi
358     ;;
359 wired 1.23 kdeutils)
360     case ${SLOT} in
361     4.3|4.4|live)
362     KMEXTRACTONLY+="
363     kdeutils-version.h"
364     ;;
365     esac
366     ;;
367 ingmar 1.1 koffice)
368 wired 1.23 KMEXTRACTONLY+="
369 ingmar 1.1 config-endian.h.cmake
370     filters/config-filters.h.cmake
371     config-openexr.h.cmake
372     config-opengl.h.cmake
373 wired 1.23 config-prefix.h.cmake
374     "
375     case ${PV} in
376     2.0.*)
377     KMEXTRACTONLY+="
378     config-openctl.h.cmake"
379     ;;
380     esac
381 scarabeus 1.9 ;;
382 ingmar 1.1 esac
383 scarabeus 1.9 # Don't install cmake modules for split ebuilds, to avoid collisions.
384 ingmar 1.1 case ${KMNAME} in
385 scarabeus 1.20 kdepim)
386     # No need for unpack since 4.2.86
387     # Remove when 4.2 is wiped out from the tree
388     case ${PV} in
389 alexxy 1.26 4.2.[0-4])
390 wired 1.23 KMCOMPILEONLY+="
391 scarabeus 1.20 cmake/modules/"
392 wired 1.23 ;;
393 scarabeus 1.20 esac
394     ;;
395     kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics)
396 jmbsvicetto 1.7 case ${PN} in
397 scarabeus 1.17 libkdegames|libkdeedu|libkworkspace)
398 wired 1.23 KMEXTRA+="
399 jmbsvicetto 1.7 cmake/modules/"
400     ;;
401     *)
402 wired 1.23 KMCOMPILEONLY+="
403 jmbsvicetto 1.7 cmake/modules/"
404     ;;
405     esac
406 ingmar 1.1 ;;
407     esac
408    
409     debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}"
410     }
411    
412     __list_needed_subdirectories() {
413 scarabeus 1.12 local i j kmextra kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist
414 ingmar 1.1
415     # We expand KMEXTRA by adding CMakeLists.txt files
416 zlin 1.4 kmextra="${KMEXTRA}"
417 wired 1.23 [[ ${1} != fatal ]] && kmextra+=" ${KMEXTRA_NONFATAL}"
418 zlin 1.4 for i in ${kmextra}; do
419 wired 1.23 kmextra_expanded+=" ${i}"
420 ingmar 1.1 j=$(dirname ${i})
421     while [[ ${j} != "." ]]; do
422 wired 1.23 kmextra_expanded+=" ${j}/CMakeLists.txt";
423 ingmar 1.1 j=$(dirname ${j})
424     done
425     done
426    
427     # Expand KMMODULE
428 scarabeus 1.11 if [[ -n ${KMMODULE} ]]; then
429 ingmar 1.1 kmmodule_expanded="${KMMODULE}"
430     j=$(dirname ${KMMODULE})
431     while [[ ${j} != "." ]]; do
432 wired 1.23 kmmodule_expanded+=" ${j}/CMakeLists.txt";
433 scarabeus 1.11 j=$(dirname ${j})
434 ingmar 1.1 done
435     fi
436    
437     # Expand KMCOMPILEONLY
438     for i in ${KMCOMPILEONLY}; do
439 wired 1.23 kmcompileonly_expanded+=" ${i}"
440 ingmar 1.1 j=$(dirname ${i})
441     while [[ ${j} != "." ]]; do
442 wired 1.23 kmcompileonly_expanded+=" ${j}/CMakeLists.txt";
443 ingmar 1.1 j=$(dirname ${j})
444     done
445     done
446    
447     debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmextra_expanded: ${kmextra_expanded}"
448     debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmmodule_expanded: ${kmmodule_expanded}"
449     debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmcompileonly_expanded: ${kmcompileonly_expanded}"
450    
451     # Create final list of stuff to extract
452 scarabeus 1.12 # We append topdir only when specified (usually for tarballs)
453 ingmar 1.1 for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \
454     ${KMEXTRACTONLY}
455     do
456 wired 1.23 extractlist+=" ${topdir}${moduleprefix}${i}"
457 ingmar 1.1 done
458    
459     echo ${extractlist}
460     }
461    
462 scarabeus 1.9 # @FUNCTION: kde4-meta_src_prepare
463 ingmar 1.1 # @DESCRIPTION:
464 scarabeus 1.9 # Meta-package build system configuration handling - commenting out targets, etc..
465     kde4-meta_src_prepare() {
466 ingmar 1.1 debug-print-function ${FUNCNAME} "$@"
467    
468 scarabeus 1.9 kde4-meta_change_cmakelists
469     kde4-base_src_prepare
470 ingmar 1.1 }
471    
472 scarabeus 1.9 # FIXME: no comment here?
473 ingmar 1.1 _change_cmakelists_parent_dirs() {
474     debug-print-function ${FUNCNAME} "$@"
475    
476     local _olddir _dir
477     _dir="${S}"/${1}
478     until [[ ${_dir} == "${S}" ]]; do
479 ingmar 1.6 _olddir=$(basename "${_dir}")
480     _dir=$(dirname "${_dir}")
481 ingmar 1.1 debug-print "${LINENO}: processing ${_dir} CMakeLists.txt searching for ${_olddir}"
482     if [[ -f ${_dir}/CMakeLists.txt ]]; then
483 ingmar 1.6 sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${_olddir}[[:space:]]*)/s/#DONOTCOMPILE //g" \
484     -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${_olddir}[[:space:]]*)/s/#DONOTCOMPILE //g" \
485     -i ${_dir}/CMakeLists.txt || die "${LINENO}: died in ${FUNCNAME} while processing ${_dir}"
486 ingmar 1.1 fi
487     done
488     }
489    
490 scarabeus 1.9 # FIXME: add description
491     # @FUNCTION: kde4-meta_change_cmakelists
492     # @DESCRIPTION:
493 ingmar 1.1 kde4-meta_change_cmakelists() {
494 scarabeus 1.11 debug-print-function ${FUNCNAME} "$@"
495 ingmar 1.1
496     pushd "${S}" > /dev/null
497    
498     comment_all_add_subdirectory ./
499    
500     # Restore "add_subdirectory( cmake )" in ${S}/CMakeLists.txt
501 scarabeus 1.27 if [[ -f CMakeLists.txt ]]; then
502 ingmar 1.6 sed -e '/add_subdirectory[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \
503     -e '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \
504 scarabeus 1.27 -i CMakeLists.txt || die "${LINENO}: cmake sed died"
505 ingmar 1.1 fi
506    
507     if [[ -z ${KMNOMODULE} ]]; then
508     # Restore "add_subdirectory" in $KMMODULE subdirectories
509 scarabeus 1.27 find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | \
510     xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
511     die "${LINENO}: died in KMMODULE section"
512 ingmar 1.1 _change_cmakelists_parent_dirs ${KMMODULE}
513     fi
514    
515 scarabeus 1.12 local i
516    
517     # KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY
518     for i in ${KMEXTRACTONLY}; do
519 scarabeus 1.27 if [[ -d ${i} && -f ${i}/../CMakeLists.txt ]]; then
520     sed -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" \
521     -i ${i}/../CMakeLists.txt || \
522 scarabeus 1.12 die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}"
523     fi
524     done
525    
526 ingmar 1.1 # KMCOMPILEONLY
527     for i in ${KMCOMPILEONLY}; do
528     debug-print "${LINENO}: KMCOMPILEONLY, processing ${i}"
529     # Uncomment "add_subdirectory" instructions inside $KMCOMPILEONLY, then comment "install" instructions.
530     find "${S}"/${i} -name CMakeLists.txt -print0 | \
531     xargs -0 sed -i \
532     -e 's/^#DONOTCOMPILE //g' \
533     -e '/install(.*)/{s/^/#DONOTINSTALL /;}' \
534     -e '/^install(/,/)/{s/^/#DONOTINSTALL /;}' \
535     -e '/kde4_install_icons(.*)/{s/^/#DONOTINSTALL /;}' || \
536     die "${LINENO}: sed died in the KMCOMPILEONLY section while processing ${i}"
537     _change_cmakelists_parent_dirs ${i}
538     done
539    
540     # KMEXTRA section
541     for i in ${KMEXTRA}; do
542     debug-print "${LINENO}: KMEXTRA section, processing ${i}"
543 zlin 1.4 find "${S}"/${i} -name CMakeLists.txt -print0 | \
544     xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
545     die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
546     _change_cmakelists_parent_dirs ${i}
547     done
548     # KMEXTRA_NONFATAL section
549     for i in ${KMEXTRA_NONFATAL}; do
550 ingmar 1.1 if [[ -d "${S}"/${i} ]]; then
551     find "${S}"/${i} -name CMakeLists.txt -print0 | \
552     xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
553 scarabeus 1.27 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
554 ingmar 1.1 _change_cmakelists_parent_dirs ${i}
555     fi
556     done
557    
558     case ${KMNAME} in
559     kdebase-workspace)
560 scarabeus 1.9 # COLLISION PROTECT section
561     # Install the startkde script just once, as a part of kde-base/kdebase-startkde,
562     # not as a part of every package.
563 scarabeus 1.27 if [[ ${PN} != kdebase-startkde && -f CMakeLists.txt ]]; then
564 scarabeus 1.9 # The startkde script moved to kdebase-workspace for KDE4 versions > 3.93.0.
565 scarabeus 1.27 sed -e '/startkde/s/^/#DONOTINSTALL /' \
566     -i CMakeLists.txt || die "${LINENO}: sed died in the kdebase-startkde collision prevention section"
567 scarabeus 1.9 fi
568     # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82
569 scarabeus 1.11 if [[ ${PN} != libkworkspace ]]; then
570 scarabeus 1.27 sed -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \
571     -i CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip config install and fix EXPORT section"
572 scarabeus 1.9 fi
573     ;;
574     kdebase-runtime)
575     # COLLISION PROTECT section
576     # Only install the kde4 script as part of kde-base/kdebase-data
577 scarabeus 1.27 if [[ ${PN} != kdebase-data && -f CMakeLists.txt ]]; then
578     sed -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
579     -i CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
580 scarabeus 1.9 fi
581     ;;
582 scarabeus 1.27 kdenetwork)
583     # Disable hardcoded kdepimlibs check
584     sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \
585     -i CMakeLists.txt || die "failed to disable hardcoded checks"
586     ;;
587 scarabeus 1.9 kdepim)
588     case ${PN} in
589     kaddressbook|kalarm|kmailcvt|kontact|korganizer|korn)
590 scarabeus 1.27 sed -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \
591     -e '/add_custom_target(kmail_xml /,/)/p' \
592     -i kmail/CMakeLists.txt || die "uncommenting xml failed"
593 scarabeus 1.9 _change_cmakelists_parent_dirs kmail
594 ingmar 1.1 ;;
595     esac
596 ingmar 1.6 ;;
597 scarabeus 1.17 kdewebdev)
598     # Disable hardcoded kdepimlibs check
599     sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \
600 scarabeus 1.20 -e 's/find_package(LibXml2 REQUIRED)/macro_optional_find_package(LibXml2)/' \
601     -e 's/find_package(LibXslt REQUIRED)/macro_optional_find_package(LibXslt)/' \
602     -e 's/find_package(Boost REQUIRED)/macro_optional_find_package(Boost)/' \
603 scarabeus 1.17 -i CMakeLists.txt || die "failed to disable hardcoded checks"
604     ;;
605 scarabeus 1.11 koffice)
606     # prevent collisions
607     if [[ ${PN} != koffice-data ]]; then
608 scarabeus 1.27 sed -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \
609     -i cmake/modules/CMakeLists.txt || die "${LINENO}: sed died in collision prevention section"
610     sed -e '/install(.\+config-openexr\.h.\+)/d' \
611     -i CMakeLists.txt || die "${LINENO}: sed died in collision prevention section"
612 scarabeus 1.11 fi
613 scarabeus 1.27 # koffice 2.0
614     case ${PV} in
615     2.0.[1-9])
616     sed -i -n -e '1h;1!H;${g;s/install(.\+config-openexr.h.\+)//;p}' \
617     "${S}"/CMakeLists.txt || \
618     die "${LINENO}: sed died in collision prevention section"
619     ;;
620     *) ;;
621     esac
622 ingmar 1.1 esac
623    
624     popd > /dev/null
625     }
626    
627     # @FUNCTION: kde4-meta_src_configure
628     # @DESCRIPTION:
629 scarabeus 1.9 # Currently just calls its equivalent in kde4-base.eclass(5). Use this one in split
630 ingmar 1.1 # ebuilds.
631     kde4-meta_src_configure() {
632 scarabeus 1.11 debug-print-function ${FUNCNAME} "$@"
633 ingmar 1.1
634 scarabeus 1.17 # Set some cmake default values here (usually workarounds for automagic deps)
635     case ${KMNAME} in
636     kdewebdev)
637     mycmakeargs="
638     -DWITH_KdepimLibs=OFF
639     -DWITH_LibXml2=OFF
640     -DWITH_LibXslt=OFF
641     -DWITH_Boost=OFF
642     -DWITH_LibTidy=OFF
643     ${mycmakeargs}"
644     ;;
645     esac
646    
647 ingmar 1.1 kde4-base_src_configure
648     }
649    
650 scarabeus 1.9 # @FUNCTION: kde4-meta_src_compile
651 ingmar 1.1 # @DESCRIPTION:
652 scarabeus 1.9 # General function for compiling split KDE4 applications.
653     # Overrides kde4-base_src_compile.
654     kde4-meta_src_compile() {
655 scarabeus 1.11 debug-print-function ${FUNCNAME} "$@"
656 ingmar 1.1
657 wired 1.23 kde4-base_src_compile "$@"
658 ingmar 1.1 }
659    
660     # @FUNCTION: kde4-meta_src_test
661     # @DESCRIPTION:
662     # Currently just calls its equivalent in kde4-base.eclass(5). Use this in split
663     # ebuilds.
664     kde4-meta_src_test() {
665     debug-print-function $FUNCNAME "$@"
666    
667     kde4-base_src_test
668     }
669    
670     # @FUNCTION: kde4-meta_src_install
671     # @DESCRIPTION:
672     # Function for installing KDE4 split applications.
673     kde4-meta_src_install() {
674     debug-print-function $FUNCNAME "$@"
675    
676 scarabeus 1.17 kde4-base_src_install
677 ingmar 1.1 }
678    
679     # @FUNCTION: kde4-meta_src_make_doc
680     # @DESCRIPTION:
681 scarabeus 1.9 # This function searches in ${S}/${KMMODULE},
682 wired 1.23 # and tries to install "AUTHORS ChangeLog* README* NEWS TODO" if these files exist.
683 ingmar 1.1 kde4-meta_src_make_doc() {
684 scarabeus 1.11 debug-print-function ${FUNCNAME} "$@"
685 ingmar 1.1
686     local doc
687     for doc in AUTHORS ChangeLog* README* NEWS TODO; do
688 scarabeus 1.11 [[ -s ${KMMODULE}/${doc} ]] && newdoc "${KMMODULE}/${doc}" "${doc}.${KMMODULE##*/}"
689 ingmar 1.1 done
690    
691     kde4-base_src_make_doc
692     }
693    
694     # @FUNCTION: kde4-meta_pkg_postinst
695     # @DESCRIPTION:
696 scarabeus 1.28 # Invoke kbuildsycoca4.
697 ingmar 1.1 kde4-meta_pkg_postinst() {
698 scarabeus 1.11 debug-print-function ${FUNCNAME} "$@"
699    
700 ingmar 1.1 kde4-base_pkg_postinst
701     }
702    
703     # @FUNCTION: kde4-meta_pkg_postrm
704     # @DESCRIPTION:
705     # Currently just calls its equivalent in kde4-base.eclass(5). Use this in split
706     # ebuilds.
707     kde4-meta_pkg_postrm() {
708 scarabeus 1.11 debug-print-function ${FUNCNAME} "$@"
709    
710 ingmar 1.1 kde4-base_pkg_postrm
711     }

  ViewVC Help
Powered by ViewVC 1.1.20