# $Id$ sminclude mtools cmake qt4 ## some global vars ## export KDEDIR=/opt/kde4 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} # some sane default values : ${PCATEGORIE="kde-base"} : ${SRCFILE="${PNAME/4/}-${PVER}.tar.bz2"} : ${SRCDIR="${BUILDDIR}/${PNAME/4/}-${PVER}"} : ${DESCRIPTION="${PNAME}"} : ${HOMEPAGE="http://www.kde.org/"} DEPEND="${DEPEND} >= x11-libs/libXt-1 >= x11-libs/libXinerama-1" SDEPEND="${SDEPEND} >= dev-util/cmake-2.4.7 >= dev-util/pkgconfig-0.20 >= x11-proto/xf86vidmodeproto-2 >= x11-proto/xineramaproto-1" # 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} ) # exported functions and variables for mage-file SPECIAL_VARS="KDEDIR" SPECIAL_FUNCTIONS="kde4_buildsycoca kde4_postinstall kde4_postremove" kde4_configure() { local configure_opts # disabled, seems to be broken atm # # use --enable-final only on i*86 # [[ ${ARCH} = i*86 ]] && configure_opts="${configure_opts} -DKDE4_ENABLE_FINAL=ON" # add commandline given arguments configure_opts="${configure_opts} $@" # remove build dir if exist [[ -d ${BUILDDIR}/build ]] && rm -rf ${BUILDDIR}/build # build outside of the source dir install -d ${BUILDDIR}/build || die cd ${BUILDDIR}/build cmake_configure \ -DCMAKE_INSTALL_PREFIX=${PREFIX:-${KDEDIR}} \ -DLIB_INSTALL_DIR=${PREFIX:-${KDEDIR}/$(mlibdir)} \ -DKDE4_USE_ALWAYS_FULL_RPATH=ON \ -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 mmake ${KDE4_MAKE_OPTS} || die } kde4_src_install() { cd ${BUILDDIR}/build mmake DESTDIR=${BINDIR} ${KDE4_MAKE_OPTS} install || die 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 } 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