/[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.3 Revision 1.8
1# Copyright 1999-2008 Gentoo Foundation 1# Copyright 1999-2008 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.3 2008/02/24 21:45:39 keytoaster Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.8 2009/01/03 18:20:00 scarabeus 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.
15# NOTE: This eclass uses the SLOT dependencies from EAPI="1" or compatible, 15# NOTE: This eclass uses the SLOT dependencies from EAPI="1" or compatible,
16# hence you must define EAPI="1" in the ebuild, before inheriting any eclasses. 16# hence you must define EAPI="1" in the ebuild, before inheriting any eclasses.
17 17
18inherit multilib kde4-functions kde4-base 18inherit multilib kde4-functions kde4-base
19 19
20case "${EAPI}" in
21 2)
22 EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm
23 ;;
24 *)
20EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_test src_install pkg_postinst pkg_postrm 25 EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_test src_install pkg_postinst pkg_postrm
26 ;;
27esac
21 28
22if [[ -z ${KMNAME} ]]; then 29if [[ -z ${KMNAME} ]]; then
23 die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild" 30 die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild"
24fi 31fi
25 32
26case ${KDEBASE} in 33case ${KDEBASE} in
27 kde-base) HOMEPAGE="http://www.kde.org/" 34 kde-base) HOMEPAGE="http://www.kde.org/"
28 LICENSE="GPL-2" ;; 35 LICENSE="GPL-2" ;;
29 koffice) HOMEPAGE="http://www.koffice.org/" 36 koffice) HOMEPAGE="http://www.koffice.org/"
30 LICENSE="GPL-2" ;; 37 LICENSE="GPL-2" ;;
31 *) die "KDEBASE=${KDEBASE} is unsupported." ;;
32esac 38esac
33 39
34debug-print "${BASH_SOURCE} ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - before blockers" 40debug-print "${BASH_SOURCE} ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - before blockers"
35debug-print "${BASH_SOURCE} ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - before blockers" 41debug-print "${BASH_SOURCE} ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - before blockers"
36 42
37# Add a blocker on the package we're derived from 43# Add a blocker on the package we're derived from
44if [[ -n ${KDEBASE} ]]; then
38DEPEND="${DEPEND} !$(get-parent-package ${CATEGORY}/${PN}):${SLOT}" 45 DEPEND="${DEPEND} !$(get-parent-package ${CATEGORY}/${PN}):${SLOT}"
39RDEPEND="${RDEPEND} !$(get-parent-package ${CATEGORY}/${PN}):${SLOT}" 46 RDEPEND="${RDEPEND} !$(get-parent-package ${CATEGORY}/${PN}):${SLOT}"
47fi
40 48
41debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after blockers" 49debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after blockers"
42debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after blockers" 50debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after blockers"
43 51
44# Add dependencies that all packages in a certain module share. 52# Add dependencies that all packages in a certain module share.
46 kdebase|kdebase-workspace|kdebase-runtime) 54 kdebase|kdebase-workspace|kdebase-runtime)
47 DEPEND="${DEPEND} >=kde-base/qimageblitz-0.0.4" 55 DEPEND="${DEPEND} >=kde-base/qimageblitz-0.0.4"
48 RDEPEND="${RDEPEND} >=kde-base/qimageblitz-0.0.4" 56 RDEPEND="${RDEPEND} >=kde-base/qimageblitz-0.0.4"
49 ;; 57 ;;
50 kdepim) 58 kdepim)
59 DEPEND="${DEPEND} dev-libs/boost app-office/akonadi-server"
60 RDEPEND="${RDEPEND} dev-libs/boost"
51 if [[ ${PN} != kode ]]; then 61 if [[ ${PN} != kode ]]; then
52 DEPEND="${DEPEND} >=kde-base/kode-${PV}:${SLOT}" 62 DEPEND="${DEPEND} >=kde-base/kode-${PV}:${SLOT}"
53 RDEPEND="${RDEPEND} >=kde-base/kode-${PV}:${SLOT}" 63 RDEPEND="${RDEPEND} >=kde-base/kode-${PV}:${SLOT}"
54 fi 64 fi
55 case ${PN} in 65 case ${PN} in
56 akregator|kaddressbook|kmail|kmobiletools|knode|knotes|korganizer|ktimetracker) 66 akregator|kaddressbook|kjots|kmail|kmobiletools|knode|knotes|korganizer|ktimetracker)
57 IUSE="+kontact" 67 IUSE="+kontact"
58 DEPEND="${DEPEND} kontact? ( >=kde-base/kontact-${PV}:${SLOT} )" 68 DEPEND="${DEPEND} kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT} )"
59 RDEPEND="${RDEPEND} kontact? ( >=kde-base/kontact-${PV}:${SLOT} )" 69 RDEPEND="${RDEPEND} kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT} )"
60 ;; 70 ;;
61 esac 71 esac
62 ;; 72 ;;
63 kdegames) 73 kdegames)
64 if [[ ${PN} != "libkdegames" ]]; then 74 if [[ ${PN} != "libkdegames" ]]; then
139# This function unpacks the source for split ebuilds. See also 149# This function unpacks the source for split ebuilds. See also
140# kde4-meta-src_extract. 150# kde4-meta-src_extract.
141kde4-meta_src_unpack() { 151kde4-meta_src_unpack() {
142 debug-print-function ${FUNCNAME} "$@" 152 debug-print-function ${FUNCNAME} "$@"
143 153
144 if [[ ${KMNAME} = kdepim ]] && \
145 has kontact ${IUSE//+} && \
146 use kontact; then
147 KMEXTRA="${KMEXTRA} kontact/plugins/${PLUGINNAME:-${PN}}"
148 KMEXTRACTONLY="${KMEXTRACTONLY} kontact/interfaces/"
149 fi
150
151 kde4-meta_src_extract 154 kde4-meta_src_extract
152 kde4-meta_change_cmakelists 155 kde4-meta_change_cmakelists
153} 156}
154 157
155# @FUNCTION: kde4-meta_src_extract 158# @FUNCTION: kde4-meta_src_extract
156# @DESCRIPTION: 159# @DESCRIPTION:
157# A function to unpack the source for a split KDE ebuild. 160# A function to unpack the source for a split KDE ebuild.
158# Also see KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and KMTARPARAMS. 161# Also see KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and KMTARPARAMS.
159kde4-meta_src_extract() { 162kde4-meta_src_extract() {
160 local tarball tarfile f extractlist 163 local abort tarball tarfile f extractlist
161 tarball="${KMNAME}-${PV}.tar.bz2" 164 tarball="${KMNAME}-${PV}.tar.bz2"
162 tarfile="${DISTDIR}"/${tarball} 165 tarfile="${DISTDIR}"/${tarball}
163 166
164 einfo "Unpacking parts of ${tarball} to ${WORKDIR}" 167 echo "Unpacking parts of ${tarball} to ${WORKDIR}"
165 168
166 kde4-meta_create_extractlists 169 kde4-meta_create_extractlists
167 170
168 for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake \ 171 for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake \
169 AUTHORS COPYING INSTALL README NEWS ChangeLog 172 AUTHORS COPYING INSTALL README NEWS ChangeLog
172 done 175 done
173 extractlist="${extractlist} $(__list_needed_subdirectories)" 176 extractlist="${extractlist} $(__list_needed_subdirectories)"
174 KMTARPARAMS="${KMTARPARAMS} -j" 177 KMTARPARAMS="${KMTARPARAMS} -j"
175 178
176 pushd "${WORKDIR}" > /dev/null 179 pushd "${WORKDIR}" > /dev/null
180 [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf $tarfile $KMTARPARAMS $extractlist >&2
177 tar -xpf $tarfile $KMTARPARAMS $extractlist 2> /dev/null 181 tar -xpf $tarfile $KMTARPARAMS $extractlist 2> /dev/null
178 182
179 # Default $S is based on $P; rename the extracted directory to match $S 183 # Default $S is based on $P; rename the extracted directory to match $S
180 mv ${KMNAME}-${PV} ${P} || die "Died while moving \"${KMNAME}-${PV}\" to \"${P}\"" 184 mv ${KMNAME}-${PV} ${P} || die "Died while moving \"${KMNAME}-${PV}\" to \"${P}\""
181 185
182 popd > /dev/null 186 popd > /dev/null
187
188 if [[ -n ${KDE4_STRICTER} ]]; then
189 for f in $(__list_needed_subdirectories fatal); do
190 if [[ ! -e ${S}/${f#*/} ]]; then
191 eerror "'${f#*/}' is missing"
192 abort=true
193 fi
194 done
195 [[ -n ${abort} ]] && die "There were missing files."
196 fi
197
183 kde4-base_src_unpack 198 kde4-base_src_unpack
184} 199}
185 200
186# Create lists of files and subdirectories to extract. 201# Create lists of files and subdirectories to extract.
187# Also see the descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and KMTARPARAMS. 202# Also see the descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and KMTARPARAMS.
189 debug-print-function ${FUNCNAME} "$@" 204 debug-print-function ${FUNCNAME} "$@"
190 205
191 if has htmlhandbook ${IUSE//+} && use htmlhandbook; then 206 if has htmlhandbook ${IUSE//+} && use htmlhandbook; then
192 # We use the basename of $KMMODULE because $KMMODULE can contain 207 # We use the basename of $KMMODULE because $KMMODULE can contain
193 # the path to the module subdirectory. 208 # the path to the module subdirectory.
194 KMEXTRA="${KMEXTRA} doc/${KMMODULE##*/}" 209 KMEXTRA_NONFATAL="${KMEXTRA_NONFATAL} doc/${KMMODULE##*/}"
195 fi 210 fi
196 211
197 # Add some CMake-files to KMEXTRACTONLY. 212 # Add some CMake-files to KMEXTRACTONLY.
198 # Note that this actually doesn't include KMEXTRA handling. 213 # Note that this actually doesn't include KMEXTRA handling.
199 # In those cases you should care to add the relevant files to KMEXTRACTONLY 214 # In those cases you should care to add the relevant files to KMEXTRACTONLY
219 if [[ ${PN} != "libkdegames" ]]; then 234 if [[ ${PN} != "libkdegames" ]]; then
220 KMEXTRACTONLY="${KMEXTRACTONLY} 235 KMEXTRACTONLY="${KMEXTRACTONLY}
221 libkdegames" 236 libkdegames"
222 fi 237 fi
223 ;; 238 ;;
239 kdepim)
240 KMEXTRACTONLY="${KMEXTRACTONLY}
241 kleopatra/ConfigureChecks.cmake"
242 if has kontact ${IUSE//+} && use kontact; then
243 KMEXTRA="${KMEXTRA} kontact/plugins/${PLUGINNAME:-${PN}}"
244 KMEXTRACTONLY="${KMEXTRACTONLY} kontactinterfaces/"
245 fi
246 ;;
224 koffice) 247 koffice)
225 KMEXTRACTONLY="${KMEXTRACTONLY} 248 KMEXTRACTONLY="${KMEXTRACTONLY}
226 config-endian.h.cmake 249 config-endian.h.cmake
227 filters/config-filters.h.cmake 250 filters/config-filters.h.cmake
228 config-openexr.h.cmake 251 config-openexr.h.cmake
230 config-prefix.h.cmake" 253 config-prefix.h.cmake"
231 ;; 254 ;;
232 esac 255 esac
233 # Don't install cmake modules for split ebuilds to avoid collisions. 256 # Don't install cmake modules for split ebuilds to avoid collisions.
234 case ${KMNAME} in 257 case ${KMNAME} in
235 kdebase-workspace|kdebase-runtime|kdepim|kdegames) 258 kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics|kdepim)
236 if [[ ${PN} != "libkdegames" ]]; then 259 case ${PN} in
260 libkdegames|libkdeedu|marble)
261 KMEXTRA="${KMEXTRA}
262 cmake/modules/"
263 ;;
264
265 *)
237 KMCOMPILEONLY="${KMCOMPILEONLY} 266 KMCOMPILEONLY="${KMCOMPILEONLY}
238 cmake/modules/" 267 cmake/modules/"
239 else 268 ;;
240 KMEXTRA="${KMEXTRA} 269 esac
241 cmake/modules/"
242 fi
243 ;; 270 ;;
244 esac 271 esac
245 272
246 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}" 273 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}"
247} 274}
248 275
249__list_needed_subdirectories() { 276__list_needed_subdirectories() {
250 local i j kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist topdir 277 local i j kmextra kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist topdir
251 278
252 # We expand KMEXTRA by adding CMakeLists.txt files 279 # We expand KMEXTRA by adding CMakeLists.txt files
253 for i in ${KMEXTRA}; do 280 kmextra="${KMEXTRA}"
281 [[ ${1} != fatal ]] && kmextra="${kmextra} ${KMEXTRA_NONFATAL}"
282 for i in ${kmextra}; do
254 kmextra_expanded="${kmextra_expanded} ${i}" 283 kmextra_expanded="${kmextra_expanded} ${i}"
255 j=$(dirname ${i}) 284 j=$(dirname ${i})
256 while [[ ${j} != "." ]]; do 285 while [[ ${j} != "." ]]; do
257 kmextra_expanded="${kmextra_expanded} ${j}/CMakeLists.txt"; 286 kmextra_expanded="${kmextra_expanded} ${j}/CMakeLists.txt";
258 j=$(dirname ${j}) 287 j=$(dirname ${j})
282 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmextra_expanded: ${kmextra_expanded}" 311 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmextra_expanded: ${kmextra_expanded}"
283 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmmodule_expanded: ${kmmodule_expanded}" 312 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmmodule_expanded: ${kmmodule_expanded}"
284 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmcompileonly_expanded: ${kmcompileonly_expanded}" 313 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmcompileonly_expanded: ${kmcompileonly_expanded}"
285 314
286 315
287 case ${NEED_KDE} in 316 case ${PV} in
288 svn) : ;; 317 scm|9999*) : ;;
289 *) topdir="${KMNAME}-${PV}/" ;; 318 *) topdir="${KMNAME}-${PV}/" ;;
290 esac 319 esac
291 320
292 # Create final list of stuff to extract 321 # Create final list of stuff to extract
293 for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \ 322 for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \
297 done 326 done
298 327
299 echo ${extractlist} 328 echo ${extractlist}
300} 329}
301 330
331save_library_dependencies() {
332 local depsfile="${T}/${PN}:${SLOT}"
333
334 echo "Saving library dependendencies in ${depsfile##*/}"
335 echo "EXPORT_LIBRARY_DEPENDENCIES(\"${depsfile}\")" >> "${S}/CMakeLists.txt" || \
336 die "Failed to save the library dependencies."
337}
338
339install_library_dependencies() {
340 local depsfile="${T}/${PN}:${SLOT}"
341 echo "Installing library dependendencies as ${depsfile##*/}"
342 insinto /var/lib/kde
343 doins "${depsfile}" || die "Failed to install library dependencies."
344}
345
346load_library_dependencies() {
347 local pn i depsfile
348 echo "Injecting library dependendencies from '${KMLOADLIBS}'"
349
350 i=0
351 for pn in ${KMLOADLIBS} ; do
352 ((i++))
353 depsfile="/var/lib/kde/${pn}:${SLOT}"
354 [[ -r "${depsfile}" ]] || die "Depsfile '${depsfile}' not accessible. You probably need to reinstall ${pn}."
355 sed -i -e "${i}iINCLUDE(\"${depsfile}\")" "${S}/CMakeLists.txt" || \
356 die "Failed to include library dependencies for ${pn}"
357 done
358}
359
302# @FUNCTION: kde4-meta_src_compile 360# @FUNCTION: kde4-meta_src_compile
303# @DESCRIPTION: 361# @DESCRIPTION:
304# General function for compiling split KDE4 applications. 362# General function for compiling split KDE4 applications.
305kde4-meta_src_compile() { 363kde4-meta_src_compile() {
306 debug-print-function ${FUNCNAME} "$@" 364 debug-print-function ${FUNCNAME} "$@"
307 365
366 case "${EAPI}" in
367 2 | 2_pre3 | 2_pre2 | 2_pre1)
368 ;;
369 *)
308 kde4-meta_src_configure 370 kde4-base_meta_configure
371 ;;
372 esac
309 kde4-meta_src_make 373 kde4-meta_src_make
310} 374}
311 375
312_change_cmakelists_parent_dirs() { 376_change_cmakelists_parent_dirs() {
313 debug-print-function ${FUNCNAME} "$@" 377 debug-print-function ${FUNCNAME} "$@"
314 378
315 local _olddir _dir 379 local _olddir _dir
316 _dir="${S}"/${1} 380 _dir="${S}"/${1}
317 until [[ ${_dir} == "${S}" ]]; do 381 until [[ ${_dir} == "${S}" ]]; do
318 _olddir=$(basename ${_dir}) 382 _olddir=$(basename "${_dir}")
319 _dir=$(dirname ${_dir}) 383 _dir=$(dirname "${_dir}")
320 debug-print "${LINENO}: processing ${_dir} CMakeLists.txt searching for ${_olddir}" 384 debug-print "${LINENO}: processing ${_dir} CMakeLists.txt searching for ${_olddir}"
321 if [[ -f ${_dir}/CMakeLists.txt ]]; then 385 if [[ -f ${_dir}/CMakeLists.txt ]]; then
322 sed -i -e "/[[:space:]]*${_olddir}[[:space:]]*/s/^#DONOTCOMPILE //" ${_dir}/CMakeLists.txt || \ 386 sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${_olddir}[[:space:]]*)/s/#DONOTCOMPILE //g" \
387 -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${_olddir}[[:space:]]*)/s/#DONOTCOMPILE //g" \
323 die "${LINENO}: died in ${FUNCNAME} while processing ${_dir}" 388 -i ${_dir}/CMakeLists.txt || die "${LINENO}: died in ${FUNCNAME} while processing ${_dir}"
324 fi 389 fi
325 done 390 done
326} 391}
327 392
328kde4-meta_change_cmakelists() { 393kde4-meta_change_cmakelists() {
329 debug-print-function ${FUNCNAME} "$@" 394 debug-print-function ${FUNCNAME} "$@"
330 395
331 pushd "${S}" > /dev/null 396 pushd "${S}" > /dev/null
332 397
398 if [[ -n ${KMSAVELIBS} ]] ; then
399 save_library_dependencies
400 fi
401
402 if [[ -n ${KMLOADLIBS} ]] ; then
403 load_library_dependencies
404 fi
405
333 comment_all_add_subdirectory ./ 406 comment_all_add_subdirectory ./
334 407
335 # Restore "add_subdirectory( cmake )" in ${S}/CMakeLists.txt 408 # Restore "add_subdirectory( cmake )" in ${S}/CMakeLists.txt
336 if [[ -f "${S}"/CMakeLists.txt ]]; then 409 if [[ -f "${S}"/CMakeLists.txt ]]; then
337 sed -i -e '/ *cmake */s/^#DONOTCOMPILE //' "${S}"/CMakeLists.txt || die "${LINENO}: cmake sed died" 410 sed -e '/add_subdirectory[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \
411 -e '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \
412 -i "${S}"/CMakeLists.txt || die "${LINENO}: cmake sed died"
338 fi 413 fi
339 414
340 if [[ -z ${KMNOMODULE} ]]; then 415 if [[ -z ${KMNOMODULE} ]]; then
341 # Restore "add_subdirectory" in $KMMODULE subdirectories 416 # Restore "add_subdirectory" in $KMMODULE subdirectories
342 find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ 417 find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
360 done 435 done
361 436
362 # KMEXTRA section 437 # KMEXTRA section
363 for i in ${KMEXTRA}; do 438 for i in ${KMEXTRA}; do
364 debug-print "${LINENO}: KMEXTRA section, processing ${i}" 439 debug-print "${LINENO}: KMEXTRA section, processing ${i}"
365 # Ebuilds use KMEXTRA incorrectly to extract files which should be in $KMEXTRACTONLY 440 find "${S}"/${i} -name CMakeLists.txt -print0 | \
441 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
442 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
443 _change_cmakelists_parent_dirs ${i}
444 done
445 # KMEXTRA_NONFATAL section
446 for i in ${KMEXTRA_NONFATAL}; do
366 if [[ -d "${S}"/${i} ]]; then 447 if [[ -d "${S}"/${i} ]]; then
367 find "${S}"/${i} -name CMakeLists.txt -print0 | \ 448 find "${S}"/${i} -name CMakeLists.txt -print0 | \
368 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ 449 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
369 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}" 450 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
370 _change_cmakelists_parent_dirs ${i} 451 _change_cmakelists_parent_dirs ${i}
371 else
372 [[ ${i} == doc/* ]] || \
373 die "KMEXTRA should be used to compile and install subdirectories other than \$KMMODULE. Use KMEXTRACTONLY to extract some files."
374 fi
375 done
376
377 # Documentation section
378 if [[ -n ${docs} ]]; then
379 sed -i -e '/ *doc */s/^#DONOTCOMPILE //g' "${S}"/CMakeLists.txt || \
380 die "${LINENO}: sed died while uncommenting doc dir"
381
382 if [[ -f "${S}"/doc/CMakeLists.txt ]]; then
383 sed -i -e "/( *${KMMODULE##*/} *)/s/^#DONOTCOMPILE //g" "${S}"/doc/CMakeLists.txt \
384 || die "${LINENO}: sed died while uncommenting apps documentation in doc subdir "
385 fi
386 fi 452 fi
453 done
387 454
388 # KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY 455 # KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY
389 for i in ${KMEXTRACTONLY}; do 456 for i in ${KMEXTRACTONLY}; do
390 if [[ -d "${S}"/${i} && -f "${S}"/${i}/../CMakeLists.txt ]]; then 457 if [[ -d "${S}"/${i} && -f "${S}"/${i}/../CMakeLists.txt ]]; then
391 sed -i -e "/( *$(basename $i) *)/s/^/#DONOTCOMPILE /" "${S}"/${i}/../CMakeLists.txt || \ 458 sed -i -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" "${S}"/${i}/../CMakeLists.txt || \
392 die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}" 459 die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}"
393 fi 460 fi
394 done 461 done
395 462
396 # COLLISION PROTECT section
397 # Only install the startkde script as part of kde-base/kdebase-startkde,
398 # instead of with every package.
399 case ${KMNAME} in 463 case ${KMNAME} in
400 kdebase-workspace) 464 kdebase-workspace)
465 # COLLISION PROTECT section
466 # Only install the startkde script as part of kde-base/kdebase-startkde,
467 # instead of with every package.
401 if [[ ${PN} != "kdebase-startkde" && -f "${S}"/CMakeLists.txt ]]; then 468 if [[ ${PN} != "kdebase-startkde" && -f "${S}"/CMakeLists.txt ]]; then
402 case ${PV} in 469 case ${PV} in
403 *) # The startkde script moved to kdebase-workspace for KDE4 versions > 3.93.0. 470 *) # The startkde script moved to kdebase-workspace for KDE4 versions > 3.93.0.
404 sed -i -e '/startkde/s/^/#DONOTINSTALL /' "${S}"/CMakeLists.txt || \ 471 sed -i -e '/startkde/s/^/#DONOTINSTALL /' "${S}"/CMakeLists.txt || \
405 die "${LINENO}: sed died in the kdebase-startkde collision prevention section" 472 die "${LINENO}: sed died in the kdebase-startkde collision prevention section"
406 ;; 473 ;;
407 esac 474 esac
408 fi 475 fi
409 ;; 476 ;;
477 kdebase-runtime)
478 # COLLISION PROTECT section
479 # Only install the kde4 script as part of kde-base/kdebase-data
480 if [[ ${PN} != "kdebase-data" && -f "${S}"/CMakeLists.txt ]]; then
481 sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
482 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
483 fi
484 ;;
485 kdepim)
486 case ${PN} in
487 kaddressbook|kalarm|kmailcvt|kontact|korganizer|korn)
488 sed -i -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \
489 -e '/add_custom_target(kmail_xml /,/)/p' "${S}"/kmail/CMakeLists.txt || die "uncommenting xml failed"
490 _change_cmakelists_parent_dirs kmail
491 ;;
492 esac
493 ;;
494 kdeutils)
410 # This is sort of a hack to avoid patching 16 kdeutils packages with 495 # This is sort of a hack to avoid patching 16 kdeutils packages with
411 # r775410 from upstream trunk which makes blitz optional so superkaramba 496 # r775410 from upstream trunk which makes blitz optional so superkaramba
412 # only gets compiled when it is found. Bug #209324. Remove this no later 497 # only gets compiled when it is found. Bug #209324. Remove this no later
413 # than 4.1. 498 # than 4.1.
414 kdeutils)
415 if [[ ${PN} != superkaramba && ${SLOT} == kde-4 ]]; then 499 if [[ ${PN} != superkaramba && ${SLOT} == kde-4 ]]; then
416 sed -i -e '/find_package(Blitz REQUIRED)/d' "${S}"/CMakeLists.txt \ 500 sed -i -e '/find_package(Blitz REQUIRED)/d' "${S}"/CMakeLists.txt \
417 || die "${LINENO}: sed to remove dependency on Blitz failed." 501 || die "${LINENO}: sed to remove dependency on Blitz failed."
418 fi 502 fi
419 ;; 503 ;;
427 esac 511 esac
428 512
429 popd > /dev/null 513 popd > /dev/null
430} 514}
431 515
516# transition function so we will work with soon to come eclasses.
517kde4-meta_src_prepare() {
518 kde4-base_src_prepare
519}
520
432# @FUNCTION: kde4-meta_src_configure 521# @FUNCTION: kde4-meta_src_configure
433# @DESCRIPTION: 522# @DESCRIPTION:
434# Currently just calls its equivalent in kde4-base.eclass(5). Use this in split 523# Currently just calls its equivalent in kde4-base.eclass(5). Use this in split
435# ebuilds. 524# ebuilds.
436kde4-meta_src_configure() { 525kde4-meta_src_configure() {
465kde4-meta_src_install() { 554kde4-meta_src_install() {
466 debug-print-function $FUNCNAME "$@" 555 debug-print-function $FUNCNAME "$@"
467 556
468 kde4-meta_src_make_doc 557 kde4-meta_src_make_doc
469 cmake-utils_src_install 558 cmake-utils_src_install
559
560 if [[ -n ${KMSAVELIBS} ]] ; then
561 install_library_dependencies
562 fi
470} 563}
471 564
472# @FUNCTION: kde4-meta_src_make_doc 565# @FUNCTION: kde4-meta_src_make_doc
473# @DESCRIPTION: 566# @DESCRIPTION:
474# This function searches under ${S}/${KMMODULE}, 567# This function searches under ${S}/${KMMODULE},

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.20