# $Id$ sminclude mtools cmake qt4 dbus msetfeature "!check" # no check target in Makefile ## some global vars ## export KDEDIR=/usr export KDECONFDIR=/etc/kde4 export QT_PLUGIN_PATH=${KDEDIR}/$(mlibdir)/kde4/plugins # fixes some compile issues ala "kde-config: command not found" export PATH="${KDEDIR}/bin:${PATH}" export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${KDEDIR}/$(mlibdir)/pkgconfig # if kde is already installed it may fuck up the build process because it # try to use the wrong docp etc. # so we prevent this: export KDEDIRS=${KDEDIR} # nepomuk or baloo support or both? KDE4_ENABLE_NEPOMUK=0 KDE4_ENABLE_BALOO=1 # some sane default values : ${PCAT="kde-base"} if [[ -z ${SRCFILE} ]] then if [[ ${PVER%%.*} = 0 ]] then KDE4_TARBALL_EXTENSION="tar.bz2" elif [[ ${PVER//.} -ge 483 ]] then KDE4_TARBALL_EXTENSION="tar.xz" else KDE4_TARBALL_EXTENSION="tar.bz2" fi fi : ${SRCFILE="${PNAME/4/}-${PVER}.${KDE4_TARBALL_EXTENSION}"} : ${SRCDIR="${BUILDDIR}/${PNAME/4/}-${PVER}"} : ${DESCRIPTION="${PNAME}"} : ${HOMEPAGE="http://www.kde.org/"} case ${PNAME} in oxygen-icons|kde-base-artwork|kdeartwork-*|kde-wallpapers) ;; # no common deps required *) DEPEND="${DEPEND} >= x11-libs/libXt-1 >= x11-libs/libXinerama-1 >= x11-libs/qt4-gui-4.8 >= x11-libs/qt4-qt3support-4.8 >= x11-libs/qt4-script-4.8 >= x11-libs/qt4-sql-4.8 >= x11-libs/qt4-svg-4.8 >= x11-libs/qt4-test-4.8 >= x11-libs/qt4-dbus-4.8 >= x11-libs/qt4-opengl-4.8 >= x11-libs/qt4-webkit-4.8 >= x11-libs/qt4-declarative-4.8" ;; esac case ${PNAME} in phonon|phonon-backend-*|oxygen-icons|kde-base-artwork|kdeartwork-*|kde-wallpapers|automoc4) ;; # no phonon deps required *) DEPEND="${DEPEND} >= virtual/phonon >= virtual/phonon-backend" ;; esac SDEPEND="${SDEPEND} >= dev-util/cmake-2.8.12 >= dev-util/pkgconfig-0.25 >= app-text/docbook-xml-dtd42-4.2 >= app-text/docbook-xsl-stylesheets-1.76" if [[ ${PNAME} != automoc4 ]] then SDEPEND="${SDEPEND} >= kde-base/automoc4-0.9.88" fi # small hack to fix kdemirrors [[ ${KDE_MIRROR_UNSTABLE} = 1 ]] && KDE_MIRRORS=$(echo ${KDE_MIRRORS} | sed "s:/stable:/unstable:g") SRC_URI=( ${SRC_URI[*]} kde://${PVER}/src/${SRCFILE} kde://${PVER%.*}/src/${SRCFILE} mirror://${PNAME}/${SRCFILE} ) UP2DATE="updatecmd -listonly http://download.kde.org/stable/ | grep 'stable/[0-9]' | sed -n 's:.*/\([0-9].*\)/:\1:;$ p'" # exported functions and variables for mage-file SPECIAL_VARS="${SPECIAL_VARS} KDEDIR" SPECIAL_FUNCTIONS="${SPECIAL_FUNCTIONS} kde4_postinstall kde4_postremove" kde4_add_nepomuk_depend() { local var="$1" local dep="$2" [[ -n ${var} ]] || die "kde4_add_nepomuk_depend(): no variable given" [[ -n ${dep} ]] || die "kde4_add_nepomuk_depend(): no deps given" if [[ ${KDE4_ENABLE_NEPOMUK} = 1 ]] then eval "$(echo -e ${var}=\"\${${var}}\\n${dep}\")" else [[ ${SILENT} = 0 ]] && echo "Nepomuk disabled, not adding '${dep}' to '${var}'" fi } kde4_add_baloo_depend() { local var="$1" local dep="$2" [[ -n ${var} ]] || die "kde4_add_baloo_depend(): no variable given" [[ -n ${dep} ]] || die "kde4_add_baloo_depend(): no deps given" if [[ ${KDE4_ENABLE_BALOO} = 1 ]] then eval "$(echo -e ${var}=\"\${${var}}\\n${dep}\")" else [[ ${SILENT} = 0 ]] && echo "Baloo disabled, not adding '${dep}' to '${var}'" fi } kde4_configure() { local configure_opts # disabled, seems to be broken atm # # use --enable-final only on i*86 # [[ ${ARCH} = i*86 ]] && configure_opts+=" -DKDE4_ENABLE_FINAL=ON" configure_opts+=" -DCMAKE_BUILD_TYPE=Release" # use full rpath on non /usr installations [[ ${KDEDIR} != /usr ]] && configure_opts+=" -DKDE4_USE_ALWAYS_FULL_RPATH=ON" # add akonadi dbus dir if [[ ${PNAME/4/} = akonadi ]] || [[ ${PNAME/4/} = kdepim-runtime ]] then configure_opts+=" -DAKONADI_DBUS_INTERFACES_DIR=$(mget-dbus-interfaces-dir)" configure_opts+=" -DAKONADI_DBUS_SERVICES_DIR=$(mget-dbus-session-bus-services-dir)" fi # add commandline given arguments configure_opts+=" $@" # build outside of the source dir cmake_setup_builddir || die cmake_configure \ -DCMAKE_INSTALL_PREFIX=${KDEDIR} \ -DSYSCONF_INSTALL_DIR=${KDECONFDIR} \ -DLIB_INSTALL_DIR=${KDEDIR}/$(mlibdir) \ -DDBUS_INTERFACES_INSTALL_DIR=$(mget-dbus-interfaces-dir) \ -DDBUS_SERVICES_INSTALL_DIR=$(mget-dbus-session-bus-services-dir) \ -DKDE4_DBUS_INTERFACES_DIR=$(mget-dbus-interfaces-dir) \ -DKDE4_DBUS_SERVICES_DIR=$(mget-dbus-session-bus-services-dir) \ -DKDE4_ENABLE_FPIE=ON \ -DKDE4_BUILD_TESTS=OFF \ -DKDE4_ENABLE_HTMLHANDBOOK=ON \ ${configure_opts} \ || die } kde4_src_prepare() { munpack ${SRCFILE} || die } kde4_src_compile() { cd ${SRCDIR} kde4_configure || die cmake_mmake ${KDE4_MAKE_OPTS} || die } kde4_src_install() { cd ${BUILDDIR}/build mmake DESTDIR=${BINDIR} ${KDE4_MAKE_OPTS} install || die # move dbus service dirs to a proper location if KDEDIR != /usr if [[ ${KDEDIR} != /usr ]] then if [[ -d ${BINDIR}/${KDEDIR}/share/dbus-1 ]] then echo -e "${COLYELLOW}Warning: using dbus hotfix, dbus locations should be fixed!${COLDEFAULT}" minstalldir /usr/share || die cp -R ${BINDIR}/${KDEDIR}/share/dbus-1 ${BINDIR}/usr/share/ || die rm -r ${BINDIR}/${KDEDIR}/share/dbus-1 || die fi fi # or if KDECONFDIR != /etc if [[ ${KDECONFDIR} != /etc ]] then if [[ -d ${BINDIR}/${KDECONFDIR}/dbus-1 ]] then echo -e "${COLYELLOW}Warning: using dbus hotfix, dbus locations should be fixed!${COLDEFAULT}" minstalldir /etc || die cp -R ${BINDIR}/${KDECONFDIR}/dbus-1 ${BINDIR}/etc/ || die rm -r ${BINDIR}/${KDECONFDIR}/dbus-1 || die fi fi cd ${SRCDIR} local i for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \ FAQ LICENSE NEWS README TODO do if [ -f ${SRCDIR}/${i} ] then minstalldocs ${i} || die fi done } export_inherits kde4 src_prepare src_compile src_install