| 1 | # Copyright 1999-2008 Gentoo Foundation |
1 | # Copyright 1999-2008 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.2 2008/02/15 19:48:40 zlin Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.6 2008/05/15 19:49:32 ingmar 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. |
| … | |
… | |
| 26 | case ${KDEBASE} in |
26 | case ${KDEBASE} in |
| 27 | kde-base) HOMEPAGE="http://www.kde.org/" |
27 | kde-base) HOMEPAGE="http://www.kde.org/" |
| 28 | LICENSE="GPL-2" ;; |
28 | LICENSE="GPL-2" ;; |
| 29 | koffice) HOMEPAGE="http://www.koffice.org/" |
29 | koffice) HOMEPAGE="http://www.koffice.org/" |
| 30 | LICENSE="GPL-2" ;; |
30 | LICENSE="GPL-2" ;; |
| 31 | *) die "KDEBASE=${KDEBASE} is unsupported." ;; |
|
|
| 32 | esac |
31 | esac |
| 33 | |
32 | |
| 34 | debug-print "${BASH_SOURCE} ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - before blockers" |
33 | debug-print "${BASH_SOURCE} ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - before blockers" |
| 35 | debug-print "${BASH_SOURCE} ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - before blockers" |
34 | debug-print "${BASH_SOURCE} ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - before blockers" |
| 36 | |
35 | |
| 37 | # Add a blocker on the package we're derived from |
36 | # Add a blocker on the package we're derived from |
|
|
37 | if [[ -n ${KDEBASE} ]]; then |
| 38 | DEPEND="${DEPEND} !$(get-parent-package ${CATEGORY}/${PN}):${SLOT}" |
38 | DEPEND="${DEPEND} !$(get-parent-package ${CATEGORY}/${PN}):${SLOT}" |
| 39 | RDEPEND="${RDEPEND} !$(get-parent-package ${CATEGORY}/${PN}):${SLOT}" |
39 | RDEPEND="${RDEPEND} !$(get-parent-package ${CATEGORY}/${PN}):${SLOT}" |
|
|
40 | fi |
| 40 | |
41 | |
| 41 | debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after blockers" |
42 | debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after blockers" |
| 42 | debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after blockers" |
43 | debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after blockers" |
| 43 | |
44 | |
| 44 | # Add dependencies that all packages in a certain module share. |
45 | # Add dependencies that all packages in a certain module share. |
| … | |
… | |
| 46 | kdebase|kdebase-workspace|kdebase-runtime) |
47 | kdebase|kdebase-workspace|kdebase-runtime) |
| 47 | DEPEND="${DEPEND} >=kde-base/qimageblitz-0.0.4" |
48 | DEPEND="${DEPEND} >=kde-base/qimageblitz-0.0.4" |
| 48 | RDEPEND="${RDEPEND} >=kde-base/qimageblitz-0.0.4" |
49 | RDEPEND="${RDEPEND} >=kde-base/qimageblitz-0.0.4" |
| 49 | ;; |
50 | ;; |
| 50 | kdepim) |
51 | kdepim) |
|
|
52 | DEPEND="${DEPEND} dev-libs/boost" |
|
|
53 | RDEPEND="${RDEPEND} dev-libs/boost" |
| 51 | if [[ ${PN} != kode ]]; then |
54 | if [[ ${PN} != kode ]]; then |
| 52 | DEPEND="${DEPEND} >=kde-base/kode-${PV}:${SLOT}" |
55 | DEPEND="${DEPEND} >=kde-base/kode-${PV}:${SLOT}" |
| 53 | RDEPEND="${RDEPEND} >=kde-base/kode-${PV}:${SLOT}" |
56 | RDEPEND="${RDEPEND} >=kde-base/kode-${PV}:${SLOT}" |
| 54 | fi |
57 | fi |
| 55 | case ${PN} in |
58 | case ${PN} in |
| … | |
… | |
| 139 | # This function unpacks the source for split ebuilds. See also |
142 | # This function unpacks the source for split ebuilds. See also |
| 140 | # kde4-meta-src_extract. |
143 | # kde4-meta-src_extract. |
| 141 | kde4-meta_src_unpack() { |
144 | kde4-meta_src_unpack() { |
| 142 | debug-print-function ${FUNCNAME} "$@" |
145 | debug-print-function ${FUNCNAME} "$@" |
| 143 | |
146 | |
| 144 | if [[ ${KMNAME} = kdepim ]] && \ |
|
|
| 145 | has kontact ${IUSE//+} && \ |
|
|
| 146 | use kontact; then |
|
|
| 147 | KMEXTRA="${KMEXTRA} kontact/plugins/${PLUGINNAME:-${PN}}" |
|
|
| 148 | KMEXTRACTONLY="${KMEXTRACTONLY} kontact/interfaces/" |
|
|
| 149 | fi |
|
|
| 150 | |
|
|
| 151 | kde4-meta_src_extract |
147 | kde4-meta_src_extract |
| 152 | kde4-meta_change_cmakelists |
148 | kde4-meta_change_cmakelists |
| 153 | } |
149 | } |
| 154 | |
150 | |
| 155 | # @FUNCTION: kde4-meta_src_extract |
151 | # @FUNCTION: kde4-meta_src_extract |
| 156 | # @DESCRIPTION: |
152 | # @DESCRIPTION: |
| 157 | # A function to unpack the source for a split KDE ebuild. |
153 | # A function to unpack the source for a split KDE ebuild. |
| 158 | # Also see KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and KMTARPARAMS. |
154 | # Also see KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and KMTARPARAMS. |
| 159 | kde4-meta_src_extract() { |
155 | kde4-meta_src_extract() { |
| 160 | local tarball tarfile f extractlist |
156 | local abort tarball tarfile f extractlist |
| 161 | tarball="${KMNAME}-${PV}.tar.bz2" |
157 | tarball="${KMNAME}-${PV}.tar.bz2" |
| 162 | tarfile="${DISTDIR}"/${tarball} |
158 | tarfile="${DISTDIR}"/${tarball} |
| 163 | |
159 | |
| 164 | einfo "Unpacking parts of ${tarball} to ${WORKDIR}" |
160 | echo "Unpacking parts of ${tarball} to ${WORKDIR}" |
| 165 | |
161 | |
| 166 | kde4-meta_create_extractlists |
162 | kde4-meta_create_extractlists |
| 167 | |
163 | |
| 168 | for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake \ |
164 | for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake \ |
| 169 | AUTHORS COPYING INSTALL README NEWS ChangeLog |
165 | AUTHORS COPYING INSTALL README NEWS ChangeLog |
| … | |
… | |
| 172 | done |
168 | done |
| 173 | extractlist="${extractlist} $(__list_needed_subdirectories)" |
169 | extractlist="${extractlist} $(__list_needed_subdirectories)" |
| 174 | KMTARPARAMS="${KMTARPARAMS} -j" |
170 | KMTARPARAMS="${KMTARPARAMS} -j" |
| 175 | |
171 | |
| 176 | pushd "${WORKDIR}" > /dev/null |
172 | pushd "${WORKDIR}" > /dev/null |
|
|
173 | [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf $tarfile $KMTARPARAMS $extractlist >&2 |
| 177 | tar -xpf $tarfile $KMTARPARAMS $extractlist 2> /dev/null |
174 | tar -xpf $tarfile $KMTARPARAMS $extractlist 2> /dev/null |
| 178 | |
175 | |
| 179 | # Default $S is based on $P; rename the extracted directory to match $S |
176 | # Default $S is based on $P; rename the extracted directory to match $S |
| 180 | mv ${KMNAME}-${PV} ${P} || die "Died while moving \"${KMNAME}-${PV}\" to \"${P}\"" |
177 | mv ${KMNAME}-${PV} ${P} || die "Died while moving \"${KMNAME}-${PV}\" to \"${P}\"" |
| 181 | |
178 | |
| 182 | popd > /dev/null |
179 | popd > /dev/null |
|
|
180 | |
|
|
181 | if [[ -n ${KDE4_STRICTER} ]]; then |
|
|
182 | for f in $(__list_needed_subdirectories fatal); do |
|
|
183 | if [[ ! -e ${S}/${f#*/} ]]; then |
|
|
184 | eerror "'${f#*/}' is missing" |
|
|
185 | abort=true |
|
|
186 | fi |
|
|
187 | done |
|
|
188 | [[ -n ${abort} ]] && die "There were missing files." |
|
|
189 | fi |
|
|
190 | |
| 183 | kde4-base_src_unpack |
191 | kde4-base_src_unpack |
| 184 | } |
192 | } |
| 185 | |
193 | |
| 186 | # Create lists of files and subdirectories to extract. |
194 | # Create lists of files and subdirectories to extract. |
| 187 | # Also see the descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and KMTARPARAMS. |
195 | # Also see the descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and KMTARPARAMS. |
| … | |
… | |
| 189 | debug-print-function ${FUNCNAME} "$@" |
197 | debug-print-function ${FUNCNAME} "$@" |
| 190 | |
198 | |
| 191 | if has htmlhandbook ${IUSE//+} && use htmlhandbook; then |
199 | if has htmlhandbook ${IUSE//+} && use htmlhandbook; then |
| 192 | # We use the basename of $KMMODULE because $KMMODULE can contain |
200 | # We use the basename of $KMMODULE because $KMMODULE can contain |
| 193 | # the path to the module subdirectory. |
201 | # the path to the module subdirectory. |
| 194 | KMEXTRA="${KMEXTRA} doc/${KMMODULE##*/}" |
202 | KMEXTRA_NONFATAL="${KMEXTRA_NONFATAL} doc/${KMMODULE##*/}" |
| 195 | fi |
203 | fi |
| 196 | |
204 | |
| 197 | # Add some CMake-files to KMEXTRACTONLY. |
205 | # Add some CMake-files to KMEXTRACTONLY. |
| 198 | # Note that this actually doesn't include KMEXTRA handling. |
206 | # Note that this actually doesn't include KMEXTRA handling. |
| 199 | # In those cases you should care to add the relevant files to KMEXTRACTONLY |
207 | # In those cases you should care to add the relevant files to KMEXTRACTONLY |
| … | |
… | |
| 219 | if [[ ${PN} != "libkdegames" ]]; then |
227 | if [[ ${PN} != "libkdegames" ]]; then |
| 220 | KMEXTRACTONLY="${KMEXTRACTONLY} |
228 | KMEXTRACTONLY="${KMEXTRACTONLY} |
| 221 | libkdegames" |
229 | libkdegames" |
| 222 | fi |
230 | fi |
| 223 | ;; |
231 | ;; |
|
|
232 | kdepim) |
|
|
233 | KMEXTRACTONLY="${KMEXTRACTONLY} |
|
|
234 | kleopatra/ConfigureChecks.cmake" |
|
|
235 | if has kontact ${IUSE//+} && use kontact; then |
|
|
236 | KMEXTRA="${KMEXTRA} kontact/plugins/${PLUGINNAME:-${PN}}" |
|
|
237 | KMEXTRACTONLY="${KMEXTRACTONLY} kontact/interfaces/" |
|
|
238 | fi |
|
|
239 | ;; |
| 224 | koffice) |
240 | koffice) |
| 225 | KMEXTRACTONLY="${KMEXTRACTONLY} |
241 | KMEXTRACTONLY="${KMEXTRACTONLY} |
| 226 | config-endian.h.cmake |
242 | config-endian.h.cmake |
| 227 | filters/config-filters.h.cmake |
243 | filters/config-filters.h.cmake |
| 228 | config-openexr.h.cmake |
244 | config-openexr.h.cmake |
| … | |
… | |
| 230 | config-prefix.h.cmake" |
246 | config-prefix.h.cmake" |
| 231 | ;; |
247 | ;; |
| 232 | esac |
248 | esac |
| 233 | # Don't install cmake modules for split ebuilds to avoid collisions. |
249 | # Don't install cmake modules for split ebuilds to avoid collisions. |
| 234 | case ${KMNAME} in |
250 | case ${KMNAME} in |
| 235 | kdebase-workspace|kdebase-runtime|kdepim|kdegames) |
251 | kdebase-workspace|kdebase-runtime|kdepim|kdegames|kdegraphics) |
|
|
252 | if [[ ${PN} != "libkdegames" ]]; then |
| 236 | KMCOMPILEONLY="${KMCOMPILEONLY} |
253 | KMCOMPILEONLY="${KMCOMPILEONLY} |
| 237 | cmake/modules/" |
254 | cmake/modules/" |
|
|
255 | else |
|
|
256 | KMEXTRA="${KMEXTRA} |
|
|
257 | cmake/modules/" |
|
|
258 | fi |
| 238 | ;; |
259 | ;; |
| 239 | esac |
260 | esac |
| 240 | |
261 | |
| 241 | debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}" |
262 | debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}" |
| 242 | } |
263 | } |
| 243 | |
264 | |
| 244 | __list_needed_subdirectories() { |
265 | __list_needed_subdirectories() { |
| 245 | local i j kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist topdir |
266 | local i j kmextra kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist topdir |
| 246 | |
267 | |
| 247 | # We expand KMEXTRA by adding CMakeLists.txt files |
268 | # We expand KMEXTRA by adding CMakeLists.txt files |
| 248 | for i in ${KMEXTRA}; do |
269 | kmextra="${KMEXTRA}" |
|
|
270 | [[ ${1} != fatal ]] && kmextra="${kmextra} ${KMEXTRA_NONFATAL}" |
|
|
271 | for i in ${kmextra}; do |
| 249 | kmextra_expanded="${kmextra_expanded} ${i}" |
272 | kmextra_expanded="${kmextra_expanded} ${i}" |
| 250 | j=$(dirname ${i}) |
273 | j=$(dirname ${i}) |
| 251 | while [[ ${j} != "." ]]; do |
274 | while [[ ${j} != "." ]]; do |
| 252 | kmextra_expanded="${kmextra_expanded} ${j}/CMakeLists.txt"; |
275 | kmextra_expanded="${kmextra_expanded} ${j}/CMakeLists.txt"; |
| 253 | j=$(dirname ${j}) |
276 | j=$(dirname ${j}) |
| … | |
… | |
| 277 | debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmextra_expanded: ${kmextra_expanded}" |
300 | debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmextra_expanded: ${kmextra_expanded}" |
| 278 | debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmmodule_expanded: ${kmmodule_expanded}" |
301 | debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmmodule_expanded: ${kmmodule_expanded}" |
| 279 | debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmcompileonly_expanded: ${kmcompileonly_expanded}" |
302 | debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmcompileonly_expanded: ${kmcompileonly_expanded}" |
| 280 | |
303 | |
| 281 | |
304 | |
| 282 | case ${NEED_KDE} in |
305 | case ${PV} in |
| 283 | svn) : ;; |
306 | scm|9999.4) : ;; |
| 284 | *) topdir="${KMNAME}-${PV}/" ;; |
307 | *) topdir="${KMNAME}-${PV}/" ;; |
| 285 | esac |
308 | esac |
| 286 | |
309 | |
| 287 | # Create final list of stuff to extract |
310 | # Create final list of stuff to extract |
| 288 | for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \ |
311 | for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \ |
| … | |
… | |
| 292 | done |
315 | done |
| 293 | |
316 | |
| 294 | echo ${extractlist} |
317 | echo ${extractlist} |
| 295 | } |
318 | } |
| 296 | |
319 | |
|
|
320 | save_library_dependencies() { |
|
|
321 | local depsfile="${T}/${PN}:${SLOT}" |
|
|
322 | |
|
|
323 | echo "Saving library dependendencies in ${depsfile##*/}" |
|
|
324 | echo "EXPORT_LIBRARY_DEPENDENCIES(\"${depsfile}\")" >> "${S}/CMakeLists.txt" || \ |
|
|
325 | die "Failed to save the library dependencies." |
|
|
326 | } |
|
|
327 | |
|
|
328 | install_library_dependencies() { |
|
|
329 | local depsfile="${T}/${PN}:${SLOT}" |
|
|
330 | echo "Installing library dependendencies as ${depsfile##*/}" |
|
|
331 | insinto /var/lib/kde |
|
|
332 | doins "${depsfile}" || die "Failed to install library dependencies." |
|
|
333 | } |
|
|
334 | |
|
|
335 | load_library_dependencies() { |
|
|
336 | local pn i depsfile |
|
|
337 | echo "Injecting library dependendencies from '${KMLOADLIBS}'" |
|
|
338 | |
|
|
339 | i=0 |
|
|
340 | for pn in ${KMLOADLIBS} ; do |
|
|
341 | ((i++)) |
|
|
342 | depsfile="/var/lib/kde/${pn}:${SLOT}" |
|
|
343 | [[ -r "${depsfile}" ]] || die "Depsfile '${depsfile}' not accessible. You probably need to reinstall ${pn}." |
|
|
344 | sed -i -e "${i}iINCLUDE(\"${depsfile}\")" "${S}/CMakeLists.txt" || \ |
|
|
345 | die "Failed to include library dependencies for ${pn}" |
|
|
346 | done |
|
|
347 | } |
|
|
348 | |
| 297 | # @FUNCTION: kde4-meta_src_compile |
349 | # @FUNCTION: kde4-meta_src_compile |
| 298 | # @DESCRIPTION: |
350 | # @DESCRIPTION: |
| 299 | # General function for compiling split KDE4 applications. |
351 | # General function for compiling split KDE4 applications. |
| 300 | kde4-meta_src_compile() { |
352 | kde4-meta_src_compile() { |
| 301 | debug-print-function ${FUNCNAME} "$@" |
353 | debug-print-function ${FUNCNAME} "$@" |
| … | |
… | |
| 308 | debug-print-function ${FUNCNAME} "$@" |
360 | debug-print-function ${FUNCNAME} "$@" |
| 309 | |
361 | |
| 310 | local _olddir _dir |
362 | local _olddir _dir |
| 311 | _dir="${S}"/${1} |
363 | _dir="${S}"/${1} |
| 312 | until [[ ${_dir} == "${S}" ]]; do |
364 | until [[ ${_dir} == "${S}" ]]; do |
| 313 | _olddir=$(basename ${_dir}) |
365 | _olddir=$(basename "${_dir}") |
| 314 | _dir=$(dirname ${_dir}) |
366 | _dir=$(dirname "${_dir}") |
| 315 | debug-print "${LINENO}: processing ${_dir} CMakeLists.txt searching for ${_olddir}" |
367 | debug-print "${LINENO}: processing ${_dir} CMakeLists.txt searching for ${_olddir}" |
| 316 | if [[ -f ${_dir}/CMakeLists.txt ]]; then |
368 | if [[ -f ${_dir}/CMakeLists.txt ]]; then |
| 317 | sed -i -e "/[[:space:]]*${_olddir}[[:space:]]*/s/^#DONOTCOMPILE //" ${_dir}/CMakeLists.txt || \ |
369 | sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${_olddir}[[:space:]]*)/s/#DONOTCOMPILE //g" \ |
|
|
370 | -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${_olddir}[[:space:]]*)/s/#DONOTCOMPILE //g" \ |
| 318 | die "${LINENO}: died in ${FUNCNAME} while processing ${_dir}" |
371 | -i ${_dir}/CMakeLists.txt || die "${LINENO}: died in ${FUNCNAME} while processing ${_dir}" |
| 319 | fi |
372 | fi |
| 320 | done |
373 | done |
| 321 | } |
374 | } |
| 322 | |
375 | |
| 323 | kde4-meta_change_cmakelists() { |
376 | kde4-meta_change_cmakelists() { |
| 324 | debug-print-function ${FUNCNAME} "$@" |
377 | debug-print-function ${FUNCNAME} "$@" |
| 325 | |
378 | |
| 326 | pushd "${S}" > /dev/null |
379 | pushd "${S}" > /dev/null |
| 327 | |
380 | |
|
|
381 | if [[ -n ${KMSAVELIBS} ]] ; then |
|
|
382 | save_library_dependencies |
|
|
383 | fi |
|
|
384 | |
|
|
385 | if [[ -n ${KMLOADLIBS} ]] ; then |
|
|
386 | load_library_dependencies |
|
|
387 | fi |
|
|
388 | |
| 328 | comment_all_add_subdirectory ./ |
389 | comment_all_add_subdirectory ./ |
| 329 | |
390 | |
| 330 | # Restore "add_subdirectory( cmake )" in ${S}/CMakeLists.txt |
391 | # Restore "add_subdirectory( cmake )" in ${S}/CMakeLists.txt |
| 331 | if [[ -f "${S}"/CMakeLists.txt ]]; then |
392 | if [[ -f "${S}"/CMakeLists.txt ]]; then |
| 332 | sed -i -e '/ *cmake */s/^#DONOTCOMPILE //' "${S}"/CMakeLists.txt || die "${LINENO}: cmake sed died" |
393 | sed -e '/add_subdirectory[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \ |
|
|
394 | -e '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \ |
|
|
395 | -i "${S}"/CMakeLists.txt || die "${LINENO}: cmake sed died" |
| 333 | fi |
396 | fi |
| 334 | |
397 | |
| 335 | if [[ -z ${KMNOMODULE} ]]; then |
398 | if [[ -z ${KMNOMODULE} ]]; then |
| 336 | # Restore "add_subdirectory" in $KMMODULE subdirectories |
399 | # Restore "add_subdirectory" in $KMMODULE subdirectories |
| 337 | find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ |
400 | find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ |
| … | |
… | |
| 355 | done |
418 | done |
| 356 | |
419 | |
| 357 | # KMEXTRA section |
420 | # KMEXTRA section |
| 358 | for i in ${KMEXTRA}; do |
421 | for i in ${KMEXTRA}; do |
| 359 | debug-print "${LINENO}: KMEXTRA section, processing ${i}" |
422 | debug-print "${LINENO}: KMEXTRA section, processing ${i}" |
| 360 | # Ebuilds use KMEXTRA incorrectly to extract files which should be in $KMEXTRACTONLY |
423 | find "${S}"/${i} -name CMakeLists.txt -print0 | \ |
|
|
424 | xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ |
|
|
425 | die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}" |
|
|
426 | _change_cmakelists_parent_dirs ${i} |
|
|
427 | done |
|
|
428 | # KMEXTRA_NONFATAL section |
|
|
429 | for i in ${KMEXTRA_NONFATAL}; do |
| 361 | if [[ -d "${S}"/${i} ]]; then |
430 | if [[ -d "${S}"/${i} ]]; then |
| 362 | find "${S}"/${i} -name CMakeLists.txt -print0 | \ |
431 | find "${S}"/${i} -name CMakeLists.txt -print0 | \ |
| 363 | xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ |
432 | xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ |
| 364 | die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}" |
433 | die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}" |
| 365 | _change_cmakelists_parent_dirs ${i} |
434 | _change_cmakelists_parent_dirs ${i} |
| 366 | else |
|
|
| 367 | [[ ${i} == doc/* ]] || \ |
|
|
| 368 | die "KMEXTRA should be used to compile and install subdirectories other than \$KMMODULE. Use KMEXTRACTONLY to extract some files." |
|
|
| 369 | fi |
|
|
| 370 | done |
|
|
| 371 | |
|
|
| 372 | # Documentation section |
|
|
| 373 | if [[ -n ${docs} ]]; then |
|
|
| 374 | sed -i -e '/ *doc */s/^#DONOTCOMPILE //g' "${S}"/CMakeLists.txt || \ |
|
|
| 375 | die "${LINENO}: sed died while uncommenting doc dir" |
|
|
| 376 | |
|
|
| 377 | if [[ -f "${S}"/doc/CMakeLists.txt ]]; then |
|
|
| 378 | sed -i -e "/( *${KMMODULE##*/} *)/s/^#DONOTCOMPILE //g" "${S}"/doc/CMakeLists.txt \ |
|
|
| 379 | || die "${LINENO}: sed died while uncommenting apps documentation in doc subdir " |
|
|
| 380 | fi |
|
|
| 381 | fi |
435 | fi |
|
|
436 | done |
| 382 | |
437 | |
| 383 | # KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY |
438 | # KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY |
| 384 | for i in ${KMEXTRACTONLY}; do |
439 | for i in ${KMEXTRACTONLY}; do |
| 385 | if [[ -d "${S}"/${i} && -f "${S}"/${i}/../CMakeLists.txt ]]; then |
440 | if [[ -d "${S}"/${i} && -f "${S}"/${i}/../CMakeLists.txt ]]; then |
| 386 | sed -i -e "/( *$(basename $i) *)/s/^/#DONOTCOMPILE /" "${S}"/${i}/../CMakeLists.txt || \ |
441 | sed -i -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" "${S}"/${i}/../CMakeLists.txt || \ |
| 387 | die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}" |
442 | die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}" |
| 388 | fi |
443 | fi |
| 389 | done |
444 | done |
| 390 | |
445 | |
| 391 | # COLLISION PROTECT section |
|
|
| 392 | # Only install the startkde script as part of kde-base/kdebase-startkde, |
|
|
| 393 | # instead of with every package. |
|
|
| 394 | case ${KMNAME} in |
446 | case ${KMNAME} in |
| 395 | kdebase-workspace) |
447 | kdebase-workspace) |
|
|
448 | # COLLISION PROTECT section |
|
|
449 | # Only install the startkde script as part of kde-base/kdebase-startkde, |
|
|
450 | # instead of with every package. |
| 396 | if [[ ${PN} != "kdebase-startkde" && -f "${S}"/CMakeLists.txt ]]; then |
451 | if [[ ${PN} != "kdebase-startkde" && -f "${S}"/CMakeLists.txt ]]; then |
| 397 | case ${PV} in |
452 | case ${PV} in |
| 398 | *) # The startkde script moved to kdebase-workspace for KDE4 versions > 3.93.0. |
453 | *) # The startkde script moved to kdebase-workspace for KDE4 versions > 3.93.0. |
| 399 | sed -i -e '/startkde/s/^/#DONOTINSTALL /' "${S}"/CMakeLists.txt || \ |
454 | sed -i -e '/startkde/s/^/#DONOTINSTALL /' "${S}"/CMakeLists.txt || \ |
| 400 | die "${LINENO}: sed died in the kdebase-startkde collision prevention section" |
455 | die "${LINENO}: sed died in the kdebase-startkde collision prevention section" |
| 401 | ;; |
456 | ;; |
| 402 | esac |
457 | esac |
| 403 | fi |
458 | fi |
| 404 | ;; |
459 | ;; |
|
|
460 | kdebase-runtime) |
|
|
461 | # COLLISION PROTECT section |
|
|
462 | # Only install the kde4 script as part of kde-base/kdebase-data |
|
|
463 | if [[ ${PN} != "kdebase-data" && -f "${S}"/CMakeLists.txt ]]; then |
|
|
464 | sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \ |
|
|
465 | "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed" |
|
|
466 | fi |
|
|
467 | ;; |
|
|
468 | kdepim) |
|
|
469 | case ${PN} in |
|
|
470 | kaddressbook|kmailcvt|kontact|korganizer) |
|
|
471 | sed -i -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \ |
|
|
472 | -e '/add_custom_target(kmail_xml /,/)/p' "${S}"/kmail/CMakeLists.txt || die "uncommenting xml failed" |
|
|
473 | _change_cmakelists_parent_dirs kmail |
|
|
474 | ;; |
|
|
475 | esac |
|
|
476 | ;; |
|
|
477 | kdeutils) |
| 405 | # This is sort of a hack to avoid patching 16 kdeutils packages with |
478 | # This is sort of a hack to avoid patching 16 kdeutils packages with |
| 406 | # r775410 from upstream trunk which makes blitz optional so superkaramba |
479 | # r775410 from upstream trunk which makes blitz optional so superkaramba |
| 407 | # only gets compiled when it is found. Bug #209324. Remove this no later |
480 | # only gets compiled when it is found. Bug #209324. Remove this no later |
| 408 | # than 4.1. |
481 | # than 4.1. |
| 409 | kdeutils) |
|
|
| 410 | if [[ ${PN} != superkaramba && ${SLOT} == kde-4 ]]; then |
482 | if [[ ${PN} != superkaramba && ${SLOT} == kde-4 ]]; then |
| 411 | sed -i -e '/find_package(Blitz REQUIRED)/d' "${S}"/CMakeLists.txt \ |
483 | sed -i -e '/find_package(Blitz REQUIRED)/d' "${S}"/CMakeLists.txt \ |
| 412 | || die "${LINENO}: sed to remove dependency on Blitz failed." |
484 | || die "${LINENO}: sed to remove dependency on Blitz failed." |
| 413 | fi |
485 | fi |
| 414 | ;; |
486 | ;; |
| … | |
… | |
| 460 | kde4-meta_src_install() { |
532 | kde4-meta_src_install() { |
| 461 | debug-print-function $FUNCNAME "$@" |
533 | debug-print-function $FUNCNAME "$@" |
| 462 | |
534 | |
| 463 | kde4-meta_src_make_doc |
535 | kde4-meta_src_make_doc |
| 464 | cmake-utils_src_install |
536 | cmake-utils_src_install |
|
|
537 | |
|
|
538 | if [[ -n ${KMSAVELIBS} ]] ; then |
|
|
539 | install_library_dependencies |
|
|
540 | fi |
| 465 | } |
541 | } |
| 466 | |
542 | |
| 467 | # @FUNCTION: kde4-meta_src_make_doc |
543 | # @FUNCTION: kde4-meta_src_make_doc |
| 468 | # @DESCRIPTION: |
544 | # @DESCRIPTION: |
| 469 | # This function searches under ${S}/${KMMODULE}, |
545 | # This function searches under ${S}/${KMMODULE}, |