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

Contents of /eclass/kde4-meta.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (hide annotations) (download)
Mon Jan 12 17:25:59 2009 UTC (5 years, 8 months ago) by scarabeus
Branch: MAIN
Changes since 1.8: +260 -215 lines
Update of kde4 eclasses with ones which understand 4.2 and live :]
Report all broken  (in meaning with kde4.2) things, i will be revbumping and
fixing all packages using these eclasses but i might miss something.
Such package could became blocker for 4.2 so bumb if you maintain such thing
(i will write note on dev-ml today when i am done and if i wont forget).

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

  ViewVC Help
Powered by ViewVC 1.1.20