/[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.2 Revision 1.5
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.5 2008/03/13 17:57:51 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.
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 echo "Unpacking parts of ${tarball} to ${WORKDIR}"
165 165
166 kde4-meta_create_extractlists 166 kde4-meta_create_extractlists
167 167
168 for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake \ 168 for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake \
169 AUTHORS COPYING INSTALL README NEWS ChangeLog 169 AUTHORS COPYING INSTALL README NEWS ChangeLog
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)
248 if [[ ${PN} != "libkdegames" ]]; then
236 KMCOMPILEONLY="${KMCOMPILEONLY} 249 KMCOMPILEONLY="${KMCOMPILEONLY}
237 cmake/modules/" 250 cmake/modules/"
251 else
252 KMEXTRA="${KMEXTRA}
253 cmake/modules/"
254 fi
238 ;; 255 ;;
239 esac 256 esac
240 257
241 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}" 258 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}"
242} 259}
243 260
244__list_needed_subdirectories() { 261__list_needed_subdirectories() {
245 local i j kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist topdir 262 local i j kmextra kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist topdir
246 263
247 # We expand KMEXTRA by adding CMakeLists.txt files 264 # We expand KMEXTRA by adding CMakeLists.txt files
248 for i in ${KMEXTRA}; do 265 kmextra="${KMEXTRA}"
266 [[ ${1} != fatal ]] && kmextra="${kmextra} ${KMEXTRA_NONFATAL}"
267 for i in ${kmextra}; do
249 kmextra_expanded="${kmextra_expanded} ${i}" 268 kmextra_expanded="${kmextra_expanded} ${i}"
250 j=$(dirname ${i}) 269 j=$(dirname ${i})
251 while [[ ${j} != "." ]]; do 270 while [[ ${j} != "." ]]; do
252 kmextra_expanded="${kmextra_expanded} ${j}/CMakeLists.txt"; 271 kmextra_expanded="${kmextra_expanded} ${j}/CMakeLists.txt";
253 j=$(dirname ${j}) 272 j=$(dirname ${j})
355 done 374 done
356 375
357 # KMEXTRA section 376 # KMEXTRA section
358 for i in ${KMEXTRA}; do 377 for i in ${KMEXTRA}; do
359 debug-print "${LINENO}: KMEXTRA section, processing ${i}" 378 debug-print "${LINENO}: KMEXTRA section, processing ${i}"
360 # 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
361 if [[ -d "${S}"/${i} ]]; then 386 if [[ -d "${S}"/${i} ]]; then
362 find "${S}"/${i} -name CMakeLists.txt -print0 | \ 387 find "${S}"/${i} -name CMakeLists.txt -print0 | \
363 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ 388 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
364 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}"
365 _change_cmakelists_parent_dirs ${i} 390 _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 391 fi
370 done 392 done
371 393
372 # Documentation section 394 # Documentation section
373 if [[ -n ${docs} ]]; then 395 if [[ -n ${docs} ]]; then

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.20