/[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.11 Revision 1.26
1# Copyright 1999-2009 Gentoo Foundation 1# Copyright 1999-2009 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.11 2009/03/01 11:44:09 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.26 2009/10/06 18:02:12 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.
18 18
19if [[ -z ${KMNAME} ]]; then 19if [[ -z ${KMNAME} ]]; then
20 die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild" 20 die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild"
21fi 21fi
22 22
23case ${KDEBASE} in 23# Add khelpcenter dependency when installing handbooks
24 kde-base) 24if [[ ${PN} != khelpcenter ]] && has handbook ${IUSE//+}; then
25 HOMEPAGE="http://www.kde.org/" 25 RDEPEND+=" handbook? ( >=kde-base/khelpcenter-${PV}:${SLOT}[kdeprefix=] )"
26 LICENSE="GPL-2" 26fi
27 ;;
28 koffice)
29 HOMEPAGE="http://www.koffice.org/"
30 LICENSE="GPL-2"
31 ;;
32esac
33 27
34# Add dependencies that all packages in a certain module share. 28# Add dependencies that all packages in a certain module share.
35case ${KMNAME} in 29case ${KMNAME} in
36 kdebase|kdebase-workspace|kdebase-runtime) 30 kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphics)
37 DEPEND="${DEPEND} >=kde-base/qimageblitz-0.0.4" 31 COMMONDEPEND+=" >=kde-base/qimageblitz-0.0.4"
38 RDEPEND="${RDEPEND} >=kde-base/qimageblitz-0.0.4"
39 ;; 32 ;;
40 kdepim) 33 kdenetwork)
41 DEPEND="${DEPEND} dev-libs/boost app-office/akonadi-server"
42 RDEPEND="${RDEPEND} dev-libs/boost"
43 if [[ ${PN} != kode ]]; then
44 DEPEND="${DEPEND} >=kde-base/kode-${PV}:${SLOT}[kdeprefix=]" 34 COMMONDEPEND+=" >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]"
45 RDEPEND="${RDEPEND} >=kde-base/kode-${PV}:${SLOT}[kdeprefix=]" 35 ;;
46 fi 36 kdepim|kdepim-runtime)
37 COMMONDEPEND+="
38 dev-libs/boost
39 >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]
40 "
47 case ${PN} in 41 case ${PN} in
48 akregator|kaddressbook|kjots|kmail|kmobiletools|knode|knotes|korganizer|ktimetracker) 42 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker)
49 IUSE="+kontact" 43 IUSE+=" +kontact"
50 DEPEND="${DEPEND} kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] )" 44 if ! slot_is_at_least 4.4 ${SLOT} || [[ ${SLOT} == 4.4 && ${PV} < 4.3.68 ]]; then
51 RDEPEND="${RDEPEND} kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] )" 45 RDEPEND+=" kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] )"
46 fi
52 ;; 47 ;;
53 esac 48 esac
54 ;; 49 ;;
55 kdegames) 50 kdegames)
56 if [[ ${PN} != libkdegames ]]; then 51 if [[ ${PN} != libkdegames ]]; then
57 DEPEND="${DEPEND} >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=]" 52 COMMONDEPEND+=" >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=] "
58 RDEPEND="${RDEPEND} >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=]"
59 fi 53 fi
60 ;; 54 ;;
61 koffice) 55 koffice)
62 [[ ${PN} != koffice-data ]] && IUSE="debug" 56 [[ ${PN} != koffice-data ]] && IUSE+=" debug"
63 case ${PV} in 57 RDEPEND+="
64 9999*) DEPEND="${DEPEND} !app-office/${PN}:2" ;;
65 1.9*|2*) DEPEND="${DEPEND} !app-office/${PN}:live" ;;
66 esac
67 DEPEND="${DEPEND}
68 !app-office/${PN}:0 58 !app-office/${PN}:0
69 !app-office/koffice:0 59 !app-office/koffice:0
70 !app-office/koffice-meta:0" 60 !app-office/koffice-meta:0
71 case ${PN} in 61 "
72 koffice-data) 62 if has openexr ${IUSE//+}; then
73 DEPEND="${DEPEND} media-libs/lcms" 63 COMMONDEPEND+=" media-gfx/imagemagick[openexr?]"
74 RDEPEND="${RDEPEND} media-libs/lcms" 64 else
75 ;; 65 COMMONDEPEND+=" media-gfx/imagemagick"
76 *) 66 fi
77 DEPEND="${DEPEND} 67
68 COMMONDEPEND+="
78 dev-cpp/eigen:2 69 dev-cpp/eigen:2
79 media-gfx/imagemagick[openexr?]
80 media-libs/fontconfig 70 media-libs/fontconfig
81 media-libs/freetype:2 71 media-libs/freetype:2
82 " 72 "
83 RDEPEND="${DEPEND}"
84 if [[ ${PN} != koffice-libs && ${PN} != koffice-data ]]; then 73 if [[ ${PN} != koffice-libs && ${PN} != koffice-data ]]; then
85 DEPEND="${DEPEND} 74 COMMONDEPEND+=" >=app-office/koffice-libs-${PV}:${SLOT}"
86 >=app-office/koffice-libs-${PV}:${SLOT}[kdeprefix=]"
87 RDEPEND="${RDEPEND}
88 >=app-office/koffice-libs-${PV}:${SLOT}[kdeprefix=]"
89 fi 75 fi
90 ;;
91 esac
92 ;; 76 ;;
93esac 77esac
94 78
79DEPEND+=" ${COMMONDEPEND}"
80RDEPEND+=" ${COMMONDEPEND}"
81unset COMMONDEPEND
82
95debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after metapackage-specific dependencies" 83debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after metapackage-specific dependencies"
96debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-specific dependencies" 84debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-specific dependencies"
97 85
98# Useful to build kde4-meta style stuff from extragear/playground (plasmoids etc) 86# Useful to build kde4-meta style stuff from extragear/playground (plasmoids etc)
99case ${SLOT} in 87case ${BUILD_TYPE} in
100 live) 88 live)
101 case ${KMNAME} in 89 case ${KMNAME} in
102 extragear*|playground*) 90 extragear*|playground*)
103 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}" 91 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}"
92 ESVN_PROJECT="${KMNAME}${ESVN_PROJECT_SUFFIX}"
104 ;; 93 ;;
105 esac 94 esac
106 ;; 95 ;;
107esac 96esac
108 97
133 122
134# @ECLASS-VARIABLE: KMEXTRA 123# @ECLASS-VARIABLE: KMEXTRA
135# @DESCRIPTION: 124# @DESCRIPTION:
136# All subdirectories listed here will be extracted, compiled & installed. 125# All subdirectories listed here will be extracted, compiled & installed.
137# $KMMODULE is always added to $KMEXTRA. 126# $KMMODULE is always added to $KMEXTRA.
138# If the htmlhandbook USE-flag is set, and if this directory exists, 127# If the handbook USE-flag is set, and if this directory exists,
139# then "doc/$KMMODULE" is added to $KMEXTRA. In other cases, this should be 128# then "doc/$KMMODULE" is added to $KMEXTRA. In other cases, this should be
140# handled in the ebuild. 129# handled in the ebuild.
141# If the documentation is in a different subdirectory, you should add it to KMEXTRA. 130# If the documentation is in a different subdirectory, you should add it to KMEXTRA.
142 131
143# @ECLASS-VARIABLE: KMCOMPILEONLY 132# @ECLASS-VARIABLE: KMCOMPILEONLY
211 rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}cmake" "${S}" \ 200 rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}cmake" "${S}" \
212 || die "${ESVN}: can't export cmake files to '${S}'." 201 || die "${ESVN}: can't export cmake files to '${S}'."
213 fi 202 fi
214 # Copy all subdirectories 203 # Copy all subdirectories
215 for subdir in $(__list_needed_subdirectories); do 204 for subdir in $(__list_needed_subdirectories); do
216 targetdir="" 205 targetdir=""
217 if [[ $subdir = doc/* && ! -e "$ESVN_WC_PATH/$kmnamedir$subdir" ]]; then 206 if [[ $subdir = doc/* && ! -e "$ESVN_WC_PATH/$kmnamedir$subdir" ]]; then
218 continue 207 continue
219 fi 208 fi
220 209
221 [[ ${subdir%/} = */* ]] && targetdir=${subdir%/} && targetdir=${targetdir%/*} && mkdir -p "${S}/${targetdir}" 210 [[ ${subdir%/} = */* ]] && targetdir=${subdir%/} && targetdir=${targetdir%/*} && mkdir -p "${S}/${targetdir}"
222 rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}${subdir%/}" "${S}/${targetdir}" \ 211 rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}${subdir%/}" "${S}/${targetdir}" \
223 || die "${ESVN}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'." 212 || die "${ESVN}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'."
224 done 213 done
225 214
226 if [[ ${KMNAME} = kdebase-runtime && ${PN} != kdebase-data ]]; then 215 if [[ ${KMNAME} = kdebase-runtime && ${PN} != kdebase-data ]]; then
227 sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \ 216 sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
228 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed" 217 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
229 fi 218 fi
230 else 219 else
231 local abort tarball tarfile f extractlist moduleprefix 220 local abort tarball tarfile f extractlist moduleprefix postfix
232 221 case ${PV} in
222 4.3.85 | 4.3.9[0568])
223 # block for normally packed upstream unstable snapshots
224 KMTARPARAMS+=" --bzip2" # bz2
225 postfix="bz2"
226 ;;
227 4.3.[6-9]*)
228 KMTARPARAMS+=" --lzma" # lzma
229 postfix="lzma"
230 ;;
231 *)
232 KMTARPARAMS+=" --bzip2" # bz2
233 postfix="bz2"
234 ;;
235 esac
233 case $KMNAME in 236 case ${KMNAME} in
234 kdebase-apps) 237 kdebase-apps)
235 tarball="${KMNAME#-apps}-${PV}.tar.bz2" 238 # kdebase/apps -> kdebase-apps
239 tarball="kdebase-${PV}.tar.${postfix}"
240 # Go one level deeper for kdebase-apps in tarballs
241 moduleprefix=apps/
242 KMTARPARAMS+=" --transform=s|apps/||"
236 ;; 243 ;;
237 *) 244 *)
245 # Create tarball name from module name (this is the default)
238 tarball="${KMNAME}-${PV}.tar.bz2" 246 tarball="${KMNAME}-${PV}.tar.${postfix}"
239 ;; 247 ;;
240 esac 248 esac
249
250 # Full path to source tarball
241 tarfile="${DISTDIR}/${tarball}" 251 tarfile="${DISTDIR}/${tarball}"
252
253 # Detect real toplevel dir from tarball name - it will be used upon extraction
254 # and in __list_needed_subdirectories
255 topdir="${tarball%.tar.*}/"
242 256
243 ebegin "Unpacking parts of ${tarball} to ${WORKDIR}" 257 ebegin "Unpacking parts of ${tarball} to ${WORKDIR}"
244 258
245 kde4-meta_create_extractlists 259 kde4-meta_create_extractlists
246 260
247 for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake \ 261 for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake \
248 AUTHORS COPYING INSTALL README NEWS ChangeLog 262 AUTHORS COPYING INSTALL README NEWS ChangeLog
249 do 263 do
250 extractlist="${extractlist} ${KMNAME}-${PV}/${f}" 264 extractlist+=" ${topdir}${moduleprefix}${f}"
251 done 265 done
252 extractlist="${extractlist} $(__list_needed_subdirectories)" 266 extractlist+=" $(__list_needed_subdirectories)"
253 KMTARPARAMS="${KMTARPARAMS} -j"
254 267
255 pushd "${WORKDIR}" > /dev/null 268 pushd "${WORKDIR}" > /dev/null
256 [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} >&2 269 [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} >&2
257 tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null 270 tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null
258 271
259 # Default $S is based on $P; rename the extracted directory to match $S if necessary 272 # Default $S is based on $P; rename the extracted directory to match $S if necessary
260 mv ${KMNAME}-${PV} ${P} || die "Died while moving \"${KMNAME}-${PV}\" to \"${P}\"" 273 mv ${topdir} ${P} || die "Died while moving \"${topdir}\" to \"${P}\""
261 274
262 popd > /dev/null 275 popd > /dev/null
263 276
264 eend $? 277 eend $?
265 278
273 abort=true 286 abort=true
274 fi 287 fi
275 done 288 done
276 [[ -n ${abort} ]] && die "There were missing files." 289 [[ -n ${abort} ]] && die "There were missing files."
277 fi 290 fi
291
292 # We don't need it anymore
293 unset topdir
278 fi 294 fi
279} 295}
280 296
281# @FUNCTION: kde4-meta_create_extractlists 297# @FUNCTION: kde4-meta_create_extractlists
282# @DESCRIPTION: 298# @DESCRIPTION:
284# Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, 300# Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY,
285# KMEXTRACTONLY and KMTARPARAMS. 301# KMEXTRACTONLY and KMTARPARAMS.
286kde4-meta_create_extractlists() { 302kde4-meta_create_extractlists() {
287 debug-print-function ${FUNCNAME} "$@" 303 debug-print-function ${FUNCNAME} "$@"
288 304
305 # TODO change to KMEXTRA for more strict check
289 if has htmlhandbook ${IUSE//+} && use htmlhandbook; then 306 if has handbook ${IUSE//+} && use handbook && [[ -n ${KMMODULE} ]]; then
290 # We use the basename of $KMMODULE because $KMMODULE can contain 307 # We use the basename of $KMMODULE because $KMMODULE can contain
291 # the path to the module subdirectory. 308 # the path to the module subdirectory.
292 KMEXTRA_NONFATAL="${KMEXTRA_NONFATAL} doc/${KMMODULE##*/}" 309 KMEXTRA_NONFATAL+="
310 doc/${KMMODULE##*/}"
293 fi 311 fi
294 312
295 # Add some CMake-files to KMEXTRACTONLY. 313 # Add some CMake-files to KMEXTRACTONLY.
296 # Note that this actually doesn't include KMEXTRA handling. 314 # Note that this actually doesn't include KMEXTRA handling.
297 # In those cases you should care to add the relevant files to KMEXTRACTONLY 315 # In those cases you should care to add the relevant files to KMEXTRACTONLY
298 case ${KMNAME} in 316 case ${KMNAME} in
299 kdebase) 317 kdebase)
300 KMEXTRACTONLY="${KMEXTRACTONLY} 318 KMEXTRACTONLY+="
301 apps/config-apps.h.cmake 319 apps/config-apps.h.cmake
302 apps/ConfigureChecks.cmake" 320 apps/ConfigureChecks.cmake"
303 ;; 321 ;;
304 kdebase-apps) 322 kdebase-apps)
305 KMEXTRACTONLY="${KMEXTRACTONLY} 323 KMEXTRACTONLY+="
306 config-apps.h.cmake 324 config-apps.h.cmake
307 ConfigureChecks.cmake" 325 ConfigureChecks.cmake"
308 ;; 326 ;;
309 kdebase-runtime) 327 kdebase-runtime)
310 KMEXTRACTONLY="${KMEXTRACTONLY} 328 KMEXTRACTONLY+="
311 config-runtime.h.cmake" 329 config-runtime.h.cmake"
312 ;; 330 ;;
313 kdebase-workspace) 331 kdebase-workspace)
314 KMEXTRACTONLY="${KMEXTRACTONLY} 332 KMEXTRACTONLY+="
315 config-unix.h.cmake 333 config-unix.h.cmake
316 ConfigureChecks.cmake 334 ConfigureChecks.cmake
317 config-workspace.h.cmake 335 config-workspace.h.cmake
318 config-X11.h.cmake 336 config-X11.h.cmake
319 startkde.cmake 337 startkde.cmake
320 KDE4WorkspaceConfig.cmake.in" 338 KDE4WorkspaceConfig.cmake.in"
321 ;; 339 ;;
322 kdegames) 340 kdegames)
323 if [[ ${PN} != libkdegames ]]; then 341 if [[ ${PN} != libkdegames ]]; then
324 KMEXTRACTONLY="${KMEXTRACTONLY} 342 KMEXTRACTONLY+="
325 libkdegames" 343 libkdegames/"
326 fi 344 fi
327 ;; 345 ;;
328 kdepim) 346 kdepim)
329 KMEXTRACTONLY="${KMEXTRACTONLY} 347 if [[ ${PN} != libkdepim ]]; then
348 KMEXTRACTONLY+="
349 libkdepim/"
350 fi
351 case ${SLOT} in
352 4.3|4.4|live)
353 KMEXTRACTONLY+="
354 kdepim-version.h
355 config-enterprise.h.cmake"
356 ;;
357 esac
358 KMEXTRACTONLY+="
330 kleopatra/ConfigureChecks.cmake 359 kleopatra/ConfigureChecks.cmake"
331 libkdepim/kdepim_export.h"
332 if has kontact ${IUSE//+} && use kontact; then 360 if has kontact ${IUSE//+} && use kontact; then
361 KMEXTRA+="
333 KMEXTRA="${KMEXTRA} kontact/plugins/${PLUGINNAME:-${PN}}" 362 kontact/plugins/${PLUGINNAME:-${PN}}/"
334 KMEXTRACTONLY="${KMEXTRACTONLY} kontactinterfaces/" 363 if ! slot_is_at_least 4.4 ${SLOT} || [[ ${SLOT} == 4.4 && ${PV} < 4.3.68 ]]; then
364 KMEXTRACTONLY+="
365 kontactinterfaces/"
366 fi
335 fi 367 fi
336 ;; 368 ;;
369 kdeutils)
370 case ${SLOT} in
371 4.3|4.4|live)
372 KMEXTRACTONLY+="
373 kdeutils-version.h"
374 ;;
375 esac
376 ;;
337 koffice) 377 koffice)
338 KMEXTRACTONLY="${KMEXTRACTONLY} 378 KMEXTRACTONLY+="
339 config-endian.h.cmake 379 config-endian.h.cmake
340 filters/config-filters.h.cmake 380 filters/config-filters.h.cmake
341 config-openctl.h.cmake
342 config-openexr.h.cmake 381 config-openexr.h.cmake
343 config-opengl.h.cmake 382 config-opengl.h.cmake
344 config-prefix.h.cmake" 383 config-prefix.h.cmake
384 "
385 case ${PV} in
386 2.0.*)
387 KMEXTRACTONLY+="
388 config-openctl.h.cmake"
389 ;;
390 esac
345 ;; 391 ;;
346 esac 392 esac
347 # Don't install cmake modules for split ebuilds, to avoid collisions. 393 # Don't install cmake modules for split ebuilds, to avoid collisions.
348 case ${KMNAME} in 394 case ${KMNAME} in
395 kdepim)
396 # No need for unpack since 4.2.86
397 # Remove when 4.2 is wiped out from the tree
398 case ${PV} in
399 4.2.[0-4])
400 KMCOMPILEONLY+="
401 cmake/modules/"
402 ;;
403 esac
404 ;;
349 kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics|kdepim) 405 kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics)
350 case ${PN} in 406 case ${PN} in
351 libkdegames|libkdeedu|marble|libkworkspace) 407 libkdegames|libkdeedu|libkworkspace)
352 KMEXTRA="${KMEXTRA} 408 KMEXTRA+="
353 cmake/modules/" 409 cmake/modules/"
354 ;; 410 ;;
355 *) 411 *)
356 KMCOMPILEONLY="${KMCOMPILEONLY} 412 KMCOMPILEONLY+="
357 cmake/modules/" 413 cmake/modules/"
358 ;; 414 ;;
359 esac 415 esac
360 ;; 416 ;;
361 esac 417 esac
362 418
363 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}" 419 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}"
364} 420}
365 421
366__list_needed_subdirectories() { 422__list_needed_subdirectories() {
367 local i j kmextra kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist topdir 423 local i j kmextra kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist
368 424
369 # We expand KMEXTRA by adding CMakeLists.txt files 425 # We expand KMEXTRA by adding CMakeLists.txt files
370 kmextra="${KMEXTRA}" 426 kmextra="${KMEXTRA}"
371 [[ ${1} != fatal ]] && kmextra="${kmextra} ${KMEXTRA_NONFATAL}" 427 [[ ${1} != fatal ]] && kmextra+=" ${KMEXTRA_NONFATAL}"
372 for i in ${kmextra}; do 428 for i in ${kmextra}; do
373 kmextra_expanded="${kmextra_expanded} ${i}" 429 kmextra_expanded+=" ${i}"
374 j=$(dirname ${i}) 430 j=$(dirname ${i})
375 while [[ ${j} != "." ]]; do 431 while [[ ${j} != "." ]]; do
376 kmextra_expanded="${kmextra_expanded} ${j}/CMakeLists.txt"; 432 kmextra_expanded+=" ${j}/CMakeLists.txt";
377 j=$(dirname ${j}) 433 j=$(dirname ${j})
378 done 434 done
379 done 435 done
380 436
381 # Expand KMMODULE 437 # Expand KMMODULE
382 if [[ -n ${KMMODULE} ]]; then 438 if [[ -n ${KMMODULE} ]]; then
383 kmmodule_expanded="${KMMODULE}" 439 kmmodule_expanded="${KMMODULE}"
384 j=$(dirname ${KMMODULE}) 440 j=$(dirname ${KMMODULE})
385 while [[ ${j} != "." ]]; do 441 while [[ ${j} != "." ]]; do
386 kmmodule_expanded="${kmmodule_expanded} ${j}/CMakeLists.txt"; 442 kmmodule_expanded+=" ${j}/CMakeLists.txt";
387 j=$(dirname ${j}) 443 j=$(dirname ${j})
388 done 444 done
389 fi 445 fi
390 446
391 # Expand KMCOMPILEONLY 447 # Expand KMCOMPILEONLY
392 for i in ${KMCOMPILEONLY}; do 448 for i in ${KMCOMPILEONLY}; do
393 kmcompileonly_expanded="${kmcompileonly_expanded} ${i}" 449 kmcompileonly_expanded+=" ${i}"
394 j=$(dirname ${i}) 450 j=$(dirname ${i})
395 while [[ ${j} != "." ]]; do 451 while [[ ${j} != "." ]]; do
396 kmcompileonly_expanded="${kmcompileonly_expanded} ${j}/CMakeLists.txt"; 452 kmcompileonly_expanded+=" ${j}/CMakeLists.txt";
397 j=$(dirname ${j}) 453 j=$(dirname ${j})
398 done 454 done
399 done 455 done
400 456
401 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmextra_expanded: ${kmextra_expanded}" 457 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmextra_expanded: ${kmextra_expanded}"
402 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmmodule_expanded: ${kmmodule_expanded}" 458 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmmodule_expanded: ${kmmodule_expanded}"
403 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmcompileonly_expanded: ${kmcompileonly_expanded}" 459 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmcompileonly_expanded: ${kmcompileonly_expanded}"
404 460
405 case ${PV} in
406 scm|9999*) : ;;
407 *) topdir="${KMNAME}-${PV}/" ;;
408 esac
409 # Create final list of stuff to extract 461 # Create final list of stuff to extract
410 # We append topleveldir only when specified (usually for tarballs) 462 # We append topdir only when specified (usually for tarballs)
411 for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \ 463 for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \
412 ${KMEXTRACTONLY} 464 ${KMEXTRACTONLY}
413 do 465 do
414 extractlist="${extractlist} ${topdir}${moduleprefix}${i}" 466 extractlist+=" ${topdir}${moduleprefix}${i}"
415 done 467 done
416 468
417 echo ${extractlist} 469 echo ${extractlist}
418} 470}
419 471
424 debug-print-function ${FUNCNAME} "$@" 476 debug-print-function ${FUNCNAME} "$@"
425 477
426 kde4-meta_change_cmakelists 478 kde4-meta_change_cmakelists
427 kde4-base_src_prepare 479 kde4-base_src_prepare
428} 480}
429
430 481
431# FIXME: no comment here? 482# FIXME: no comment here?
432_change_cmakelists_parent_dirs() { 483_change_cmakelists_parent_dirs() {
433 debug-print-function ${FUNCNAME} "$@" 484 debug-print-function ${FUNCNAME} "$@"
434 485
468 find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ 519 find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
469 die "${LINENO}: died in KMMODULE section" 520 die "${LINENO}: died in KMMODULE section"
470 _change_cmakelists_parent_dirs ${KMMODULE} 521 _change_cmakelists_parent_dirs ${KMMODULE}
471 fi 522 fi
472 523
524 local i
525
526 # KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY
527 for i in ${KMEXTRACTONLY}; do
528 if [[ -d "${S}"/${i} && -f "${S}"/${i}/../CMakeLists.txt ]]; then
529 sed -i -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" "${S}"/${i}/../CMakeLists.txt || \
530 die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}"
531 fi
532 done
533
473 # KMCOMPILEONLY 534 # KMCOMPILEONLY
474 local i
475 for i in ${KMCOMPILEONLY}; do 535 for i in ${KMCOMPILEONLY}; do
476 debug-print "${LINENO}: KMCOMPILEONLY, processing ${i}" 536 debug-print "${LINENO}: KMCOMPILEONLY, processing ${i}"
477 # Uncomment "add_subdirectory" instructions inside $KMCOMPILEONLY, then comment "install" instructions. 537 # Uncomment "add_subdirectory" instructions inside $KMCOMPILEONLY, then comment "install" instructions.
478 find "${S}"/${i} -name CMakeLists.txt -print0 | \ 538 find "${S}"/${i} -name CMakeLists.txt -print0 | \
479 xargs -0 sed -i \ 539 xargs -0 sed -i \
498 if [[ -d "${S}"/${i} ]]; then 558 if [[ -d "${S}"/${i} ]]; then
499 find "${S}"/${i} -name CMakeLists.txt -print0 | \ 559 find "${S}"/${i} -name CMakeLists.txt -print0 | \
500 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ 560 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
501 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}" 561 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
502 _change_cmakelists_parent_dirs ${i} 562 _change_cmakelists_parent_dirs ${i}
503 fi
504 done
505
506 # KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY
507 for i in ${KMEXTRACTONLY}; do
508 if [[ -d "${S}"/${i} && -f "${S}"/${i}/../CMakeLists.txt ]]; then
509 sed -i -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" "${S}"/${i}/../CMakeLists.txt || \
510 die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}"
511 fi 563 fi
512 done 564 done
513 565
514 case ${KMNAME} in 566 case ${KMNAME} in
515 kdebase-workspace) 567 kdebase-workspace)
521 sed -i -e '/startkde/s/^/#DONOTINSTALL /' "${S}"/CMakeLists.txt || \ 573 sed -i -e '/startkde/s/^/#DONOTINSTALL /' "${S}"/CMakeLists.txt || \
522 die "${LINENO}: sed died in the kdebase-startkde collision prevention section" 574 die "${LINENO}: sed died in the kdebase-startkde collision prevention section"
523 fi 575 fi
524 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82 576 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82
525 if [[ ${PN} != libkworkspace ]]; then 577 if [[ ${PN} != libkworkspace ]]; then
578 sed -i \
526 sed -i -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \ 579 -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \
527 CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip EXPORT section" 580 CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip config install and fix EXPORT section"
528 fi 581 fi
529 ;; 582 ;;
530 kdebase-runtime) 583 kdebase-runtime)
531 # COLLISION PROTECT section 584 # COLLISION PROTECT section
532 # Only install the kde4 script as part of kde-base/kdebase-data 585 # Only install the kde4 script as part of kde-base/kdebase-data
542 -e '/add_custom_target(kmail_xml /,/)/p' "${S}"/kmail/CMakeLists.txt || die "uncommenting xml failed" 595 -e '/add_custom_target(kmail_xml /,/)/p' "${S}"/kmail/CMakeLists.txt || die "uncommenting xml failed"
543 _change_cmakelists_parent_dirs kmail 596 _change_cmakelists_parent_dirs kmail
544 ;; 597 ;;
545 esac 598 esac
546 ;; 599 ;;
600 kdewebdev)
601 # Disable hardcoded kdepimlibs check
602 sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \
603 -e 's/find_package(LibXml2 REQUIRED)/macro_optional_find_package(LibXml2)/' \
604 -e 's/find_package(LibXslt REQUIRED)/macro_optional_find_package(LibXslt)/' \
605 -e 's/find_package(Boost REQUIRED)/macro_optional_find_package(Boost)/' \
606 -i CMakeLists.txt || die "failed to disable hardcoded checks"
607 ;;
547 koffice) 608 koffice)
548 # prevent collisions 609 # prevent collisions
549 if [[ ${PN} != koffice-data ]]; then 610 if [[ ${PN} != koffice-data ]]; then
550 sed -i -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \ 611 sed -i -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \
551 "${S}"/cmake/modules/CMakeLists.txt || \ 612 "${S}"/cmake/modules/CMakeLists.txt || \
552 die "${LINENO}: sed died in collision prevention section" 613 die "${LINENO}: sed died in collision prevention section"
553 sed -i -n -e '1h;1!H;${g;s/install(.\+config-openexr.h.\+)//;p}' \ 614 sed -i -e '/install(.\+config-openexr\.h.\+)/d' \
554 "${S}"/CMakeLists.txt || \ 615 "${S}"//CMakeLists.txt || \
555 die "${LINENO}: sed died in collision prevention section" 616 die "${LINENO}: sed died in collision prevention section"
556 fi 617 fi
557 esac 618 esac
558 619
559 popd > /dev/null 620 popd > /dev/null
564# Currently just calls its equivalent in kde4-base.eclass(5). Use this one in split 625# Currently just calls its equivalent in kde4-base.eclass(5). Use this one in split
565# ebuilds. 626# ebuilds.
566kde4-meta_src_configure() { 627kde4-meta_src_configure() {
567 debug-print-function ${FUNCNAME} "$@" 628 debug-print-function ${FUNCNAME} "$@"
568 629
630 # Set some cmake default values here (usually workarounds for automagic deps)
631 case ${KMNAME} in
632 kdewebdev)
633 mycmakeargs="
634 -DWITH_KdepimLibs=OFF
635 -DWITH_LibXml2=OFF
636 -DWITH_LibXslt=OFF
637 -DWITH_Boost=OFF
638 -DWITH_LibTidy=OFF
639 ${mycmakeargs}"
640 ;;
641 esac
642
569 kde4-base_src_configure 643 kde4-base_src_configure
570} 644}
571 645
572# @FUNCTION: kde4-meta_src_compile 646# @FUNCTION: kde4-meta_src_compile
573# @DESCRIPTION: 647# @DESCRIPTION:
574# General function for compiling split KDE4 applications. 648# General function for compiling split KDE4 applications.
575# Overrides kde4-base_src_compile. 649# Overrides kde4-base_src_compile.
576kde4-meta_src_compile() { 650kde4-meta_src_compile() {
577 debug-print-function ${FUNCNAME} "$@" 651 debug-print-function ${FUNCNAME} "$@"
578 652
579 kde4-base_src_make 653 kde4-base_src_compile "$@"
580} 654}
581 655
582# @FUNCTION: kde4-meta_src_test 656# @FUNCTION: kde4-meta_src_test
583# @DESCRIPTION: 657# @DESCRIPTION:
584# Currently just calls its equivalent in kde4-base.eclass(5). Use this in split 658# Currently just calls its equivalent in kde4-base.eclass(5). Use this in split
593# @DESCRIPTION: 667# @DESCRIPTION:
594# Function for installing KDE4 split applications. 668# Function for installing KDE4 split applications.
595kde4-meta_src_install() { 669kde4-meta_src_install() {
596 debug-print-function $FUNCNAME "$@" 670 debug-print-function $FUNCNAME "$@"
597 671
598 kde4-meta_src_make_doc 672 kde4-base_src_install
599 cmake-utils_src_install
600
601 if [[ -n ${KMSAVELIBS} ]]; then
602 install_library_dependencies
603 fi
604} 673}
605 674
606# @FUNCTION: kde4-meta_src_make_doc 675# @FUNCTION: kde4-meta_src_make_doc
607# @DESCRIPTION: 676# @DESCRIPTION:
608# This function searches in ${S}/${KMMODULE}, 677# This function searches in ${S}/${KMMODULE},
609# and tries to install "AUTHORS ChangeLog* README* NEWS todo" if these files exist. 678# and tries to install "AUTHORS ChangeLog* README* NEWS TODO" if these files exist.
610kde4-meta_src_make_doc() { 679kde4-meta_src_make_doc() {
611 debug-print-function ${FUNCNAME} "$@" 680 debug-print-function ${FUNCNAME} "$@"
612 681
613 local doc 682 local doc
614 for doc in AUTHORS ChangeLog* README* NEWS TODO; do 683 for doc in AUTHORS ChangeLog* README* NEWS TODO; do
618 kde4-base_src_make_doc 687 kde4-base_src_make_doc
619} 688}
620 689
621# @FUNCTION: kde4-meta_pkg_postinst 690# @FUNCTION: kde4-meta_pkg_postinst
622# @DESCRIPTION: 691# @DESCRIPTION:
623# Currently just calls its equivalent in kde4-base.eclass(5). Use this in split 692# Display information about application handbook and invoke kbuildsycoca4.
624# ebuilds.
625kde4-meta_pkg_postinst() { 693kde4-meta_pkg_postinst() {
626 debug-print-function ${FUNCNAME} "$@" 694 debug-print-function ${FUNCNAME} "$@"
695
696 if has handbook ${IUSE//+} && ! use handbook; then
697 echo
698 einfo "Application handbook for ${PN} has not been installed."
699 einfo "To install handbook, reemerge =${CATEGORY}/${PF} with 'handbook' USE flag."
700 echo
701 fi
627 702
628 kde4-base_pkg_postinst 703 kde4-base_pkg_postinst
629} 704}
630 705
631# @FUNCTION: kde4-meta_pkg_postrm 706# @FUNCTION: kde4-meta_pkg_postrm

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.26

  ViewVC Help
Powered by ViewVC 1.1.20