--- trunk/core/include/kde4.sminc 2009/11/18 20:09:50 4083 +++ trunk/include/kde4.sminc 2014/03/12 16:50:25 21143 @@ -1,9 +1,10 @@ # $Id$ -sminclude mtools cmake qt4 +sminclude mtools cmake qt4 dbus +msetfeature "!check" # no check target in Makefile ## some global vars ## -export KDEDIR=/opt/kde4 +export KDEDIR=/usr export KDECONFDIR=/etc/kde4 export QT_PLUGIN_PATH=${KDEDIR}/$(mlibdir)/kde4/plugins @@ -17,22 +18,57 @@ export KDEDIRS=${KDEDIR} # some sane default values -: ${PCATEGORIE="kde-base"} -: ${SRCFILE="${PNAME/4/}-${PVER}.tar.bz2"} +: ${PCAT="kde-base"} +if [[ -z ${SRCFILE} ]] +then + if [[ ${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/"} -DEPEND="${DEPEND} - >= x11-libs/libXt-1 - >= x11-libs/libXinerama-1" +if [[ ${PNAME} != oxygen-icons ]] +then + 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" +fi + +if [[ ${PNAME} != phonon ]] && [[ ${PNAME} != phonon-backend-* ]] && [[ ${PNAME} != oxygen-icons ]] +then + DEPEND="${DEPEND} + >= virtual/phonon + >= virtual/phonon-backend" +fi SDEPEND="${SDEPEND} - >= dev-util/cmake-2.4.7 - >= dev-util/pkgconfig-0.20 + >= dev-util/cmake-2.8.12 + >= dev-util/pkgconfig-0.25 >= x11-proto/xf86vidmodeproto-2 >= x11-proto/xineramaproto-1" +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") @@ -43,9 +79,11 @@ 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="KDEDIR" -SPECIAL_FUNCTIONS="kde4_buildsycoca kde4_postinstall kde4_postremove" +SPECIAL_VARS="${SPECIAL_VARS} KDEDIR" +SPECIAL_FUNCTIONS="${SPECIAL_FUNCTIONS} kde4_postinstall kde4_postremove" kde4_configure() { @@ -53,14 +91,21 @@ # disabled, seems to be broken atm # # use --enable-final only on i*86 -# [[ ${ARCH} = i*86 ]] && configure_opts="${configure_opts} -DKDE4_ENABLE_FINAL=ON" - configure_opts="${configure_opts} -DCMAKE_BUILD_TYPE=Release" +# [[ ${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="${configure_opts} -DKDE4_USE_ALWAYS_FULL_RPATH=ON" + [[ ${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="${configure_opts} $@" + configure_opts+=" $@" # remove build dir if exist [[ -d ${BUILDDIR}/build ]] && rm -rf ${BUILDDIR}/build @@ -70,11 +115,13 @@ cd ${BUILDDIR}/build cmake_configure \ - -DCMAKE_INSTALL_PREFIX=${PREFIX:-${KDEDIR}} \ - -DSYSCONF_INSTALL_DIR=${PREFIX:-${KDECONFDIR}} \ - -DLIB_INSTALL_DIR=${PREFIX:-${KDEDIR}/$(mlibdir)} \ - -DKDE4_DBUS_INTERFACES_DIR=${PREFIX:-"/usr/share/dbus-1/interfaces/"} \ - -DKDE4_DBUS_SERVICES_DIR=${PREFIX:-"/usr/share/dbus-1/services/"} \ + -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 \ @@ -100,6 +147,29 @@ 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 \ @@ -112,45 +182,4 @@ done } -kde4_buildsycoca() -{ - if [[ -x ${KDEDIR}/bin/kbuildsycoca4 ]] && - [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] - then - # install services dir with right permissions - install -m0755 -o root -g root -d ${MROOT}/usr/share/services - - # kbuildsycoco4 needs a dbus session, but should not use the users session. - # so we start an own session here - - # export everything the be able to kill the session - echo "Starting dbus session for kbuildsycoca4 ..." - local i - for i in $(dbus-launch) - do - export "$i" - done - - echo "Running kbuildsycoca4 to build global database ..." - XDG_DATA_DIRS="${MROOT}/usr/share:${MROOT}${KDEDIR}/share:${MROOT}/usr/local/share" - ${MROOT}${KDEDIR}/bin/kbuildsycoca4 --global --noincremental &> /dev/null - - echo "Killing dbus session for kbuildsycoca4 ..." - kill ${DBUS_SESSION_BUS_PID} - unset DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PID - fi -} - -kde4_postinstall() -{ - # rebuild system konfiguration cache - kde4_buildsycoca -} - -kde4_postremove() -{ - # rebuild system konfiguration cache - kde4_buildsycoca -} - -export_inherits kde4 src_prepare src_compile src_install postinstall postremove +export_inherits kde4 src_prepare src_compile src_install