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

Contents of /eclass/kde4-meta.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.71 - (hide annotations) (download)
Thu Aug 15 15:10:05 2013 UTC (8 months ago) by kensington
Branch: MAIN
Changes since 1.70: +6 -32 lines
Remove old, unused code.

1 alexxy 1.69 # Copyright 1999-2013 Gentoo Foundation
2 ingmar 1.1 # Distributed under the terms of the GNU General Public License v2
3 kensington 1.71 # $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.70 2013/04/07 17:46:23 kensington 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 kensington 1.70 if [[ ${___ECLASS_ONCE_KDE4_META} != "recur -_+^+_- spank" ]] ; then
16     ___ECLASS_ONCE_KDE4_META="recur -_+^+_- spank"
17    
18 scarabeus 1.51 [[ -z ${KMNAME} ]] && die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild"
19    
20 scarabeus 1.52 inherit kde4-base versionator
21 ingmar 1.1
22 scarabeus 1.52 KDEMETA_EXPF="pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm"
23 dilfridge 1.50 EXPORT_FUNCTIONS ${KDEMETA_EXPF}
24 ingmar 1.1
25     # Add dependencies that all packages in a certain module share.
26     case ${KMNAME} in
27 abcd 1.53 kdebase|kdebase-apps|kde-baseapps|kdebase-workspace|kde-workspace|kdebase-runtime|kde-runtime|kdegraphics)
28 reavertm 1.36 COMMONDEPEND+=" >=media-libs/qimageblitz-0.0.4"
29 scarabeus 1.12 ;;
30 wired 1.23 kdepim|kdepim-runtime)
31 ingmar 1.1 case ${PN} in
32 scarabeus 1.22 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker)
33 wired 1.23 IUSE+=" +kontact"
34 reavertm 1.33 RDEPEND+=" kontact? ( $(add_kdebase_dep kontact) )"
35 scarabeus 1.9 ;;
36 ingmar 1.1 esac
37 scarabeus 1.9 ;;
38 ingmar 1.1 esac
39    
40 wired 1.23 DEPEND+=" ${COMMONDEPEND}"
41     RDEPEND+=" ${COMMONDEPEND}"
42     unset COMMONDEPEND
43    
44 ingmar 1.1 debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after metapackage-specific dependencies"
45     debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-specific dependencies"
46    
47 scarabeus 1.11 # Useful to build kde4-meta style stuff from extragear/playground (plasmoids etc)
48 johu 1.65 case ${KDE_BUILD_TYPE} in
49 scarabeus 1.11 live)
50 scarabeus 1.51 if [[ ${KDE_SCM} == svn ]]; then
51     case ${KMNAME} in
52     extragear*|playground*)
53     ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}"
54     ESVN_PROJECT="${KMNAME}${ESVN_PROJECT_SUFFIX}"
55     ;;
56     esac
57     fi
58 scarabeus 1.11 ;;
59     esac
60    
61 ingmar 1.1 # @ECLASS-VARIABLE: KMNAME
62     # @DESCRIPTION:
63 scarabeus 1.9 # Name of the parent-module (e.g. kdebase, kdepim, ...). You _must_ set it
64     # _before_ inheriting this eclass, (unlike the other parameters), since it's
65     # used to set $SRC_URI.
66 ingmar 1.1
67     # @ECLASS-VARIABLE: KMMODULE
68     # @DESCRIPTION:
69     # Specify exactly one subdirectory of $KMNAME here. Defaults to $PN.
70     # The subdirectory listed here is treated exactly like items in $KMEXTRA.
71     #
72     # Example: The ebuild name of "kdebase/l10n" is kde-base/kdebase-l10n, because
73     # just 'l10n' would be too confusing. Hence it sets KMMODULE="l10n".
74    
75     # @ECLASS-VARIABLE: KMNOMODULE
76     # @DESCRIPTION:
77     # If set to "true", $KMMODULE doesn't have to be defined.
78     #
79     # Example usage: If you're installing subdirectories of a package, like plugins,
80 scarabeus 1.9 # you mark the top subdirectory (containing the package) as $KMEXTRACTONLY, and
81     # set KMNOMODULE="true".
82 reavertm 1.43 if [[ -z ${KMMODULE} ]] && [[ ${KMNOMODULE} != true ]]; then
83 scarabeus 1.11 KMMODULE=${PN}
84 ingmar 1.1 fi
85    
86     # @ECLASS-VARIABLE: KMEXTRA
87     # @DESCRIPTION:
88     # All subdirectories listed here will be extracted, compiled & installed.
89     # $KMMODULE is always added to $KMEXTRA.
90 reavertm 1.41 # If KDE_HANDBOOK is 'always' or 'optional' and handbook USE-flag is set, and if this
91     # directory exists, then "doc/$KMMODULE" is added to $KMEXTRA. If there's additional
92     # documentation in different subdirectories, it should be added to KMEXTRA manually..
93 ingmar 1.1
94     # @ECLASS-VARIABLE: KMCOMPILEONLY
95     # @DESCRIPTION:
96     # All subdirectories listed here will be extracted & compiled, but not installed.
97    
98 scarabeus 1.9 # TODO: better formulation may be needed
99 ingmar 1.1 # @ECLASS-VARIABLE: KMEXTRACTONLY
100     # @DESCRIPTION:
101 scarabeus 1.9 # All subdirectories listed here will be extracted, but neither compiled nor installed.
102 ingmar 1.1 # This can be used to avoid compilation in a subdirectory of a directory in $KMMODULE or $KMEXTRA
103    
104     # @ECLASS-VARIABLE: KMTARPARAMS
105     # @DESCRIPTION:
106     # Specify extra parameters to pass to tar, in kde4-meta_src_extract.
107     # '-xpf -j' are passed to tar by default.
108    
109     # @FUNCTION: kde4-meta_pkg_setup
110     # @DESCRIPTION:
111 dilfridge 1.50 # Currently calls its equivalent in kde4-base.eclass(5) and checks the gcc version.
112     # Use this one in split ebuilds.
113 ingmar 1.1 kde4-meta_pkg_setup() {
114 scarabeus 1.11 debug-print-function ${FUNCNAME} "$@"
115    
116 ingmar 1.1 kde4-base_pkg_setup
117     }
118    
119     # @FUNCTION: kde4-meta_src_unpack
120     # @DESCRIPTION:
121 scarabeus 1.51 # This function unpacks the source for split ebuilds.
122     # Further more is processed in kde4-meta_src_extract
123 ingmar 1.1 kde4-meta_src_unpack() {
124 scarabeus 1.11 debug-print-function ${FUNCNAME} "$@"
125    
126 johu 1.65 if [[ ${KDE_BUILD_TYPE} = live ]]; then
127 scarabeus 1.51 case "${KDE_SCM}" in
128     svn)
129     S="${WORKDIR}/${P}"
130     mkdir -p "${S}"
131     ESVN_RESTRICT="export" subversion_src_unpack
132     subversion_wc_info
133     subversion_bootstrap
134     ;;
135     git)
136 scarabeus 1.52 git-2_src_unpack
137 scarabeus 1.51 ;;
138     esac
139 scarabeus 1.9 fi
140 scarabeus 1.51 kde4-meta_src_extract
141 scarabeus 1.9 }
142 ingmar 1.1
143     # @FUNCTION: kde4-meta_src_extract
144     # @DESCRIPTION:
145 scarabeus 1.51 # A function to extract the source for a split KDE ebuild.
146 scarabeus 1.9 # Also see KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and
147     # KMTARPARAMS.
148 ingmar 1.1 kde4-meta_src_extract() {
149 scarabeus 1.11 debug-print-function ${FUNCNAME} "$@"
150    
151 johu 1.65 if [[ ${KDE_BUILD_TYPE} = live ]]; then
152 scarabeus 1.9 # Export working copy to ${S}
153     einfo "Exporting parts of working copy to ${S}"
154     kde4-meta_create_extractlists
155    
156 scarabeus 1.51 case ${KDE_SCM} in
157     svn)
158 abcd 1.55 local rsync_options subdir targetdir wc_path escm
159 scarabeus 1.51
160     rsync_options="--group --links --owner --perms --quiet --exclude=.svn/ --exclude=.git/"
161     wc_path="${ESVN_WC_PATH}"
162     escm="{ESVN}"
163    
164     # Copy ${KMNAME} non-recursively (toplevel files)
165 abcd 1.55 rsync ${rsync_options} "${wc_path}"/* "${S}" \
166 scarabeus 1.51 || die "${escm}: can't export toplevel files to '${S}'."
167     # Copy cmake directory
168 abcd 1.55 if [[ -d "${wc_path}/cmake" ]]; then
169     rsync --recursive ${rsync_options} "${wc_path}/cmake" "${S}" \
170 scarabeus 1.51 || die "${escm}: can't export cmake files to '${S}'."
171     fi
172     # Copy all subdirectories
173     for subdir in $(__list_needed_subdirectories); do
174     targetdir=""
175 abcd 1.55 if [[ $subdir = doc/* && ! -e "$wc_path/$subdir" ]]; then
176 scarabeus 1.51 continue
177     fi
178 scarabeus 1.9
179 scarabeus 1.51 [[ ${subdir%/} = */* ]] && targetdir=${subdir%/} && targetdir=${targetdir%/*} && mkdir -p "${S}/${targetdir}"
180 abcd 1.55 rsync --recursive ${rsync_options} "${wc_path}/${subdir%/}" "${S}/${targetdir}" \
181 scarabeus 1.51 || die "${escm}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'."
182     done
183     ;;
184     esac
185     else
186 abcd 1.54 local abort tarball tarfile f extractlist postfix
187 scarabeus 1.9
188 johu 1.66 if [[ ${PV} =~ 4.[47].[12345] ]]; then
189 johu 1.65 postfix="bz2"
190     KMTARPARAMS+=" --bzip2"
191     else
192 dilfridge 1.60 postfix="xz"
193     KMTARPARAMS+=" --xz"
194     fi
195 ingmar 1.1
196 kensington 1.71 tarball="${KMNAME}-${PV}.tar.${postfix}"
197 scarabeus 1.12
198 wired 1.23 # Full path to source tarball
199 scarabeus 1.11 tarfile="${DISTDIR}/${tarball}"
200 ingmar 1.1
201 scarabeus 1.12 # Detect real toplevel dir from tarball name - it will be used upon extraction
202     # and in __list_needed_subdirectories
203     topdir="${tarball%.tar.*}/"
204    
205 scarabeus 1.9 ebegin "Unpacking parts of ${tarball} to ${WORKDIR}"
206 ingmar 1.1
207 scarabeus 1.9 kde4-meta_create_extractlists
208 ingmar 1.1
209 abcd 1.53 for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake
210 scarabeus 1.9 do
211 abcd 1.54 extractlist+=" ${topdir}${f}"
212 scarabeus 1.9 done
213 wired 1.23 extractlist+=" $(__list_needed_subdirectories)"
214 ingmar 1.1
215 scarabeus 1.9 pushd "${WORKDIR}" > /dev/null
216 scarabeus 1.51
217     # @ECLASS-VARIABLE: KDE4_STRICTER
218     # @DESCRIPTION:
219     # Print out all issues found executing tar / kmextract files
220     # Set on if you want to find issues in kde-base ebuild unpack sequences
221     [[ -n ${KDE4_STRICTER} ]] && echo 'tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist}'
222 dilfridge 1.63 tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null || echo "tar extract command failed at least partially - continuing anyway"
223 scarabeus 1.9
224 scarabeus 1.11 # Default $S is based on $P; rename the extracted directory to match $S if necessary
225 abcd 1.53 if [[ ${KMNAME} != ${PN} ]]; then
226     mv ${topdir} ${P} || die "Died while moving \"${topdir}\" to \"${P}\""
227     fi
228 scarabeus 1.9
229     popd > /dev/null
230    
231     eend $?
232    
233     if [[ -n ${KDE4_STRICTER} ]]; then
234     for f in $(__list_needed_subdirectories fatal); do
235 scarabeus 1.51 if [[ ! -e ${S}/${f#*/} ]]; then
236 scarabeus 1.9 eerror "'${f#*/}' is missing"
237     abort=true
238     fi
239     done
240     [[ -n ${abort} ]] && die "There were missing files."
241     fi
242 scarabeus 1.12
243     # We don't need it anymore
244     unset topdir
245 zlin 1.4 fi
246 ingmar 1.1 }
247    
248 scarabeus 1.9 # @FUNCTION: kde4-meta_create_extractlists
249     # @DESCRIPTION:
250 ingmar 1.1 # Create lists of files and subdirectories to extract.
251 scarabeus 1.9 # Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY,
252     # KMEXTRACTONLY and KMTARPARAMS.
253 ingmar 1.1 kde4-meta_create_extractlists() {
254     debug-print-function ${FUNCNAME} "$@"
255    
256 reavertm 1.41 # Add default handbook locations
257     # FIXME - legacy code - remove when 4.4.5 is gone or preferrably port 4.4.5.
258 abcd 1.58 if [[ $(get_kde_version) < 4.5 ]] && use_if_iuse handbook && [[ -z ${KMNOMODULE} ]]; then
259 ingmar 1.1 # We use the basename of $KMMODULE because $KMMODULE can contain
260     # the path to the module subdirectory.
261 wired 1.23 KMEXTRA_NONFATAL+="
262     doc/${KMMODULE##*/}"
263 scarabeus 1.22 fi
264 ingmar 1.1
265 reavertm 1.41 # Add default handbook locations
266 scarabeus 1.51 if [[ -z ${KMNOMODULE} ]] && ( [[ ${KDE_HANDBOOK} == always ]] || ( [[ ${KDE_HANDBOOK} == optional ]] && use handbook ) ); then
267 reavertm 1.42 KMEXTRA_NONFATAL+=" doc/${KMMODULE##*/}"
268 reavertm 1.41 fi
269    
270 ingmar 1.1 # Add some CMake-files to KMEXTRACTONLY.
271     # Note that this actually doesn't include KMEXTRA handling.
272     # In those cases you should care to add the relevant files to KMEXTRACTONLY
273     case ${KMNAME} in
274 kensington 1.71 kde-baseapps)
275 wired 1.23 KMEXTRACTONLY+="
276 alexxy 1.69 CTestConfig.cmake
277 scarabeus 1.9 config-apps.h.cmake
278     ConfigureChecks.cmake"
279     ;;
280 kensington 1.71 kde-runtime)
281 wired 1.23 KMEXTRACTONLY+="
282 johu 1.65 CTestConfig.cmake
283 scarabeus 1.9 config-runtime.h.cmake"
284     ;;
285 kensington 1.71 kde-workspace)
286 wired 1.23 KMEXTRACTONLY+="
287 scarabeus 1.9 config-unix.h.cmake
288     ConfigureChecks.cmake
289     config-workspace.h.cmake
290     config-X11.h.cmake
291 scarabeus 1.11 startkde.cmake
292     KDE4WorkspaceConfig.cmake.in"
293 scarabeus 1.9 ;;
294     kdepim)
295 scarabeus 1.12 if [[ ${PN} != libkdepim ]]; then
296 wired 1.23 KMEXTRACTONLY+="
297     libkdepim/"
298 scarabeus 1.12 fi
299 wired 1.23 KMEXTRACTONLY+="
300 reavertm 1.33 config-enterprise.h.cmake
301 alexxy 1.69 kleopatra/ConfigureChecks.cmake
302     CTestCustom.cmake
303     kdepim-version.h.cmake
304     kdepim-version.h"
305 abcd 1.58 if use_if_iuse kontact; then
306 wired 1.23 KMEXTRA+="
307     kontact/plugins/${PLUGINNAME:-${PN}}/"
308 scarabeus 1.9 fi
309     ;;
310 ingmar 1.1 esac
311 scarabeus 1.9 # Don't install cmake modules for split ebuilds, to avoid collisions.
312 scarabeus 1.51 # note: kdegraphics >= 4.6.2 does not even have code to do that, so we
313     # should not try in that case
314 abcd 1.54 # note2: kdeedu 4.6.4 does not have a cmake/modules/ subdir anymore :(
315     # it may be possible to formulate this shorter, but it should also
316     # still be understandable...
317     if [[ ${KMNAME} != kdegraphics || ( ( $(get_kde_version) != 4.6 || ${PV} < 4.6.2 ) && $(get_kde_version) < 4.7 ) ]] \
318 johu 1.68 && ! [[ ${KMNAME} == kdeedu && ( ${PV} == 4.6.4 || ${PV} == 4.6.5 ) ]] \
319     && ! [[ ${KMNAME} == kdegames && ${PV} > 4.9.0 ]]; then
320 scarabeus 1.51 case ${KMNAME} in
321 abcd 1.53 kdebase-runtime|kde-runtime|kdebase-workspace|kde-workspace|kdeedu|kdegames|kdegraphics)
322 johu 1.65 KMEXTRACTONLY+="
323     cmake/modules/"
324 scarabeus 1.51 ;;
325     esac
326     fi
327 ingmar 1.1
328     debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}"
329     }
330    
331     __list_needed_subdirectories() {
332 scarabeus 1.12 local i j kmextra kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist
333 ingmar 1.1
334     # We expand KMEXTRA by adding CMakeLists.txt files
335 zlin 1.4 kmextra="${KMEXTRA}"
336 wired 1.23 [[ ${1} != fatal ]] && kmextra+=" ${KMEXTRA_NONFATAL}"
337 zlin 1.4 for i in ${kmextra}; do
338 wired 1.23 kmextra_expanded+=" ${i}"
339 ingmar 1.1 j=$(dirname ${i})
340     while [[ ${j} != "." ]]; do
341 wired 1.23 kmextra_expanded+=" ${j}/CMakeLists.txt";
342 ingmar 1.1 j=$(dirname ${j})
343     done
344     done
345    
346     # Expand KMMODULE
347 scarabeus 1.11 if [[ -n ${KMMODULE} ]]; then
348 ingmar 1.1 kmmodule_expanded="${KMMODULE}"
349     j=$(dirname ${KMMODULE})
350     while [[ ${j} != "." ]]; do
351 wired 1.23 kmmodule_expanded+=" ${j}/CMakeLists.txt";
352 scarabeus 1.11 j=$(dirname ${j})
353 ingmar 1.1 done
354     fi
355    
356     # Expand KMCOMPILEONLY
357     for i in ${KMCOMPILEONLY}; do
358 wired 1.23 kmcompileonly_expanded+=" ${i}"
359 ingmar 1.1 j=$(dirname ${i})
360     while [[ ${j} != "." ]]; do
361 wired 1.23 kmcompileonly_expanded+=" ${j}/CMakeLists.txt";
362 ingmar 1.1 j=$(dirname ${j})
363     done
364     done
365    
366     debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmextra_expanded: ${kmextra_expanded}"
367     debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmmodule_expanded: ${kmmodule_expanded}"
368     debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmcompileonly_expanded: ${kmcompileonly_expanded}"
369    
370     # Create final list of stuff to extract
371 scarabeus 1.12 # We append topdir only when specified (usually for tarballs)
372 ingmar 1.1 for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \
373     ${KMEXTRACTONLY}
374     do
375 abcd 1.54 extractlist+=" ${topdir}${i}"
376 ingmar 1.1 done
377    
378     echo ${extractlist}
379     }
380    
381 scarabeus 1.9 # @FUNCTION: kde4-meta_src_prepare
382 ingmar 1.1 # @DESCRIPTION:
383 scarabeus 1.9 # Meta-package build system configuration handling - commenting out targets, etc..
384     kde4-meta_src_prepare() {
385 ingmar 1.1 debug-print-function ${FUNCNAME} "$@"
386    
387 scarabeus 1.9 kde4-meta_change_cmakelists
388     kde4-base_src_prepare
389 ingmar 1.1 }
390    
391 scarabeus 1.51 # @FUNCTION: _change_cmakelists_parent_dirs
392     # @DESCRIPTION:
393     # Adjust CMakeLists.txt to shadow subdirectories
394     # that are not required for the build.
395 ingmar 1.1 _change_cmakelists_parent_dirs() {
396     debug-print-function ${FUNCNAME} "$@"
397    
398     local _olddir _dir
399     _dir="${S}"/${1}
400 scarabeus 1.51 until [[ ${_dir} == ${S} ]]; do
401 ingmar 1.6 _olddir=$(basename "${_dir}")
402     _dir=$(dirname "${_dir}")
403 ingmar 1.1 debug-print "${LINENO}: processing ${_dir} CMakeLists.txt searching for ${_olddir}"
404     if [[ -f ${_dir}/CMakeLists.txt ]]; then
405 ingmar 1.6 sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${_olddir}[[:space:]]*)/s/#DONOTCOMPILE //g" \
406     -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${_olddir}[[:space:]]*)/s/#DONOTCOMPILE //g" \
407     -i ${_dir}/CMakeLists.txt || die "${LINENO}: died in ${FUNCNAME} while processing ${_dir}"
408 ingmar 1.1 fi
409     done
410     }
411    
412 scarabeus 1.9 # @FUNCTION: kde4-meta_change_cmakelists
413     # @DESCRIPTION:
414 scarabeus 1.32 # Adjust CMakeLists.txt to comply to our splitting.
415 ingmar 1.1 kde4-meta_change_cmakelists() {
416 scarabeus 1.11 debug-print-function ${FUNCNAME} "$@"
417 ingmar 1.1
418     pushd "${S}" > /dev/null
419    
420     comment_all_add_subdirectory ./
421    
422     # Restore "add_subdirectory( cmake )" in ${S}/CMakeLists.txt
423 scarabeus 1.27 if [[ -f CMakeLists.txt ]]; then
424 ingmar 1.6 sed -e '/add_subdirectory[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \
425     -e '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \
426 scarabeus 1.27 -i CMakeLists.txt || die "${LINENO}: cmake sed died"
427 ingmar 1.1 fi
428    
429 johu 1.65 # Restore "add_subdirectory( ${ ..." (this is done in kdesdk)
430     if [[ -f CMakeLists.txt ]]; then
431     sed -e '/add_subdirectory[[:space:]]*([[:space:]]*\${/s/^#DONOTCOMPILE //' \
432     -e '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*\${/s/^#DONOTCOMPILE //' \
433     -i CMakeLists.txt || die "${LINENO}: cmake sed died"
434     fi
435    
436 ingmar 1.1 if [[ -z ${KMNOMODULE} ]]; then
437     # Restore "add_subdirectory" in $KMMODULE subdirectories
438 scarabeus 1.27 find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | \
439     xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
440     die "${LINENO}: died in KMMODULE section"
441 ingmar 1.1 _change_cmakelists_parent_dirs ${KMMODULE}
442     fi
443    
444 scarabeus 1.12 local i
445    
446     # KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY
447     for i in ${KMEXTRACTONLY}; do
448 scarabeus 1.27 if [[ -d ${i} && -f ${i}/../CMakeLists.txt ]]; then
449     sed -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" \
450     -i ${i}/../CMakeLists.txt || \
451 scarabeus 1.12 die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}"
452     fi
453     done
454    
455 ingmar 1.1 # KMCOMPILEONLY
456     for i in ${KMCOMPILEONLY}; do
457     debug-print "${LINENO}: KMCOMPILEONLY, processing ${i}"
458     # Uncomment "add_subdirectory" instructions inside $KMCOMPILEONLY, then comment "install" instructions.
459     find "${S}"/${i} -name CMakeLists.txt -print0 | \
460     xargs -0 sed -i \
461     -e 's/^#DONOTCOMPILE //g' \
462 kensington 1.70 -e '/install(.*)/I{s/^/#DONOTINSTALL /;}' \
463     -e '/^install(/,/)/I{s/^/#DONOTINSTALL /;}' \
464 ingmar 1.1 -e '/kde4_install_icons(.*)/{s/^/#DONOTINSTALL /;}' || \
465     die "${LINENO}: sed died in the KMCOMPILEONLY section while processing ${i}"
466     _change_cmakelists_parent_dirs ${i}
467     done
468    
469     # KMEXTRA section
470     for i in ${KMEXTRA}; do
471     debug-print "${LINENO}: KMEXTRA section, processing ${i}"
472 zlin 1.4 find "${S}"/${i} -name CMakeLists.txt -print0 | \
473     xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
474     die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
475     _change_cmakelists_parent_dirs ${i}
476     done
477     # KMEXTRA_NONFATAL section
478     for i in ${KMEXTRA_NONFATAL}; do
479 ingmar 1.1 if [[ -d "${S}"/${i} ]]; then
480     find "${S}"/${i} -name CMakeLists.txt -print0 | \
481     xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
482 scarabeus 1.27 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
483 ingmar 1.1 _change_cmakelists_parent_dirs ${i}
484     fi
485     done
486    
487     case ${KMNAME} in
488 kensington 1.71 kde-workspace)
489 scarabeus 1.9 # COLLISION PROTECT section
490     # Install the startkde script just once, as a part of kde-base/kdebase-startkde,
491     # not as a part of every package.
492 scarabeus 1.27 if [[ ${PN} != kdebase-startkde && -f CMakeLists.txt ]]; then
493 scarabeus 1.9 # The startkde script moved to kdebase-workspace for KDE4 versions > 3.93.0.
494 scarabeus 1.27 sed -e '/startkde/s/^/#DONOTINSTALL /' \
495     -i CMakeLists.txt || die "${LINENO}: sed died in the kdebase-startkde collision prevention section"
496 scarabeus 1.9 fi
497 dilfridge 1.59 # Remove workspace target prefix in order to get direct linking to workspace libs
498     sed -e '/set(KDE4WORKSPACE_TARGET_PREFIX/s/^/#OVERRIDE /' \
499     -i CMakeLists.txt || die "${LINENO}: sed died in KDE4WORKSPACE_TARGET_PREFIX removal section"
500 scarabeus 1.9 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82
501 scarabeus 1.11 if [[ ${PN} != libkworkspace ]]; then
502 scarabeus 1.27 sed -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \
503 alexxy 1.57 -i CMakeLists.txt || die "${LINENO}: sed died in kde-workspace strip config install and fix EXPORT section"
504     fi
505     if [[ ${PN} != plasma-workspace ]]; then
506     sed -e '/KActivities/s/REQUIRED//' \
507     -i CMakeLists.txt || die "${LINENO}: sed died in kde-workspace dep reduction section"
508 scarabeus 1.9 fi
509 dilfridge 1.61 if [[ "${PN}" != "kwin" ]]; then
510     sed -i -e "/^ macro_log_feature(OPENGL_OR_ES_FOUND/s/TRUE/FALSE/" \
511     "${S}"/CMakeLists.txt || die "${LINENO}: sed died removing kde-workspace opengl dependency"
512     fi
513 scarabeus 1.9 ;;
514 abcd 1.53 kdebase-runtime | kde-runtime)
515 scarabeus 1.9 # COLLISION PROTECT section
516     # Only install the kde4 script as part of kde-base/kdebase-data
517 scarabeus 1.27 if [[ ${PN} != kdebase-data && -f CMakeLists.txt ]]; then
518     sed -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
519     -i CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
520 scarabeus 1.9 fi
521     ;;
522 scarabeus 1.27 kdenetwork)
523     # Disable hardcoded kdepimlibs check
524     sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \
525     -i CMakeLists.txt || die "failed to disable hardcoded checks"
526     ;;
527 scarabeus 1.9 kdepim)
528 reavertm 1.33 # Disable hardcoded checks
529     sed -r -e '/find_package\(KdepimLibs/s/REQUIRED//' \
530     -e '/find_package\((KdepimLibs|Boost|QGpgme|Akonadi|ZLIB|Strigi|SharedDesktopOntologies|Soprano|Nepomuk)/{/macro_optional_/!s/find/macro_optional_&/}' \
531     -e '/macro_log_feature\((Boost|QGPGME|Akonadi|ZLIB|STRIGI|SHAREDDESKTOPONTOLOGIES|Soprano|Nepomuk)_FOUND/s/ TRUE / FALSE /' \
532 abcd 1.58 -e 's/if[[:space:]]*([[:space:]]*BUILD_.*)[[:space:]]*/if(1) # &/' \
533     -e 's/if[[:space:]]*([[:space:]]*[[:alnum:]]*_FOUND[[:space:]]*)[[:space:]]*$/if(1) # &/' \
534 reavertm 1.33 -i CMakeLists.txt || die "failed to disable hardcoded checks"
535 reavertm 1.34 # Disable broken or redundant build logic
536 abcd 1.58 if use_if_iuse kontact || [[ ${PN} = kontact ]]; then
537     sed -e 's/if[[:space:]]*([[:space:]]*BUILD_.*)[[:space:]]*$/if(1) # &/' \
538     -e 's/if[[:space:]]*([[:space:]]*[[:alnum:]]*_FOUND[[:space:]]*)[[:space:]]*$/if(1) # &/' \
539 reavertm 1.34 -i kontact/plugins/CMakeLists.txt || die 'failed to override build logic'
540     fi
541 alexxy 1.69 case ${PV} in
542     4.4*)
543     case ${PN} in
544     kalarm|kmailcvt|kontact|korganizer|korn)
545     sed -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \
546     -e '/add_custom_target(kmail_xml /,/)/p' \
547     -i kmail/CMakeLists.txt || die "uncommenting xml failed"
548     _change_cmakelists_parent_dirs kmail
549     ;;
550     esac
551 reavertm 1.33 ;;
552 alexxy 1.69 esac
553 ingmar 1.6 ;;
554 scarabeus 1.17 kdewebdev)
555 reavertm 1.33 # Disable hardcoded checks
556 scarabeus 1.17 sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \
557 scarabeus 1.20 -e 's/find_package(LibXml2 REQUIRED)/macro_optional_find_package(LibXml2)/' \
558     -e 's/find_package(LibXslt REQUIRED)/macro_optional_find_package(LibXslt)/' \
559     -e 's/find_package(Boost REQUIRED)/macro_optional_find_package(Boost)/' \
560 scarabeus 1.17 -i CMakeLists.txt || die "failed to disable hardcoded checks"
561     ;;
562 ingmar 1.1 esac
563    
564     popd > /dev/null
565     }
566    
567     # @FUNCTION: kde4-meta_src_configure
568     # @DESCRIPTION:
569 scarabeus 1.9 # Currently just calls its equivalent in kde4-base.eclass(5). Use this one in split
570 ingmar 1.1 # ebuilds.
571     kde4-meta_src_configure() {
572 scarabeus 1.11 debug-print-function ${FUNCNAME} "$@"
573 ingmar 1.1
574 abcd 1.30 # backwards-compatibility: make mycmakeargs an array, if it isn't already
575 abcd 1.31 if [[ $(declare -p mycmakeargs 2>&-) != "declare -a mycmakeargs="* ]]; then
576 abcd 1.30 mycmakeargs=(${mycmakeargs})
577     fi
578    
579 scarabeus 1.17 # Set some cmake default values here (usually workarounds for automagic deps)
580     case ${KMNAME} in
581     kdewebdev)
582 abcd 1.30 mycmakeargs=(
583 scarabeus 1.17 -DWITH_KdepimLibs=OFF
584     -DWITH_LibXml2=OFF
585     -DWITH_LibXslt=OFF
586     -DWITH_Boost=OFF
587     -DWITH_LibTidy=OFF
588 abcd 1.30 "${mycmakeargs[@]}"
589     )
590 scarabeus 1.17 ;;
591     esac
592    
593 ingmar 1.1 kde4-base_src_configure
594     }
595    
596 scarabeus 1.9 # @FUNCTION: kde4-meta_src_compile
597 ingmar 1.1 # @DESCRIPTION:
598 scarabeus 1.9 # General function for compiling split KDE4 applications.
599     # Overrides kde4-base_src_compile.
600     kde4-meta_src_compile() {
601 scarabeus 1.11 debug-print-function ${FUNCNAME} "$@"
602 ingmar 1.1
603 wired 1.23 kde4-base_src_compile "$@"
604 ingmar 1.1 }
605    
606     # @FUNCTION: kde4-meta_src_test
607     # @DESCRIPTION:
608 abcd 1.30 # Currently just calls its equivalent in kde4-base.eclass(5) if
609     # I_KNOW_WHAT_I_AM_DOING is set. Use this in split ebuilds.
610 ingmar 1.1 kde4-meta_src_test() {
611     debug-print-function $FUNCNAME "$@"
612    
613 abcd 1.30 if [[ $I_KNOW_WHAT_I_AM_DOING ]]; then
614     kde4-base_src_test
615     else
616     einfo "Tests disabled"
617     fi
618 ingmar 1.1 }
619    
620     # @FUNCTION: kde4-meta_src_install
621     # @DESCRIPTION:
622     # Function for installing KDE4 split applications.
623     kde4-meta_src_install() {
624     debug-print-function $FUNCNAME "$@"
625    
626 reavertm 1.37 # Search ${S}/${KMMODULE} and install common documentation files found
627 ingmar 1.1 local doc
628 reavertm 1.37 for doc in "${S}/${KMMODULE}"/{AUTHORS,CHANGELOG,ChangeLog*,README*,NEWS,TODO,HACKING}; do
629 reavertm 1.38 [[ -f "${doc}" ]] && [[ -s "${doc}" ]] && dodoc "${doc}"
630 ingmar 1.1 done
631    
632 reavertm 1.35 kde4-base_src_install
633 ingmar 1.1 }
634    
635 scarabeus 1.51 # @FUNCTION: kde4-meta_pkg_preinst
636     # @DESCRIPTION:
637     # Invoke its equivalent in kde4-base.eclass.
638     kde4-meta_pkg_preinst() {
639     debug-print-function ${FUNCNAME} "$@"
640    
641     kde4-base_pkg_preinst
642     }
643    
644 ingmar 1.1 # @FUNCTION: kde4-meta_pkg_postinst
645     # @DESCRIPTION:
646 scarabeus 1.28 # Invoke kbuildsycoca4.
647 ingmar 1.1 kde4-meta_pkg_postinst() {
648 scarabeus 1.11 debug-print-function ${FUNCNAME} "$@"
649    
650 ingmar 1.1 kde4-base_pkg_postinst
651     }
652    
653     # @FUNCTION: kde4-meta_pkg_postrm
654     # @DESCRIPTION:
655     # Currently just calls its equivalent in kde4-base.eclass(5). Use this in split
656     # ebuilds.
657     kde4-meta_pkg_postrm() {
658 scarabeus 1.11 debug-print-function ${FUNCNAME} "$@"
659    
660 ingmar 1.1 kde4-base_pkg_postrm
661     }
662 kensington 1.70
663     fi

  ViewVC Help
Powered by ViewVC 1.1.20