/[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.10 Revision 1.22
1# Copyright 1999-2008 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.10 2009/01/12 19:40:34 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.22 2009/06/04 09:29:54 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.
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# we want opengl optional in each koffice package
16if [[ $KMNAME = koffice ]]; then
17 case ${PN} in
18 koffice-data)
19 ;;
20 *)
21 OPENGL_REQUIRED=optional
22 ;;
23 esac
24fi
25
26inherit kde4-base versionator 15inherit kde4-base versionator
27 16
28EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm 17EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm
29 18
30if [[ -z ${KMNAME} ]]; then 19if [[ -z ${KMNAME} ]]; then
40 HOMEPAGE="http://www.koffice.org/" 29 HOMEPAGE="http://www.koffice.org/"
41 LICENSE="GPL-2" 30 LICENSE="GPL-2"
42 ;; 31 ;;
43esac 32esac
44 33
34# remove this codeblock when 4.2.3 is dropped
35if [[ ${PV} = "4.2.3" ]]; then
36 [[ ${PN} != khelpcenter ]] && has doc ${IUSE//+} \
37 RDEPEND="${RDEPEND} doc? ( >=kde-base/khelpcenter-${PV}:${SLOT}[kdeprefix=] )"
38else
39# Add khelpcenter dependency when installing handbooks
40if [[ ${PN} != khelpcenter ]] && has handbook ${IUSE//+}; then
41 RDEPEND="${RDEPEND}
42 handbook? ( >=kde-base/khelpcenter-${PV}:${SLOT}[kdeprefix=] )
43 "
44fi
45fi
45# Add dependencies that all packages in a certain module share. 46# Add dependencies that all packages in a certain module share.
46case ${KMNAME} in 47case ${KMNAME} in
47 kdebase|kdebase-workspace|kdebase-runtime) 48 kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphics)
49 DEPEND="${DEPEND}
48 DEPEND="${DEPEND} >=kde-base/qimageblitz-0.0.4" 50 >=kde-base/qimageblitz-0.0.4
49 RDEPEND="${RDEPEND} >=kde-base/qimageblitz-0.0.4" 51 "
52 RDEPEND="${RDEPEND}
53 >=kde-base/qimageblitz-0.0.4
54 "
55 ;;
56 kdenetwork)
57 DEPEND="${DEPEND}
58 >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]
59 "
60 RDEPEND="${RDEPEND}
61 >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]
62 "
50 ;; 63 ;;
51 kdepim) 64 kdepim)
52 DEPEND="${DEPEND} dev-libs/boost app-office/akonadi-server" 65 DEPEND="${DEPEND}
53 RDEPEND="${RDEPEND} dev-libs/boost" 66 dev-libs/boost
54 if [[ $PN != kode ]]; then 67 >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]
55 DEPEND="${DEPEND} >=kde-base/kode-${PV}:${SLOT}" 68 "
56 RDEPEND="${RDEPEND} >=kde-base/kode-${PV}:${SLOT}" 69 RDEPEND="${RDEPEND}
57 fi 70 dev-libs/boost
71 >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]
72 "
58 case ${PN} in 73 case ${PN} in
59 akregator|kaddressbook|kjots|kmail|kmobiletools|knode|knotes|korganizer|ktimetracker) 74 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker)
60 IUSE="+kontact" 75 IUSE="+kontact"
76 RDEPEND="${RDEPEND}
61 DEPEND="${DEPEND} kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT} )" 77 kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] )
62 RDEPEND="${RDEPEND} kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT} )" 78 "
63 ;; 79 ;;
64 esac 80 esac
65 ;; 81 ;;
66 kdegames) 82 kdegames)
67 if [[ $PN != libkdegames ]]; then 83 if [[ ${PN} != libkdegames ]]; then
68 DEPEND="${DEPEND} >=kde-base/libkdegames-${PV}:${SLOT}" 84 DEPEND="${DEPEND}
69 RDEPEND="${RDEPEND} >=kde-base/libkdegames-${PV}:${SLOT}" 85 >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=]
86 "
87 RDEPEND="${RDEPEND}
88 >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=]
89 "
70 fi 90 fi
71 ;; 91 ;;
72 koffice) 92 koffice)
73 case ${PV} in 93 [[ ${PN} != koffice-data ]] && IUSE="debug"
74 9999*) DEPEND="${DEPEND} !app-office/${PN}:2" ;;
75 1.9*|2*) DEPEND="${DEPEND} !app-office/${PN}:live" ;;
76 esac
77 DEPEND="${DEPEND} 94 RDEPEND="${RDEPEND}
78 !app-office/${PN}:0 95 !app-office/${PN}:0
79 !app-office/koffice:0 96 !app-office/koffice:0
80 !app-office/koffice-meta:0" 97 !app-office/koffice-meta:0
98 "
99 if has openexr ${IUSE//+}; then
100 COMMON_DEPEND="media-gfx/imagemagick[openexr?]"
101 else
102 COMMON_DEPEND="media-gfx/imagemagick"
103 fi
104
105 COMMON_DEPEND="${COMMON_DEPEND}
106 dev-cpp/eigen:2
107 media-libs/fontconfig
108 media-libs/freetype:2
109 "
110 DEPEND="${DEPEND} ${COMMON_DEPEND}"
111 RDEPEND="${RDEPEND} ${COMMON_DEPEND}"
112 unset COMMON_DEPEND
113 if [[ ${PN} != koffice-libs && ${PN} != koffice-data ]]; then
114 DEPEND="${DEPEND}
115 >=app-office/koffice-libs-${PV}:${SLOT}
116 "
117 RDEPEND="${RDEPEND}
118 >=app-office/koffice-libs-${PV}:${SLOT}
119 "
120 fi
121 ;;
122esac
123
124debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after metapackage-specific dependencies"
125debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-specific dependencies"
126
127# Useful to build kde4-meta style stuff from extragear/playground (plasmoids etc)
128case ${BUILD_TYPE} in
129 live)
81 case ${PN} in 130 case ${KMNAME} in
82 koffice-data) 131 extragear*|playground*)
83 DEPEND="${DEPEND} media-libs/lcms" 132 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}"
84 RDEPEND="${RDEPEND} media-libs/lcms" 133 ESVN_PROJECT="${KMNAME}${ESVN_PROJECT_SUFFIX}"
85 ;;
86 *)
87 IUSE="+crypt"
88 DEPEND="${DEPEND} crypt? ( >=app-crypt/qca-2 )"
89 RDEPEND="${RDEPEND} crypt? ( >=app-crypt/qca-2 )"
90 if [[ $PN != koffice-libs ]]; then
91 DEPEND="${DEPEND} >=app-office/koffice-libs-${PV}:${SLOT}"
92 RDEPEND="${RDEPEND} >=app-office/koffice-libs-${PV}:${SLOT}"
93 fi
94 ;; 134 ;;
95 esac 135 esac
96 ;; 136 ;;
97esac 137esac
98
99debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after metapackage-specific dependencies"
100debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-specific dependencies"
101 138
102# @ECLASS-VARIABLE: KMNAME 139# @ECLASS-VARIABLE: KMNAME
103# @DESCRIPTION: 140# @DESCRIPTION:
104# Name of the parent-module (e.g. kdebase, kdepim, ...). You _must_ set it 141# Name of the parent-module (e.g. kdebase, kdepim, ...). You _must_ set it
105# _before_ inheriting this eclass, (unlike the other parameters), since it's 142# _before_ inheriting this eclass, (unlike the other parameters), since it's
118# If set to "true", $KMMODULE doesn't have to be defined. 155# If set to "true", $KMMODULE doesn't have to be defined.
119# 156#
120# Example usage: If you're installing subdirectories of a package, like plugins, 157# Example usage: If you're installing subdirectories of a package, like plugins,
121# you mark the top subdirectory (containing the package) as $KMEXTRACTONLY, and 158# you mark the top subdirectory (containing the package) as $KMEXTRACTONLY, and
122# set KMNOMODULE="true". 159# set KMNOMODULE="true".
123if [[ -z $KMMODULE && $KMNOMODULE != true ]]; then 160if [[ -z ${KMMODULE} && ${KMNOMODULE} != true ]]; then
124 KMMODULE=$PN 161 KMMODULE=${PN}
125fi 162fi
126 163
127# @ECLASS-VARIABLE: KMEXTRA 164# @ECLASS-VARIABLE: KMEXTRA
128# @DESCRIPTION: 165# @DESCRIPTION:
129# All subdirectories listed here will be extracted, compiled & installed. 166# All subdirectories listed here will be extracted, compiled & installed.
130# $KMMODULE is always added to $KMEXTRA. 167# $KMMODULE is always added to $KMEXTRA.
131# If the htmlhandbook USE-flag is set, and if this directory exists, 168# If the handbook USE-flag is set, and if this directory exists,
132# then "doc/$KMMODULE" is added to $KMEXTRA. In other cases, this should be 169# then "doc/$KMMODULE" is added to $KMEXTRA. In other cases, this should be
133# handled in the ebuild. 170# handled in the ebuild.
134# If the documentation is in a different subdirectory, you should add it to KMEXTRA. 171# If the documentation is in a different subdirectory, you should add it to KMEXTRA.
135 172
136# @ECLASS-VARIABLE: KMCOMPILEONLY 173# @ECLASS-VARIABLE: KMCOMPILEONLY
151# @FUNCTION: kde4-meta_pkg_setup 188# @FUNCTION: kde4-meta_pkg_setup
152# @DESCRIPTION: 189# @DESCRIPTION:
153# Currently just calls its equivalent in kde4-base.eclass(5). Use this one in 190# Currently just calls its equivalent in kde4-base.eclass(5). Use this one in
154# split ebuilds. 191# split ebuilds.
155kde4-meta_pkg_setup() { 192kde4-meta_pkg_setup() {
193 debug-print-function ${FUNCNAME} "$@"
194
156 kde4-base_pkg_setup 195 kde4-base_pkg_setup
157} 196}
158 197
159# @FUNCTION: kde4-meta_src_unpack 198# @FUNCTION: kde4-meta_src_unpack
160# @DESCRIPTION: 199# @DESCRIPTION:
161# This function unpacks the source for split ebuilds. See also 200# This function unpacks the source for split ebuilds. See also
162# kde4-meta-src_extract. 201# kde4-meta-src_extract.
163kde4-meta_src_unpack() { 202kde4-meta_src_unpack() {
164 debug-print-function ${FUNCNAME} "$@" 203 debug-print-function ${FUNCNAME} "$@"
204
165 if [[ $BUILD_TYPE = live ]]; then 205 if [[ ${BUILD_TYPE} = live ]]; then
166 migrate_store_dir 206 migrate_store_dir
167 S="${WORKDIR}/${PN}-${PV}" 207 S="${WORKDIR}/${P}"
168 mkdir -p "${S}" 208 mkdir -p "${S}"
169 ESVN_RESTRICT="export" subversion_src_unpack 209 ESVN_RESTRICT="export" subversion_src_unpack
170 subversion_wc_info 210 subversion_wc_info
171 subversion_bootstrap 211 subversion_bootstrap
172 kde4-meta_src_extract 212 kde4-meta_src_extract
181# @DESCRIPTION: 221# @DESCRIPTION:
182# A function to unpack the source for a split KDE ebuild. 222# A function to unpack the source for a split KDE ebuild.
183# Also see KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and 223# Also see KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and
184# KMTARPARAMS. 224# KMTARPARAMS.
185kde4-meta_src_extract() { 225kde4-meta_src_extract() {
226 debug-print-function ${FUNCNAME} "$@"
227
186 if [[ $BUILD_TYPE = live ]]; then 228 if [[ ${BUILD_TYPE} = live ]]; then
187 local rsync_options subdir kmnamedir targetdir 229 local rsync_options subdir kmnamedir targetdir
188 # Export working copy to ${S} 230 # Export working copy to ${S}
189 einfo "Exporting parts of working copy to ${S}" 231 einfo "Exporting parts of working copy to ${S}"
190 kde4-meta_create_extractlists 232 kde4-meta_create_extractlists
191 233
199 rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}cmake" "${S}" \ 241 rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}cmake" "${S}" \
200 || die "${ESVN}: can't export cmake files to '${S}'." 242 || die "${ESVN}: can't export cmake files to '${S}'."
201 fi 243 fi
202 # Copy all subdirectories 244 # Copy all subdirectories
203 for subdir in $(__list_needed_subdirectories); do 245 for subdir in $(__list_needed_subdirectories); do
204 targetdir="" 246 targetdir=""
205 if [[ $subdir = doc/* && ! -e "$ESVN_WC_PATH/$kmnamedir$subdir" ]]; then 247 if [[ $subdir = doc/* && ! -e "$ESVN_WC_PATH/$kmnamedir$subdir" ]]; then
206 continue 248 continue
207 fi 249 fi
208 250
209 [[ ${subdir%/} = */* ]] && targetdir=${subdir%/} && targetdir=${targetdir%/*} && mkdir -p "${S}/${targetdir}" 251 [[ ${subdir%/} = */* ]] && targetdir=${subdir%/} && targetdir=${targetdir%/*} && mkdir -p "${S}/${targetdir}"
210 rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}${subdir%/}" "${S}/${targetdir}" \ 252 rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}${subdir%/}" "${S}/${targetdir}" \
211 || die "${ESVN}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'." 253 || die "${ESVN}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'."
212 done 254 done
213 255
214 if [[ $KMNAME = kdebase-runtime && $PN != kdebase-data ]]; then 256 if [[ ${KMNAME} = kdebase-runtime && ${PN} != kdebase-data ]]; then
215 sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \ 257 sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
216 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed" 258 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
217 fi 259 fi
218 else 260 else
219 local abort tarball tarfile f extractlist 261 local abort tarball tarfile f extractlist moduleprefix postfix
220 case $KMNAME in 262 case ${PV} in
221 kdebase-apps) 263 4.2.85|4.2.90)
222 tarball="${KMNAME#-apps}-${PV}.tar.bz2" 264 # block for normally packed upstream unstable snapshots
265 KMTARPARAMS="${KMTARPARAMS} --bzip2" # bz2
266 postfix="bz2"
267 ;;
268 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*)
269 KMTARPARAMS="${KMTARPARAMS} --lzma" # lzma
270 postfix="lzma"
223 ;; 271 ;;
224 *) 272 *)
225 tarball="${KMNAME}-${PV}.tar.bz2" 273 KMTARPARAMS="${KMTARPARAMS} --bzip2" # bz2
274 postfix="bz2"
226 ;; 275 ;;
227 esac 276 esac
277 case ${KMNAME} in
278 kdebase-apps)
279 # kdebase/apps -> kdebasa-apps
280 tarball="kdebase-${PV}.tar.${postfix}"
281 # Go one level deeper for kdebase-apps in tarballs
282 moduleprefix=apps/
283 KMTARPARAMS="${KMTARPARAMS} --transform=s|apps/||"
284 ;;
285 *)
286 # Create tarball name from module name (this is the default)
287 tarball="${KMNAME}-${PV}.tar.${postfix}"
288 ;;
289 esac
290
291 # Full patch to source tarball
228 tarfile="${DISTDIR}"/${tarball} 292 tarfile="${DISTDIR}/${tarball}"
293
294 # Detect real toplevel dir from tarball name - it will be used upon extraction
295 # and in __list_needed_subdirectories
296 topdir="${tarball%.tar.*}/"
229 297
230 ebegin "Unpacking parts of ${tarball} to ${WORKDIR}" 298 ebegin "Unpacking parts of ${tarball} to ${WORKDIR}"
231 299
232 kde4-meta_create_extractlists 300 kde4-meta_create_extractlists
233 301
234 for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake \ 302 for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake \
235 AUTHORS COPYING INSTALL README NEWS ChangeLog 303 AUTHORS COPYING INSTALL README NEWS ChangeLog
236 do 304 do
237 extractlist="${extractlist} ${KMNAME}-${PV}/${f}" 305 extractlist="${extractlist} ${topdir}${moduleprefix}${f}"
238 done 306 done
239 extractlist="${extractlist} $(__list_needed_subdirectories)" 307 extractlist="${extractlist} $(__list_needed_subdirectories)"
240 KMTARPARAMS="${KMTARPARAMS} -j"
241 308
242 pushd "${WORKDIR}" > /dev/null 309 pushd "${WORKDIR}" > /dev/null
243 [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf $tarfile $KMTARPARAMS $extractlist >&2 310 [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} >&2
244 tar -xpf $tarfile $KMTARPARAMS $extractlist 2> /dev/null 311 tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null
245 312
246 # Default $S is based on $P; rename the extracted directory to match $S 313 # Default $S is based on $P; rename the extracted directory to match $S if necessary
247 mv ${KMNAME}-${PV} ${P} || die "Died while moving \"${KMNAME}-${PV}\" to \"${P}\"" 314 mv ${topdir} ${P} || die "Died while moving \"${topdir}\" to \"${P}\""
248 315
249 popd > /dev/null 316 popd > /dev/null
250 317
251 eend $? 318 eend $?
319
320 # We need to clear it here to make verification below work
321 unset moduleprefix
252 322
253 if [[ -n ${KDE4_STRICTER} ]]; then 323 if [[ -n ${KDE4_STRICTER} ]]; then
254 for f in $(__list_needed_subdirectories fatal); do 324 for f in $(__list_needed_subdirectories fatal); do
255 if [[ ! -e ${S}/${f#*/} ]]; then 325 if [[ ! -e "${S}/${f#*/}" ]]; then
256 eerror "'${f#*/}' is missing" 326 eerror "'${f#*/}' is missing"
257 abort=true 327 abort=true
258 fi 328 fi
259 done 329 done
260 [[ -n ${abort} ]] && die "There were missing files." 330 [[ -n ${abort} ]] && die "There were missing files."
261 fi 331 fi
262 kde4-base_src_unpack 332
263 fi 333 # We don't need it anymore
264 # fix koffice linking 334 unset topdir
265 if [[ $KMNAME = koffice ]]; then
266 koffice_fix_libraries
267 fi 335 fi
268} 336}
269 337
270# @FUNCTION: kde4-meta_create_extractlists 338# @FUNCTION: kde4-meta_create_extractlists
271# @DESCRIPTION: 339# @DESCRIPTION:
273# Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, 341# Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY,
274# KMEXTRACTONLY and KMTARPARAMS. 342# KMEXTRACTONLY and KMTARPARAMS.
275kde4-meta_create_extractlists() { 343kde4-meta_create_extractlists() {
276 debug-print-function ${FUNCNAME} "$@" 344 debug-print-function ${FUNCNAME} "$@"
277 345
346 # TODO change to KMEXTRA for more strict check
347 # remvove 4.2.3 check when dropped
348 if [[ ${PV} = "4.2.3" ]]; then
349 if has doc ${IUSE//+} && use doc && [[ -n ${KMMODULE} ]]; then
350 KMEXTRA_NONFATAL="${KMEXTRA_NONFATAL} doc/${KMMODULE##*/}"
351 fi
352 else
278 if has htmlhandbook ${IUSE//+} && use htmlhandbook; then 353 if has handbook ${IUSE//+} && use handbook && [[ -n ${KMMODULE} ]]; then
279 # We use the basename of $KMMODULE because $KMMODULE can contain 354 # We use the basename of $KMMODULE because $KMMODULE can contain
280 # the path to the module subdirectory. 355 # the path to the module subdirectory.
281 KMEXTRA_NONFATAL="${KMEXTRA_NONFATAL} doc/${KMMODULE##*/}" 356 KMEXTRA_NONFATAL="${KMEXTRA_NONFATAL} doc/${KMMODULE##*/}"
357 fi
282 fi 358 fi
283 359
284 # Add some CMake-files to KMEXTRACTONLY. 360 # Add some CMake-files to KMEXTRACTONLY.
285 # Note that this actually doesn't include KMEXTRA handling. 361 # Note that this actually doesn't include KMEXTRA handling.
286 # In those cases you should care to add the relevant files to KMEXTRACTONLY 362 # In those cases you should care to add the relevant files to KMEXTRACTONLY
303 KMEXTRACTONLY="${KMEXTRACTONLY} 379 KMEXTRACTONLY="${KMEXTRACTONLY}
304 config-unix.h.cmake 380 config-unix.h.cmake
305 ConfigureChecks.cmake 381 ConfigureChecks.cmake
306 config-workspace.h.cmake 382 config-workspace.h.cmake
307 config-X11.h.cmake 383 config-X11.h.cmake
308 startkde.cmake" 384 startkde.cmake
309 case ${SLOT} in
310 4.2)
311 KMEXTRACTONLY="${KMEXTRACTONLY}
312 KDE4WorkspaceConfig.cmake.in" 385 KDE4WorkspaceConfig.cmake.in"
313 ;;
314 *) : ;;
315 esac
316 ;; 386 ;;
317 kdegames) 387 kdegames)
318 if [[ ${PN} != "libkdegames" ]]; then 388 if [[ ${PN} != libkdegames ]]; then
319 KMEXTRACTONLY="${KMEXTRACTONLY} 389 KMEXTRACTONLY="${KMEXTRACTONLY}
320 libkdegames" 390 libkdegames"
321 fi 391 fi
322 ;; 392 ;;
323 kdepim) 393 kdepim)
394 if [[ ${PN} != libkdepim ]]; then
395 KMEXTRACTONLY="${KMEXTRACTONLY}
396 libkdepim"
397 fi
398 case ${SLOT} in
399 4.3|live)
400 KMEXTRACTONLY="${KMEXTRACTONLY}
401 kdepim-version.h
402 config-enterprise.h.cmake"
403 ;;
404 esac
324 KMEXTRACTONLY="${KMEXTRACTONLY} 405 KMEXTRACTONLY="${KMEXTRACTONLY}
325 kleopatra/ConfigureChecks.cmake 406 kleopatra/ConfigureChecks.cmake"
326 libkdepim/kdepim_export.h"
327 if has kontact ${IUSE//+} && use kontact; then 407 if has kontact ${IUSE//+} && use kontact; then
328 KMEXTRA="${KMEXTRA} kontact/plugins/${PLUGINNAME:-${PN}}" 408 KMEXTRA="${KMEXTRA} kontact/plugins/${PLUGINNAME:-${PN}}"
329 KMEXTRACTONLY="${KMEXTRACTONLY} kontactinterfaces/" 409 KMEXTRACTONLY="${KMEXTRACTONLY} kontactinterfaces/"
330 fi 410 fi
331 ;; 411 ;;
335 filters/config-filters.h.cmake 415 filters/config-filters.h.cmake
336 config-openctl.h.cmake 416 config-openctl.h.cmake
337 config-openexr.h.cmake 417 config-openexr.h.cmake
338 config-opengl.h.cmake 418 config-opengl.h.cmake
339 config-prefix.h.cmake" 419 config-prefix.h.cmake"
340 case ${PN} in
341 koffice-libs|koffice-data)
342 ;;
343 *)
344 # add basic extract for all packages
345 KMEXTRACTONLY="${KMEXTRACTONLY}
346 filters/
347 libs/
348 plugins/"
349 if [[ ${PN} != "kplato" ]]; then
350 KMEXTRA="${KMEXTRA} filters/${PN}"
351 fi
352 ;;
353 esac
354 ;; 420 ;;
355 esac 421 esac
356 # Don't install cmake modules for split ebuilds, to avoid collisions. 422 # Don't install cmake modules for split ebuilds, to avoid collisions.
357 case ${KMNAME} in 423 case ${KMNAME} in
424 kdepim)
425 # No need for unpack since 4.2.86
426 # Remove when 4.2 is wiped out from the tree
427 case ${PV} in
428 4.1*|4.2.0|4.2.1|4.2.2|4.2.3|4.2.4|4.2.85)
429 KMCOMPILEONLY="${KMCOMPILEONLY}
430 cmake/modules/"
431 ;;
432 *) ;;
433 esac
434 ;;
358 kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics|kdepim) 435 kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics)
359 case ${PN} in 436 case ${PN} in
360 libkdegames|libkdeedu|marble|libkworkspace) 437 libkdegames|libkdeedu|libkworkspace)
361 KMEXTRA="${KMEXTRA} 438 KMEXTRA="${KMEXTRA}
362 cmake/modules/" 439 cmake/modules/"
363 ;; 440 ;;
364 *) 441 *)
365 KMCOMPILEONLY="${KMCOMPILEONLY} 442 KMCOMPILEONLY="${KMCOMPILEONLY}
371 448
372 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}" 449 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}"
373} 450}
374 451
375__list_needed_subdirectories() { 452__list_needed_subdirectories() {
376 local i j kmextra kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist topdir 453 local i j kmextra kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist
377 454
378 # We expand KMEXTRA by adding CMakeLists.txt files 455 # We expand KMEXTRA by adding CMakeLists.txt files
379 kmextra="${KMEXTRA}" 456 kmextra="${KMEXTRA}"
380 [[ ${1} != fatal ]] && kmextra="${kmextra} ${KMEXTRA_NONFATAL}" 457 [[ ${1} != fatal ]] && kmextra="${kmextra} ${KMEXTRA_NONFATAL}"
381 for i in ${kmextra}; do 458 for i in ${kmextra}; do
386 j=$(dirname ${j}) 463 j=$(dirname ${j})
387 done 464 done
388 done 465 done
389 466
390 # Expand KMMODULE 467 # Expand KMMODULE
391 if [[ -n $KMMODULE ]]; then 468 if [[ -n ${KMMODULE} ]]; then
392 kmmodule_expanded="${KMMODULE}" 469 kmmodule_expanded="${KMMODULE}"
393 j=$(dirname ${KMMODULE}) 470 j=$(dirname ${KMMODULE})
394 while [[ ${j} != "." ]]; do 471 while [[ ${j} != "." ]]; do
395 kmmodule_expanded="${kmmodule_expanded} $j/CMakeLists.txt"; 472 kmmodule_expanded="${kmmodule_expanded} ${j}/CMakeLists.txt";
396 j=$(dirname $j) 473 j=$(dirname ${j})
397 done 474 done
398 fi 475 fi
399 476
400 # Expand KMCOMPILEONLY 477 # Expand KMCOMPILEONLY
401 for i in ${KMCOMPILEONLY}; do 478 for i in ${KMCOMPILEONLY}; do
409 486
410 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmextra_expanded: ${kmextra_expanded}" 487 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmextra_expanded: ${kmextra_expanded}"
411 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmmodule_expanded: ${kmmodule_expanded}" 488 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmmodule_expanded: ${kmmodule_expanded}"
412 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmcompileonly_expanded: ${kmcompileonly_expanded}" 489 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmcompileonly_expanded: ${kmcompileonly_expanded}"
413 490
414
415 case ${PV} in
416 scm|9999*) : ;;
417 *) topdir="${KMNAME}-${PV}/" ;;
418 esac
419
420 # Create final list of stuff to extract 491 # Create final list of stuff to extract
492 # We append topdir only when specified (usually for tarballs)
421 for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \ 493 for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \
422 ${KMEXTRACTONLY} 494 ${KMEXTRACTONLY}
423 do 495 do
424 extractlist="${extractlist} ${topdir}${i}" 496 extractlist="${extractlist} ${topdir}${moduleprefix}${i}"
425 done 497 done
426 498
427 echo ${extractlist} 499 echo ${extractlist}
428} 500}
429 501
434 debug-print-function ${FUNCNAME} "$@" 506 debug-print-function ${FUNCNAME} "$@"
435 507
436 kde4-meta_change_cmakelists 508 kde4-meta_change_cmakelists
437 kde4-base_src_prepare 509 kde4-base_src_prepare
438} 510}
439
440 511
441# FIXME: no comment here? 512# FIXME: no comment here?
442_change_cmakelists_parent_dirs() { 513_change_cmakelists_parent_dirs() {
443 debug-print-function ${FUNCNAME} "$@" 514 debug-print-function ${FUNCNAME} "$@"
444 515
458 529
459# FIXME: add description 530# FIXME: add description
460# @FUNCTION: kde4-meta_change_cmakelists 531# @FUNCTION: kde4-meta_change_cmakelists
461# @DESCRIPTION: 532# @DESCRIPTION:
462kde4-meta_change_cmakelists() { 533kde4-meta_change_cmakelists() {
463 debug-print-function ${FUNCNAME} "$@" 534 debug-print-function ${FUNCNAME} "$@"
464 535
465 pushd "${S}" > /dev/null 536 pushd "${S}" > /dev/null
466 537
467 comment_all_add_subdirectory ./ 538 comment_all_add_subdirectory ./
468 539
478 find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ 549 find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
479 die "${LINENO}: died in KMMODULE section" 550 die "${LINENO}: died in KMMODULE section"
480 _change_cmakelists_parent_dirs ${KMMODULE} 551 _change_cmakelists_parent_dirs ${KMMODULE}
481 fi 552 fi
482 553
554 local i
555
556 # KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY
557 for i in ${KMEXTRACTONLY}; do
558 if [[ -d "${S}"/${i} && -f "${S}"/${i}/../CMakeLists.txt ]]; then
559 sed -i -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" "${S}"/${i}/../CMakeLists.txt || \
560 die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}"
561 fi
562 done
563
483 # KMCOMPILEONLY 564 # KMCOMPILEONLY
484 local i
485 for i in ${KMCOMPILEONLY}; do 565 for i in ${KMCOMPILEONLY}; do
486 debug-print "${LINENO}: KMCOMPILEONLY, processing ${i}" 566 debug-print "${LINENO}: KMCOMPILEONLY, processing ${i}"
487 # Uncomment "add_subdirectory" instructions inside $KMCOMPILEONLY, then comment "install" instructions. 567 # Uncomment "add_subdirectory" instructions inside $KMCOMPILEONLY, then comment "install" instructions.
488 find "${S}"/${i} -name CMakeLists.txt -print0 | \ 568 find "${S}"/${i} -name CMakeLists.txt -print0 | \
489 xargs -0 sed -i \ 569 xargs -0 sed -i \
511 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}" 591 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
512 _change_cmakelists_parent_dirs ${i} 592 _change_cmakelists_parent_dirs ${i}
513 fi 593 fi
514 done 594 done
515 595
516 # KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY
517 for i in ${KMEXTRACTONLY}; do
518 if [[ -d "${S}"/${i} && -f "${S}"/${i}/../CMakeLists.txt ]]; then
519 sed -i -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" "${S}"/${i}/../CMakeLists.txt || \
520 die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}"
521 fi
522 done
523
524 case ${KMNAME} in 596 case ${KMNAME} in
525 kdebase-workspace) 597 kdebase-workspace)
526 # COLLISION PROTECT section 598 # COLLISION PROTECT section
527 # Install the startkde script just once, as a part of kde-base/kdebase-startkde, 599 # Install the startkde script just once, as a part of kde-base/kdebase-startkde,
528 # not as a part of every package. 600 # not as a part of every package.
529 if [[ ${PN} != "kdebase-startkde" && -f "${S}"/CMakeLists.txt ]]; then 601 if [[ ${PN} != kdebase-startkde && -f "${S}"/CMakeLists.txt ]]; then
530 # The startkde script moved to kdebase-workspace for KDE4 versions > 3.93.0. 602 # The startkde script moved to kdebase-workspace for KDE4 versions > 3.93.0.
531 sed -i -e '/startkde/s/^/#DONOTINSTALL /' "${S}"/CMakeLists.txt || \ 603 sed -i -e '/startkde/s/^/#DONOTINSTALL /' "${S}"/CMakeLists.txt || \
532 die "${LINENO}: sed died in the kdebase-startkde collision prevention section" 604 die "${LINENO}: sed died in the kdebase-startkde collision prevention section"
533 fi 605 fi
534 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82 606 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82
535 if [[ ${SLOT} == 4.2 ]] || [[ ${PV} == 9999 ]]; then
536 if [[ ${PN} != libkworkspace ]]; then 607 if [[ ${PN} != libkworkspace ]]; then
608 sed -i \
537 sed -i -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \ 609 -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \
538 CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip EXPORT section" 610 CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip config install and fix EXPORT section"
539 fi
540 fi 611 fi
541 ;; 612 ;;
542 kdebase-runtime) 613 kdebase-runtime)
543 # COLLISION PROTECT section 614 # COLLISION PROTECT section
544 # Only install the kde4 script as part of kde-base/kdebase-data 615 # Only install the kde4 script as part of kde-base/kdebase-data
545 if [[ ${PN} != "kdebase-data" && -f "${S}"/CMakeLists.txt ]]; then 616 if [[ ${PN} != kdebase-data && -f "${S}"/CMakeLists.txt ]]; then
546 sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \ 617 sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
547 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed" 618 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
548 fi 619 fi
549 ;; 620 ;;
550 kdepim) 621 kdepim)
554 -e '/add_custom_target(kmail_xml /,/)/p' "${S}"/kmail/CMakeLists.txt || die "uncommenting xml failed" 625 -e '/add_custom_target(kmail_xml /,/)/p' "${S}"/kmail/CMakeLists.txt || die "uncommenting xml failed"
555 _change_cmakelists_parent_dirs kmail 626 _change_cmakelists_parent_dirs kmail
556 ;; 627 ;;
557 esac 628 esac
558 ;; 629 ;;
630 kdewebdev)
631 # Disable hardcoded kdepimlibs check
632 sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \
633 -e 's/find_package(LibXml2 REQUIRED)/macro_optional_find_package(LibXml2)/' \
634 -e 's/find_package(LibXslt REQUIRED)/macro_optional_find_package(LibXslt)/' \
635 -e 's/find_package(Boost REQUIRED)/macro_optional_find_package(Boost)/' \
636 -i CMakeLists.txt || die "failed to disable hardcoded checks"
637 ;;
638 koffice)
639 # prevent collisions
640 if [[ ${PN} != koffice-data ]]; then
641 sed -i -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \
642 "${S}"/cmake/modules/CMakeLists.txt || \
643 die "${LINENO}: sed died in collision prevention section"
644 sed -i -n -e '1h;1!H;${g;s/install(.\+config-openexr.h.\+)//;p}' \
645 "${S}"/CMakeLists.txt || \
646 die "${LINENO}: sed died in collision prevention section"
647 fi
559 esac 648 esac
560 649
561 popd > /dev/null 650 popd > /dev/null
562} 651}
563 652
564# @FUNCTION: kde4-meta_src_configure 653# @FUNCTION: kde4-meta_src_configure
565# @DESCRIPTION: 654# @DESCRIPTION:
566# Currently just calls its equivalent in kde4-base.eclass(5). Use this one in split 655# Currently just calls its equivalent in kde4-base.eclass(5). Use this one in split
567# ebuilds. 656# ebuilds.
568kde4-meta_src_configure() { 657kde4-meta_src_configure() {
569 debug-print-function ${FUNCNAME} "$@" 658 debug-print-function ${FUNCNAME} "$@"
659
660 # Set some cmake default values here (usually workarounds for automagic deps)
661 case ${KMNAME} in
662 kdewebdev)
663 mycmakeargs="
664 -DWITH_KdepimLibs=OFF
665 -DWITH_LibXml2=OFF
666 -DWITH_LibXslt=OFF
667 -DWITH_Boost=OFF
668 -DWITH_LibTidy=OFF
669 ${mycmakeargs}"
670 ;;
671 esac
570 672
571 kde4-base_src_configure 673 kde4-base_src_configure
572} 674}
573 675
574# @FUNCTION: kde4-meta_src_compile 676# @FUNCTION: kde4-meta_src_compile
575# @DESCRIPTION: 677# @DESCRIPTION:
576# General function for compiling split KDE4 applications. 678# General function for compiling split KDE4 applications.
577# Overrides kde4-base_src_compile. 679# Overrides kde4-base_src_compile.
578kde4-meta_src_compile() { 680kde4-meta_src_compile() {
579 debug-print-function ${FUNCNAME} "$@" 681 debug-print-function ${FUNCNAME} "$@"
580 682
581 kde4-base_src_make 683 kde4-base_src_compile
582} 684}
583 685
584# @FUNCTION: kde4-meta_src_test 686# @FUNCTION: kde4-meta_src_test
585# @DESCRIPTION: 687# @DESCRIPTION:
586# Currently just calls its equivalent in kde4-base.eclass(5). Use this in split 688# Currently just calls its equivalent in kde4-base.eclass(5). Use this in split
595# @DESCRIPTION: 697# @DESCRIPTION:
596# Function for installing KDE4 split applications. 698# Function for installing KDE4 split applications.
597kde4-meta_src_install() { 699kde4-meta_src_install() {
598 debug-print-function $FUNCNAME "$@" 700 debug-print-function $FUNCNAME "$@"
599 701
600 kde4-meta_src_make_doc 702 kde4-base_src_install
601 cmake-utils_src_install
602
603 if [[ -n ${KMSAVELIBS} ]]; then
604 install_library_dependencies
605 fi
606
607 # remove unvanted koffice stuff
608 if [[ $KMNAME = koffice && $PN != koffice-data ]]; then
609 rm "$D/$KDEDIR/include/config-openexr.h"
610 rm "$D/$KDEDIR/share/apps/cmake/modules/FindKOfficeLibs.cmake"
611 fi
612} 703}
613 704
614# @FUNCTION: kde4-meta_src_make_doc 705# @FUNCTION: kde4-meta_src_make_doc
615# @DESCRIPTION: 706# @DESCRIPTION:
616# This function searches in ${S}/${KMMODULE}, 707# This function searches in ${S}/${KMMODULE},
617# and tries to install "AUTHORS ChangeLog* README* NEWS todo" if these files exist. 708# and tries to install "AUTHORS ChangeLog* README* NEWS todo" if these files exist.
618kde4-meta_src_make_doc() { 709kde4-meta_src_make_doc() {
619 debug-print-function $FUNCNAME "$@" 710 debug-print-function ${FUNCNAME} "$@"
620 711
621 local doc 712 local doc
622 for doc in AUTHORS ChangeLog* README* NEWS TODO; do 713 for doc in AUTHORS ChangeLog* README* NEWS TODO; do
623 [[ -s ${KMMODULE}/$doc ]] && newdoc "${KMMODULE}/${doc}" "${doc}.${KMMODULE##*/}" 714 [[ -s ${KMMODULE}/${doc} ]] && newdoc "${KMMODULE}/${doc}" "${doc}.${KMMODULE##*/}"
624 done 715 done
625 716
626 kde4-base_src_make_doc 717 kde4-base_src_make_doc
627} 718}
628 719
629# @FUNCTION: kde4-meta_pkg_postinst 720# @FUNCTION: kde4-meta_pkg_postinst
630# @DESCRIPTION: 721# @DESCRIPTION:
631# Currently just calls its equivalent in kde4-base.eclass(5). Use this in split 722# Display information about application handbook and invoke kbuildsycoca4.
632# ebuilds.
633kde4-meta_pkg_postinst() { 723kde4-meta_pkg_postinst() {
724 debug-print-function ${FUNCNAME} "$@"
725
726 if has handbook ${IUSE//+} && ! use handbook; then
727 echo
728 einfo "Application handbook for ${PN} has not been installed."
729 einfo "To install handbook, reemerge =${CATEGORY}/${P} with 'handbook' USE flag."
730 echo
731 fi
732
634 kde4-base_pkg_postinst 733 kde4-base_pkg_postinst
635} 734}
636 735
637# @FUNCTION: kde4-meta_pkg_postrm 736# @FUNCTION: kde4-meta_pkg_postrm
638# @DESCRIPTION: 737# @DESCRIPTION:
639# Currently just calls its equivalent in kde4-base.eclass(5). Use this in split 738# Currently just calls its equivalent in kde4-base.eclass(5). Use this in split
640# ebuilds. 739# ebuilds.
641kde4-meta_pkg_postrm() { 740kde4-meta_pkg_postrm() {
741 debug-print-function ${FUNCNAME} "$@"
742
642 kde4-base_pkg_postrm 743 kde4-base_pkg_postrm
643} 744}
644

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.22

  ViewVC Help
Powered by ViewVC 1.1.20