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

Contents of /eclass/kde4-meta.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (hide annotations) (download)
Mon Mar 9 19:41:26 2009 UTC (5 years, 1 month ago) by scarabeus
Branch: MAIN
Changes since 1.11: +112 -55 lines
Sync kde4 eclasses with kde-testing (review by scarabeus and jmbsvicetto).

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

  ViewVC Help
Powered by ViewVC 1.1.20