/[gentoo-x86]/eclass/kde4-meta.eclass
Gentoo

Diff of /eclass/kde4-meta.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.3 Revision 1.4
1# Copyright 1999-2008 Gentoo Foundation 1# Copyright 1999-2008 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.3 2008/02/24 21:45:39 keytoaster Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.4 2008/03/10 21:43:10 zlin 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.
155# @FUNCTION: kde4-meta_src_extract 155# @FUNCTION: kde4-meta_src_extract
156# @DESCRIPTION: 156# @DESCRIPTION:
157# A function to unpack the source for a split KDE ebuild. 157# A function to unpack the source for a split KDE ebuild.
158# Also see KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and KMTARPARAMS. 158# Also see KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and KMTARPARAMS.
159kde4-meta_src_extract() { 159kde4-meta_src_extract() {
160 local tarball tarfile f extractlist 160 local abort tarball tarfile f extractlist
161 tarball="${KMNAME}-${PV}.tar.bz2" 161 tarball="${KMNAME}-${PV}.tar.bz2"
162 tarfile="${DISTDIR}"/${tarball} 162 tarfile="${DISTDIR}"/${tarball}
163 163
164 einfo "Unpacking parts of ${tarball} to ${WORKDIR}" 164 einfo "Unpacking parts of ${tarball} to ${WORKDIR}"
165 165
172 done 172 done
173 extractlist="${extractlist} $(__list_needed_subdirectories)" 173 extractlist="${extractlist} $(__list_needed_subdirectories)"
174 KMTARPARAMS="${KMTARPARAMS} -j" 174 KMTARPARAMS="${KMTARPARAMS} -j"
175 175
176 pushd "${WORKDIR}" > /dev/null 176 pushd "${WORKDIR}" > /dev/null
177 [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf $tarfile $KMTARPARAMS $extractlist >&2
177 tar -xpf $tarfile $KMTARPARAMS $extractlist 2> /dev/null 178 tar -xpf $tarfile $KMTARPARAMS $extractlist 2> /dev/null
178 179
179 # Default $S is based on $P; rename the extracted directory to match $S 180 # 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}\"" 181 mv ${KMNAME}-${PV} ${P} || die "Died while moving \"${KMNAME}-${PV}\" to \"${P}\""
181 182
182 popd > /dev/null 183 popd > /dev/null
184
185 if [[ -n ${KDE4_STRICTER} ]]; then
186 for f in $(__list_needed_subdirectories fatal); do
187 if [[ ! -e ${S}/${f#*/} ]]; then
188 eerror "'${f#*/}' is missing"
189 abort=true
190 fi
191 done
192 [[ -n ${abort} ]] && die "There were missing files."
193 fi
194
183 kde4-base_src_unpack 195 kde4-base_src_unpack
184} 196}
185 197
186# Create lists of files and subdirectories to extract. 198# Create lists of files and subdirectories to extract.
187# Also see the descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and KMTARPARAMS. 199# Also see the descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and KMTARPARAMS.
189 debug-print-function ${FUNCNAME} "$@" 201 debug-print-function ${FUNCNAME} "$@"
190 202
191 if has htmlhandbook ${IUSE//+} && use htmlhandbook; then 203 if has htmlhandbook ${IUSE//+} && use htmlhandbook; then
192 # We use the basename of $KMMODULE because $KMMODULE can contain 204 # We use the basename of $KMMODULE because $KMMODULE can contain
193 # the path to the module subdirectory. 205 # the path to the module subdirectory.
194 KMEXTRA="${KMEXTRA} doc/${KMMODULE##*/}" 206 KMEXTRA_NONFATAL="${KMEXTRA_NONFATAL} doc/${KMMODULE##*/}"
195 fi 207 fi
196 208
197 # Add some CMake-files to KMEXTRACTONLY. 209 # Add some CMake-files to KMEXTRACTONLY.
198 # Note that this actually doesn't include KMEXTRA handling. 210 # Note that this actually doesn't include KMEXTRA handling.
199 # In those cases you should care to add the relevant files to KMEXTRACTONLY 211 # In those cases you should care to add the relevant files to KMEXTRACTONLY
230 config-prefix.h.cmake" 242 config-prefix.h.cmake"
231 ;; 243 ;;
232 esac 244 esac
233 # Don't install cmake modules for split ebuilds to avoid collisions. 245 # Don't install cmake modules for split ebuilds to avoid collisions.
234 case ${KMNAME} in 246 case ${KMNAME} in
235 kdebase-workspace|kdebase-runtime|kdepim|kdegames) 247 kdebase-workspace|kdebase-runtime|kdepim|kdegames|kdegraphics)
236 if [[ ${PN} != "libkdegames" ]]; then 248 if [[ ${PN} != "libkdegames" ]]; then
237 KMCOMPILEONLY="${KMCOMPILEONLY} 249 KMCOMPILEONLY="${KMCOMPILEONLY}
238 cmake/modules/" 250 cmake/modules/"
239 else 251 else
240 KMEXTRA="${KMEXTRA} 252 KMEXTRA="${KMEXTRA}
245 257
246 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}" 258 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}"
247} 259}
248 260
249__list_needed_subdirectories() { 261__list_needed_subdirectories() {
250 local i j kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist topdir 262 local i j kmextra kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist topdir
251 263
252 # We expand KMEXTRA by adding CMakeLists.txt files 264 # We expand KMEXTRA by adding CMakeLists.txt files
253 for i in ${KMEXTRA}; do 265 kmextra="${KMEXTRA}"
266 [[ ${1} != fatal ]] && kmextra="${kmextra} ${KMEXTRA_NONFATAL}"
267 for i in ${kmextra}; do
254 kmextra_expanded="${kmextra_expanded} ${i}" 268 kmextra_expanded="${kmextra_expanded} ${i}"
255 j=$(dirname ${i}) 269 j=$(dirname ${i})
256 while [[ ${j} != "." ]]; do 270 while [[ ${j} != "." ]]; do
257 kmextra_expanded="${kmextra_expanded} ${j}/CMakeLists.txt"; 271 kmextra_expanded="${kmextra_expanded} ${j}/CMakeLists.txt";
258 j=$(dirname ${j}) 272 j=$(dirname ${j})
360 done 374 done
361 375
362 # KMEXTRA section 376 # KMEXTRA section
363 for i in ${KMEXTRA}; do 377 for i in ${KMEXTRA}; do
364 debug-print "${LINENO}: KMEXTRA section, processing ${i}" 378 debug-print "${LINENO}: KMEXTRA section, processing ${i}"
365 # Ebuilds use KMEXTRA incorrectly to extract files which should be in $KMEXTRACTONLY 379 find "${S}"/${i} -name CMakeLists.txt -print0 | \
380 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
381 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
382 _change_cmakelists_parent_dirs ${i}
383 done
384 # KMEXTRA_NONFATAL section
385 for i in ${KMEXTRA_NONFATAL}; do
366 if [[ -d "${S}"/${i} ]]; then 386 if [[ -d "${S}"/${i} ]]; then
367 find "${S}"/${i} -name CMakeLists.txt -print0 | \ 387 find "${S}"/${i} -name CMakeLists.txt -print0 | \
368 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ 388 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
369 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}" 389 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
370 _change_cmakelists_parent_dirs ${i} 390 _change_cmakelists_parent_dirs ${i}
371 else
372 [[ ${i} == doc/* ]] || \
373 die "KMEXTRA should be used to compile and install subdirectories other than \$KMMODULE. Use KMEXTRACTONLY to extract some files."
374 fi 391 fi
375 done 392 done
376 393
377 # Documentation section 394 # Documentation section
378 if [[ -n ${docs} ]]; then 395 if [[ -n ${docs} ]]; then

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

  ViewVC Help
Powered by ViewVC 1.1.20