summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Chvatal <scarabeus@gentoo.org>2009-03-01 11:44:09 +0000
committerTomas Chvatal <scarabeus@gentoo.org>2009-03-01 11:44:09 +0000
commit05ddabbd5e5e4786632c516ef4ab3614fc633057 (patch)
tree5f22ceb5c0427e428ec77c9d31f15ab6a4b28b48 /eclass/kde4-meta.eclass
parentFixing CFLAGS for uclibc to fix #260418 (diff)
downloadhistorical-05ddabbd5e5e4786632c516ef4ab3614fc633057.tar.gz
historical-05ddabbd5e5e4786632c516ef4ab3614fc633057.tar.bz2
historical-05ddabbd5e5e4786632c516ef4ab3614fc633057.zip
Update kde4 eclasses. Was in testing for month now so hope all problems squashed. Resolves some annoying issues and enhance deps.
Diffstat (limited to 'eclass/kde4-meta.eclass')
-rw-r--r--eclass/kde4-meta.eclass181
1 files changed, 88 insertions, 93 deletions
diff --git a/eclass/kde4-meta.eclass b/eclass/kde4-meta.eclass
index 3052e97a9b45..0b1e220e0a4b 100644
--- a/eclass/kde4-meta.eclass
+++ b/eclass/kde4-meta.eclass
@@ -1,6 +1,6 @@
-# Copyright 1999-2008 Gentoo Foundation
+# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.10 2009/01/12 19:40:34 scarabeus Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.11 2009/03/01 11:44:09 scarabeus Exp $
#
# @ECLASS: kde4-meta.eclass
# @MAINTAINER:
@@ -12,17 +12,6 @@
# You must define KMNAME to use this eclass, and do so before inheriting it. All other variables are optional.
# Do not include the same item in more than one of KMMODULE, KMMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY.
-# we want opengl optional in each koffice package
-if [[ $KMNAME = koffice ]]; then
- case ${PN} in
- koffice-data)
- ;;
- *)
- OPENGL_REQUIRED=optional
- ;;
- esac
-fi
-
inherit kde4-base versionator
EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm
@@ -51,25 +40,26 @@ case ${KMNAME} in
kdepim)
DEPEND="${DEPEND} dev-libs/boost app-office/akonadi-server"
RDEPEND="${RDEPEND} dev-libs/boost"
- if [[ $PN != kode ]]; then
- DEPEND="${DEPEND} >=kde-base/kode-${PV}:${SLOT}"
- RDEPEND="${RDEPEND} >=kde-base/kode-${PV}:${SLOT}"
+ if [[ ${PN} != kode ]]; then
+ DEPEND="${DEPEND} >=kde-base/kode-${PV}:${SLOT}[kdeprefix=]"
+ RDEPEND="${RDEPEND} >=kde-base/kode-${PV}:${SLOT}[kdeprefix=]"
fi
case ${PN} in
akregator|kaddressbook|kjots|kmail|kmobiletools|knode|knotes|korganizer|ktimetracker)
IUSE="+kontact"
- DEPEND="${DEPEND} kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT} )"
- RDEPEND="${RDEPEND} kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT} )"
+ DEPEND="${DEPEND} kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] )"
+ RDEPEND="${RDEPEND} kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] )"
;;
esac
;;
kdegames)
- if [[ $PN != libkdegames ]]; then
- DEPEND="${DEPEND} >=kde-base/libkdegames-${PV}:${SLOT}"
- RDEPEND="${RDEPEND} >=kde-base/libkdegames-${PV}:${SLOT}"
+ if [[ ${PN} != libkdegames ]]; then
+ DEPEND="${DEPEND} >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=]"
+ RDEPEND="${RDEPEND} >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=]"
fi
;;
koffice)
+ [[ ${PN} != koffice-data ]] && IUSE="debug"
case ${PV} in
9999*) DEPEND="${DEPEND} !app-office/${PN}:2" ;;
1.9*|2*) DEPEND="${DEPEND} !app-office/${PN}:live" ;;
@@ -84,12 +74,18 @@ case ${KMNAME} in
RDEPEND="${RDEPEND} media-libs/lcms"
;;
*)
- IUSE="+crypt"
- DEPEND="${DEPEND} crypt? ( >=app-crypt/qca-2 )"
- RDEPEND="${RDEPEND} crypt? ( >=app-crypt/qca-2 )"
- if [[ $PN != koffice-libs ]]; then
- DEPEND="${DEPEND} >=app-office/koffice-libs-${PV}:${SLOT}"
- RDEPEND="${RDEPEND} >=app-office/koffice-libs-${PV}:${SLOT}"
+ DEPEND="${DEPEND}
+ dev-cpp/eigen:2
+ media-gfx/imagemagick[openexr?]
+ media-libs/fontconfig
+ media-libs/freetype:2
+ "
+ RDEPEND="${DEPEND}"
+ if [[ ${PN} != koffice-libs && ${PN} != koffice-data ]]; then
+ DEPEND="${DEPEND}
+ >=app-office/koffice-libs-${PV}:${SLOT}[kdeprefix=]"
+ RDEPEND="${RDEPEND}
+ >=app-office/koffice-libs-${PV}:${SLOT}[kdeprefix=]"
fi
;;
esac
@@ -99,6 +95,17 @@ esac
debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after metapackage-specific dependencies"
debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-specific dependencies"
+# Useful to build kde4-meta style stuff from extragear/playground (plasmoids etc)
+case ${SLOT} in
+ live)
+ case ${KMNAME} in
+ extragear*|playground*)
+ ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}"
+ ;;
+ esac
+ ;;
+esac
+
# @ECLASS-VARIABLE: KMNAME
# @DESCRIPTION:
# Name of the parent-module (e.g. kdebase, kdepim, ...). You _must_ set it
@@ -120,8 +127,8 @@ debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-sp
# Example usage: If you're installing subdirectories of a package, like plugins,
# you mark the top subdirectory (containing the package) as $KMEXTRACTONLY, and
# set KMNOMODULE="true".
-if [[ -z $KMMODULE && $KMNOMODULE != true ]]; then
- KMMODULE=$PN
+if [[ -z ${KMMODULE} && ${KMNOMODULE} != true ]]; then
+ KMMODULE=${PN}
fi
# @ECLASS-VARIABLE: KMEXTRA
@@ -153,6 +160,8 @@ fi
# Currently just calls its equivalent in kde4-base.eclass(5). Use this one in
# split ebuilds.
kde4-meta_pkg_setup() {
+ debug-print-function ${FUNCNAME} "$@"
+
kde4-base_pkg_setup
}
@@ -161,10 +170,11 @@ kde4-meta_pkg_setup() {
# This function unpacks the source for split ebuilds. See also
# kde4-meta-src_extract.
kde4-meta_src_unpack() {
- debug-print-function ${FUNCNAME} "$@"
- if [[ $BUILD_TYPE = live ]]; then
+ debug-print-function ${FUNCNAME} "$@"
+
+ if [[ ${BUILD_TYPE} = live ]]; then
migrate_store_dir
- S="${WORKDIR}/${PN}-${PV}"
+ S="${WORKDIR}/${P}"
mkdir -p "${S}"
ESVN_RESTRICT="export" subversion_src_unpack
subversion_wc_info
@@ -183,7 +193,9 @@ kde4-meta_src_unpack() {
# Also see KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and
# KMTARPARAMS.
kde4-meta_src_extract() {
- if [[ $BUILD_TYPE = live ]]; then
+ debug-print-function ${FUNCNAME} "$@"
+
+ if [[ ${BUILD_TYPE} = live ]]; then
local rsync_options subdir kmnamedir targetdir
# Export working copy to ${S}
einfo "Exporting parts of working copy to ${S}"
@@ -211,12 +223,13 @@ kde4-meta_src_extract() {
|| die "${ESVN}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'."
done
- if [[ $KMNAME = kdebase-runtime && $PN != kdebase-data ]]; then
+ if [[ ${KMNAME} = kdebase-runtime && ${PN} != kdebase-data ]]; then
sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
"${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
fi
else
- local abort tarball tarfile f extractlist
+ local abort tarball tarfile f extractlist moduleprefix
+
case $KMNAME in
kdebase-apps)
tarball="${KMNAME#-apps}-${PV}.tar.bz2"
@@ -225,7 +238,7 @@ kde4-meta_src_extract() {
tarball="${KMNAME}-${PV}.tar.bz2"
;;
esac
- tarfile="${DISTDIR}"/${tarball}
+ tarfile="${DISTDIR}/${tarball}"
ebegin "Unpacking parts of ${tarball} to ${WORKDIR}"
@@ -240,30 +253,28 @@ kde4-meta_src_extract() {
KMTARPARAMS="${KMTARPARAMS} -j"
pushd "${WORKDIR}" > /dev/null
- [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf $tarfile $KMTARPARAMS $extractlist >&2
- tar -xpf $tarfile $KMTARPARAMS $extractlist 2> /dev/null
+ [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} >&2
+ tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null
- # Default $S is based on $P; rename the extracted directory to match $S
+ # Default $S is based on $P; rename the extracted directory to match $S if necessary
mv ${KMNAME}-${PV} ${P} || die "Died while moving \"${KMNAME}-${PV}\" to \"${P}\""
popd > /dev/null
eend $?
+ # We need to clear it here to make verification below work
+ unset moduleprefix
+
if [[ -n ${KDE4_STRICTER} ]]; then
for f in $(__list_needed_subdirectories fatal); do
- if [[ ! -e ${S}/${f#*/} ]]; then
+ if [[ ! -e "${S}/${f#*/}" ]]; then
eerror "'${f#*/}' is missing"
abort=true
fi
done
[[ -n ${abort} ]] && die "There were missing files."
fi
- kde4-base_src_unpack
- fi
- # fix koffice linking
- if [[ $KMNAME = koffice ]]; then
- koffice_fix_libraries
fi
}
@@ -305,17 +316,11 @@ kde4-meta_create_extractlists() {
ConfigureChecks.cmake
config-workspace.h.cmake
config-X11.h.cmake
- startkde.cmake"
- case ${SLOT} in
- 4.2)
- KMEXTRACTONLY="${KMEXTRACTONLY}
- KDE4WorkspaceConfig.cmake.in"
- ;;
- *) : ;;
- esac
+ startkde.cmake
+ KDE4WorkspaceConfig.cmake.in"
;;
kdegames)
- if [[ ${PN} != "libkdegames" ]]; then
+ if [[ ${PN} != libkdegames ]]; then
KMEXTRACTONLY="${KMEXTRACTONLY}
libkdegames"
fi
@@ -337,20 +342,6 @@ kde4-meta_create_extractlists() {
config-openexr.h.cmake
config-opengl.h.cmake
config-prefix.h.cmake"
- case ${PN} in
- koffice-libs|koffice-data)
- ;;
- *)
- # add basic extract for all packages
- KMEXTRACTONLY="${KMEXTRACTONLY}
- filters/
- libs/
- plugins/"
- if [[ ${PN} != "kplato" ]]; then
- KMEXTRA="${KMEXTRA} filters/${PN}"
- fi
- ;;
- esac
;;
esac
# Don't install cmake modules for split ebuilds, to avoid collisions.
@@ -388,12 +379,12 @@ __list_needed_subdirectories() {
done
# Expand KMMODULE
- if [[ -n $KMMODULE ]]; then
+ if [[ -n ${KMMODULE} ]]; then
kmmodule_expanded="${KMMODULE}"
j=$(dirname ${KMMODULE})
while [[ ${j} != "." ]]; do
- kmmodule_expanded="${kmmodule_expanded} $j/CMakeLists.txt";
- j=$(dirname $j)
+ kmmodule_expanded="${kmmodule_expanded} ${j}/CMakeLists.txt";
+ j=$(dirname ${j})
done
fi
@@ -411,17 +402,16 @@ __list_needed_subdirectories() {
debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmmodule_expanded: ${kmmodule_expanded}"
debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmcompileonly_expanded: ${kmcompileonly_expanded}"
-
case ${PV} in
scm|9999*) : ;;
*) topdir="${KMNAME}-${PV}/" ;;
esac
-
# Create final list of stuff to extract
+ # We append topleveldir only when specified (usually for tarballs)
for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \
${KMEXTRACTONLY}
do
- extractlist="${extractlist} ${topdir}${i}"
+ extractlist="${extractlist} ${topdir}${moduleprefix}${i}"
done
echo ${extractlist}
@@ -460,7 +450,7 @@ _change_cmakelists_parent_dirs() {
# @FUNCTION: kde4-meta_change_cmakelists
# @DESCRIPTION:
kde4-meta_change_cmakelists() {
- debug-print-function ${FUNCNAME} "$@"
+ debug-print-function ${FUNCNAME} "$@"
pushd "${S}" > /dev/null
@@ -526,23 +516,21 @@ kde4-meta_change_cmakelists() {
# COLLISION PROTECT section
# Install the startkde script just once, as a part of kde-base/kdebase-startkde,
# not as a part of every package.
- if [[ ${PN} != "kdebase-startkde" && -f "${S}"/CMakeLists.txt ]]; then
+ if [[ ${PN} != kdebase-startkde && -f "${S}"/CMakeLists.txt ]]; then
# The startkde script moved to kdebase-workspace for KDE4 versions > 3.93.0.
sed -i -e '/startkde/s/^/#DONOTINSTALL /' "${S}"/CMakeLists.txt || \
die "${LINENO}: sed died in the kdebase-startkde collision prevention section"
fi
# Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82
- if [[ ${SLOT} == 4.2 ]] || [[ ${PV} == 9999 ]]; then
- if [[ ${PN} != libkworkspace ]]; then
- sed -i -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \
- CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip EXPORT section"
- fi
+ if [[ ${PN} != libkworkspace ]]; then
+ sed -i -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \
+ CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip EXPORT section"
fi
;;
kdebase-runtime)
# COLLISION PROTECT section
# Only install the kde4 script as part of kde-base/kdebase-data
- if [[ ${PN} != "kdebase-data" && -f "${S}"/CMakeLists.txt ]]; then
+ if [[ ${PN} != kdebase-data && -f "${S}"/CMakeLists.txt ]]; then
sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
"${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
fi
@@ -556,6 +544,16 @@ kde4-meta_change_cmakelists() {
;;
esac
;;
+ koffice)
+ # prevent collisions
+ if [[ ${PN} != koffice-data ]]; then
+ sed -i -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \
+ "${S}"/cmake/modules/CMakeLists.txt || \
+ die "${LINENO}: sed died in collision prevention section"
+ sed -i -n -e '1h;1!H;${g;s/install(.\+config-openexr.h.\+)//;p}' \
+ "${S}"/CMakeLists.txt || \
+ die "${LINENO}: sed died in collision prevention section"
+ fi
esac
popd > /dev/null
@@ -566,7 +564,7 @@ kde4-meta_change_cmakelists() {
# Currently just calls its equivalent in kde4-base.eclass(5). Use this one in split
# ebuilds.
kde4-meta_src_configure() {
- debug-print-function ${FUNCNAME} "$@"
+ debug-print-function ${FUNCNAME} "$@"
kde4-base_src_configure
}
@@ -576,7 +574,7 @@ kde4-meta_src_configure() {
# General function for compiling split KDE4 applications.
# Overrides kde4-base_src_compile.
kde4-meta_src_compile() {
- debug-print-function ${FUNCNAME} "$@"
+ debug-print-function ${FUNCNAME} "$@"
kde4-base_src_make
}
@@ -603,12 +601,6 @@ kde4-meta_src_install() {
if [[ -n ${KMSAVELIBS} ]]; then
install_library_dependencies
fi
-
- # remove unvanted koffice stuff
- if [[ $KMNAME = koffice && $PN != koffice-data ]]; then
- rm "$D/$KDEDIR/include/config-openexr.h"
- rm "$D/$KDEDIR/share/apps/cmake/modules/FindKOfficeLibs.cmake"
- fi
}
# @FUNCTION: kde4-meta_src_make_doc
@@ -616,11 +608,11 @@ kde4-meta_src_install() {
# This function searches in ${S}/${KMMODULE},
# and tries to install "AUTHORS ChangeLog* README* NEWS todo" if these files exist.
kde4-meta_src_make_doc() {
- debug-print-function $FUNCNAME "$@"
+ debug-print-function ${FUNCNAME} "$@"
local doc
for doc in AUTHORS ChangeLog* README* NEWS TODO; do
- [[ -s ${KMMODULE}/$doc ]] && newdoc "${KMMODULE}/${doc}" "${doc}.${KMMODULE##*/}"
+ [[ -s ${KMMODULE}/${doc} ]] && newdoc "${KMMODULE}/${doc}" "${doc}.${KMMODULE##*/}"
done
kde4-base_src_make_doc
@@ -631,6 +623,8 @@ kde4-meta_src_make_doc() {
# Currently just calls its equivalent in kde4-base.eclass(5). Use this in split
# ebuilds.
kde4-meta_pkg_postinst() {
+ debug-print-function ${FUNCNAME} "$@"
+
kde4-base_pkg_postinst
}
@@ -639,6 +633,7 @@ kde4-meta_pkg_postinst() {
# Currently just calls its equivalent in kde4-base.eclass(5). Use this in split
# ebuilds.
kde4-meta_pkg_postrm() {
+ debug-print-function ${FUNCNAME} "$@"
+
kde4-base_pkg_postrm
}
-