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

Diff of /eclass/kde4-meta.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.57

  ViewVC Help
Powered by ViewVC 1.1.20