# $Id$ sminclude mtools cmake qt4 ## some global vars ## export KDEDIR=/usr export KDECONFDIR=/etc/kde4 export QT_PLUGIN_PATH=${KDEDIR}/$(mlibdir)/kde4/plugins export DBUS_SYSTEM_DIR=/usr/share/dbus-1 # 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 : ${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/"} if [[ ${PNAME} != oxygen-icons ]] then DEPEND="${DEPEND} >= x11-libs/libXt-1 >= x11-libs/libXinerama-1 >= x11-libs/qt4-gui-4.7 >= x11-libs/qt4-qt3support-4.7 >= x11-libs/qt4-script-4.7 >= x11-libs/qt4-sql-4.7 >= x11-libs/qt4-svg-4.7 >= x11-libs/qt4-test-4.7 >= x11-libs/qt4-dbus-4.7 >= x11-libs/qt4-opengl-4.7 >= x11-libs/qt4-webkit-4.7 >= x11-libs/qt4-declarative-4.7" fi if [[ ${PNAME} != phonon ]] && [[ ${PNAME} != phonon-backend-* ]] then DEPEND="${DEPEND} >= virtual/phonon >= virtual/phonon-backend" fi SDEPEND="${SDEPEND} >= dev-util/cmake-2.8.5 >= 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") SRC_URI=( ${SRC_URI[*]} kde://${PVER}/src/${SRCFILE} kde://${PVER%.*}/src/${SRCFILE} mirror://${PNAME}/${SRCFILE} ) # exported functions and variables for mage-file SPECIAL_VARS="${SPECIAL_VARS} KDEDIR" SPECIAL_FUNCTIONS="${SPECIAL_FUNCTIONS} 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+=" -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=${DBUS_SYSTEM_DIR}/interfaces/" configure_opts+=" -DAKONADI_DBUS_SERVICES_DIR=${DBUS_SYSTEM_DIR}/services/" fi # add commandline given arguments 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=${KDEDIR} \ -DSYSCONF_INSTALL_DIR=${KDECONFDIR} \ -DLIB_INSTALL_DIR=${KDEDIR}/$(mlibdir) \ -DDBUS_INTERFACES_INSTALL_DIR=${DBUS_SYSTEM_DIR}/interfaces/ \ -DDBUS_SERVICES_INSTALL_DIR=${DBUS_SYSTEM_DIR}/services/ \ -DKDE4_DBUS_INTERFACES_DIR=${DBUS_SYSTEM_DIR}/interfaces/ \ -DKDE4_DBUS_SERVICES_DIR=${DBUS_SYSTEM_DIR}/services/ \ -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 # 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 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