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

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

  ViewVC Help
Powered by ViewVC 1.1.20