1 |
# $Header: /magellan-cvs/smage/include/kde4.sminc,v 1.16 2008/04/05 08:24:39 niro Exp $ |
# $Id$ |
2 |
|
|
3 |
sminclude mtools cmake |
sminclude mtools cmake qt4 dbus |
4 |
|
msetfeature "!check" # no check target in Makefile |
5 |
|
|
6 |
## some global vars ## |
## some global vars ## |
7 |
export QTDIR=/opt/qt4 |
export KDEDIR=/usr |
|
export KDEDIR=/opt/kde4 |
|
8 |
export KDECONFDIR=/etc/kde4 |
export KDECONFDIR=/etc/kde4 |
9 |
export QT_PLUGIN_PATH=${KDEDIR}/$(mlibdir)/kde4/plugins |
export QT_PLUGIN_PATH=${KDEDIR}/$(mlibdir)/kde4/plugins |
10 |
|
|
18 |
export KDEDIRS=${KDEDIR} |
export KDEDIRS=${KDEDIR} |
19 |
|
|
20 |
# some sane default values |
# some sane default values |
21 |
: ${PCATEGORIE="kde-base"} |
: ${PCAT="kde-base"} |
22 |
: ${SRCFILE="${PNAME/4/}-${PVER}.tar.bz2"} |
if [[ -z ${SRCFILE} ]] |
23 |
|
then |
24 |
|
if [[ ${PVER%%.*} = 0 ]] |
25 |
|
then |
26 |
|
KDE4_TARBALL_EXTENSION="tar.bz2" |
27 |
|
elif [[ ${PVER//.} -ge 483 ]] |
28 |
|
then |
29 |
|
KDE4_TARBALL_EXTENSION="tar.xz" |
30 |
|
else |
31 |
|
KDE4_TARBALL_EXTENSION="tar.bz2" |
32 |
|
fi |
33 |
|
fi |
34 |
|
: ${SRCFILE="${PNAME/4/}-${PVER}.${KDE4_TARBALL_EXTENSION}"} |
35 |
: ${SRCDIR="${BUILDDIR}/${PNAME/4/}-${PVER}"} |
: ${SRCDIR="${BUILDDIR}/${PNAME/4/}-${PVER}"} |
36 |
: ${DESCRIPTION="${PNAME}"} |
: ${DESCRIPTION="${PNAME}"} |
37 |
: ${HOMEPAGE="http://www.kde.org/"} |
: ${HOMEPAGE="http://www.kde.org/"} |
38 |
|
|
39 |
DEPEND="${DEPEND} |
case ${PNAME} in |
40 |
>= x11-libs/libXt-1 |
oxygen-icons|kde-base-artwork|kdeartwork-*) ;; # no common deps required |
41 |
>= x11-libs/libXinerama-1 |
*) |
42 |
>= x11-libs/qt4-4.3.0" |
DEPEND="${DEPEND} |
43 |
|
>= x11-libs/libXt-1 |
44 |
|
>= x11-libs/libXinerama-1 |
45 |
|
>= x11-libs/qt4-gui-4.8 |
46 |
|
>= x11-libs/qt4-qt3support-4.8 |
47 |
|
>= x11-libs/qt4-script-4.8 |
48 |
|
>= x11-libs/qt4-sql-4.8 |
49 |
|
>= x11-libs/qt4-svg-4.8 |
50 |
|
>= x11-libs/qt4-test-4.8 |
51 |
|
>= x11-libs/qt4-dbus-4.8 |
52 |
|
>= x11-libs/qt4-opengl-4.8 |
53 |
|
>= x11-libs/qt4-webkit-4.8 |
54 |
|
>= x11-libs/qt4-declarative-4.8" |
55 |
|
;; |
56 |
|
esac |
57 |
|
|
58 |
|
case ${PNAME} in |
59 |
|
phonon|phonon-backend-*|oxygen-icons|kde-base-artwork|kdeartwork-*|automoc4) ;; # no phonon deps required |
60 |
|
*) |
61 |
|
DEPEND="${DEPEND} |
62 |
|
>= virtual/phonon |
63 |
|
>= virtual/phonon-backend" |
64 |
|
;; |
65 |
|
esac |
66 |
|
|
67 |
SDEPEND="${SDEPEND} |
SDEPEND="${SDEPEND} |
68 |
>= dev-util/cmake-2.4.7 |
>= dev-util/cmake-2.8.12 |
69 |
>= dev-util/pkgconfig-0.20 |
>= dev-util/pkgconfig-0.25" |
70 |
>= x11-proto/xf86vidmodeproto-2 |
|
71 |
>= x11-proto/xineramaproto-1" |
if [[ ${PNAME} != automoc4 ]] |
72 |
|
then |
73 |
|
SDEPEND="${SDEPEND} |
74 |
|
>= kde-base/automoc4-0.9.88" |
75 |
|
fi |
76 |
|
|
77 |
# small hack to fix kdemirrors |
# small hack to fix kdemirrors |
78 |
[[ ${KDE_MIRROR_UNSTABLE} = 1 ]] && KDE_MIRRORS=$(echo ${KDE_MIRRORS} | sed "s:/stable:/unstable:g") |
[[ ${KDE_MIRROR_UNSTABLE} = 1 ]] && KDE_MIRRORS=$(echo ${KDE_MIRRORS} | sed "s:/stable:/unstable:g") |
84 |
mirror://${PNAME}/${SRCFILE} |
mirror://${PNAME}/${SRCFILE} |
85 |
) |
) |
86 |
|
|
87 |
|
UP2DATE="updatecmd -listonly http://download.kde.org/stable/ | grep 'stable/[0-9]' | sed -n 's:.*/\([0-9].*\)/:\1:;$ p'" |
88 |
|
|
89 |
# exported functions and variables for mage-file |
# exported functions and variables for mage-file |
90 |
SPECIAL_VARS="KDEDIR" |
SPECIAL_VARS="${SPECIAL_VARS} KDEDIR" |
91 |
SPECIAL_FUNCTIONS="kde4_buildsycoca kde4_postinstall kde4_postremove" |
SPECIAL_FUNCTIONS="${SPECIAL_FUNCTIONS} kde4_postinstall kde4_postremove" |
92 |
|
|
93 |
kde4_configure() |
kde4_configure() |
94 |
{ |
{ |
96 |
|
|
97 |
# disabled, seems to be broken atm |
# disabled, seems to be broken atm |
98 |
# # use --enable-final only on i*86 |
# # use --enable-final only on i*86 |
99 |
# [[ ${ARCH} = i*86 ]] && configure_opts="${configure_opts} -DKDE4_ENABLE_FINAL=ON" |
# [[ ${ARCH} = i*86 ]] && configure_opts+=" -DKDE4_ENABLE_FINAL=ON" |
100 |
|
configure_opts+=" -DCMAKE_BUILD_TYPE=Release" |
101 |
|
|
102 |
|
# use full rpath on non /usr installations |
103 |
|
[[ ${KDEDIR} != /usr ]] && configure_opts+=" -DKDE4_USE_ALWAYS_FULL_RPATH=ON" |
104 |
|
|
105 |
|
# add akonadi dbus dir |
106 |
|
if [[ ${PNAME/4/} = akonadi ]] || [[ ${PNAME/4/} = kdepim-runtime ]] |
107 |
|
then |
108 |
|
configure_opts+=" -DAKONADI_DBUS_INTERFACES_DIR=$(mget-dbus-interfaces-dir)" |
109 |
|
configure_opts+=" -DAKONADI_DBUS_SERVICES_DIR=$(mget-dbus-session-bus-services-dir)" |
110 |
|
fi |
111 |
|
|
112 |
# add commandline given arguments |
# add commandline given arguments |
113 |
configure_opts="${configure_opts} $@" |
configure_opts+=" $@" |
114 |
|
|
115 |
# remove build dir if exist |
# remove build dir if exist |
116 |
[[ -d ${BUILDDIR}/build ]] && rm -rf ${BUILDDIR}/build |
[[ -d ${BUILDDIR}/build ]] && rm -rf ${BUILDDIR}/build |
120 |
cd ${BUILDDIR}/build |
cd ${BUILDDIR}/build |
121 |
|
|
122 |
cmake_configure \ |
cmake_configure \ |
123 |
-DCMAKE_INSTALL_PREFIX=${PREFIX:-${KDEDIR}} \ |
-DCMAKE_INSTALL_PREFIX=${KDEDIR} \ |
124 |
-DLIB_INSTALL_DIR=${PREFIX:-${KDEDIR}/$(mlibdir)} \ |
-DSYSCONF_INSTALL_DIR=${KDECONFDIR} \ |
125 |
-DKDE4_USE_ALWAYS_FULL_RPATH=ON \ |
-DLIB_INSTALL_DIR=${KDEDIR}/$(mlibdir) \ |
126 |
|
-DDBUS_INTERFACES_INSTALL_DIR=$(mget-dbus-interfaces-dir) \ |
127 |
|
-DDBUS_SERVICES_INSTALL_DIR=$(mget-dbus-session-bus-services-dir) \ |
128 |
|
-DKDE4_DBUS_INTERFACES_DIR=$(mget-dbus-interfaces-dir) \ |
129 |
|
-DKDE4_DBUS_SERVICES_DIR=$(mget-dbus-session-bus-services-dir) \ |
130 |
-DKDE4_ENABLE_FPIE=ON \ |
-DKDE4_ENABLE_FPIE=ON \ |
131 |
-DKDE4_BUILD_TESTS=OFF \ |
-DKDE4_BUILD_TESTS=OFF \ |
132 |
-DKDE4_ENABLE_HTMLHANDBOOK=ON \ |
-DKDE4_ENABLE_HTMLHANDBOOK=ON \ |
144 |
cd ${SRCDIR} |
cd ${SRCDIR} |
145 |
|
|
146 |
kde4_configure || die |
kde4_configure || die |
147 |
mmake || die |
mmake ${KDE4_MAKE_OPTS} || die |
148 |
} |
} |
149 |
|
|
150 |
kde4_src_install() |
kde4_src_install() |
151 |
{ |
{ |
152 |
cd ${BUILDDIR}/build |
cd ${BUILDDIR}/build |
153 |
mmake DESTDIR=${BINDIR} ${KDE3_MAKE_OPTS} install || die |
mmake DESTDIR=${BINDIR} ${KDE4_MAKE_OPTS} install || die |
154 |
|
|
155 |
|
# move dbus service dirs to a proper location if KDEDIR != /usr |
156 |
|
if [[ ${KDEDIR} != /usr ]] |
157 |
|
then |
158 |
|
if [[ -d ${BINDIR}/${KDEDIR}/share/dbus-1 ]] |
159 |
|
then |
160 |
|
echo -e "${COLYELLOW}Warning: using dbus hotfix, dbus locations should be fixed!${COLDEFAULT}" |
161 |
|
minstalldir /usr/share || die |
162 |
|
cp -R ${BINDIR}/${KDEDIR}/share/dbus-1 ${BINDIR}/usr/share/ || die |
163 |
|
rm -r ${BINDIR}/${KDEDIR}/share/dbus-1 || die |
164 |
|
fi |
165 |
|
fi |
166 |
|
# or if KDECONFDIR != /etc |
167 |
|
if [[ ${KDECONFDIR} != /etc ]] |
168 |
|
then |
169 |
|
if [[ -d ${BINDIR}/${KDECONFDIR}/dbus-1 ]] |
170 |
|
then |
171 |
|
echo -e "${COLYELLOW}Warning: using dbus hotfix, dbus locations should be fixed!${COLDEFAULT}" |
172 |
|
minstalldir /etc || die |
173 |
|
cp -R ${BINDIR}/${KDECONFDIR}/dbus-1 ${BINDIR}/etc/ || die |
174 |
|
rm -r ${BINDIR}/${KDECONFDIR}/dbus-1 || die |
175 |
|
fi |
176 |
|
fi |
177 |
|
|
178 |
cd ${SRCDIR} |
cd ${SRCDIR} |
179 |
local i |
local i |
187 |
done |
done |
188 |
} |
} |
189 |
|
|
190 |
kde4_buildsycoca() |
export_inherits kde4 src_prepare src_compile src_install |
|
{ |
|
|
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 |
|