1 |
# $Id$ |
# $Id$ |
2 |
|
|
3 |
sminclude mtools cmake qt4 |
sminclude mtools cmake qt4 dbus |
4 |
|
msetfeature "!check" # no check target in Makefile |
5 |
|
|
6 |
## some global vars ## |
## some global vars ## |
7 |
export KDEDIR=/opt/kde4 |
export KDEDIR=/usr |
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 |
|
|
17 |
# so we prevent this: |
# so we prevent this: |
18 |
export KDEDIRS=${KDEDIR} |
export KDEDIRS=${KDEDIR} |
19 |
|
|
20 |
|
# nepomuk or baloo support or both? |
21 |
|
KDE4_ENABLE_NEPOMUK=0 |
22 |
|
KDE4_ENABLE_BALOO=1 |
23 |
|
|
24 |
# some sane default values |
# some sane default values |
25 |
: ${PCATEGORIE="kde-base"} |
: ${PCAT="kde-base"} |
26 |
: ${SRCFILE="${PNAME/4/}-${PVER}.tar.bz2"} |
if [[ -z ${SRCFILE} ]] |
27 |
|
then |
28 |
|
if [[ ${PVER%%.*} = 0 ]] |
29 |
|
then |
30 |
|
KDE4_TARBALL_EXTENSION="tar.bz2" |
31 |
|
elif [[ ${PVER//.} -ge 483 ]] |
32 |
|
then |
33 |
|
KDE4_TARBALL_EXTENSION="tar.xz" |
34 |
|
else |
35 |
|
KDE4_TARBALL_EXTENSION="tar.bz2" |
36 |
|
fi |
37 |
|
fi |
38 |
|
: ${SRCFILE="${PNAME/4/}-${PVER}.${KDE4_TARBALL_EXTENSION}"} |
39 |
: ${SRCDIR="${BUILDDIR}/${PNAME/4/}-${PVER}"} |
: ${SRCDIR="${BUILDDIR}/${PNAME/4/}-${PVER}"} |
40 |
: ${DESCRIPTION="${PNAME}"} |
: ${DESCRIPTION="${PNAME}"} |
41 |
: ${HOMEPAGE="http://www.kde.org/"} |
: ${HOMEPAGE="http://www.kde.org/"} |
42 |
|
|
43 |
DEPEND="${DEPEND} |
case ${PNAME} in |
44 |
>= x11-libs/libXt-1 |
oxygen-icons|kde-base-artwork|kdeartwork-*|kde-wallpapers) ;; # no common deps required |
45 |
>= x11-libs/libXinerama-1" |
*) |
46 |
|
DEPEND="${DEPEND} |
47 |
|
>= x11-libs/libXt-1 |
48 |
|
>= x11-libs/libXinerama-1 |
49 |
|
>= x11-libs/qt4-gui-4.8 |
50 |
|
>= x11-libs/qt4-qt3support-4.8 |
51 |
|
>= x11-libs/qt4-script-4.8 |
52 |
|
>= x11-libs/qt4-sql-4.8 |
53 |
|
>= x11-libs/qt4-svg-4.8 |
54 |
|
>= x11-libs/qt4-test-4.8 |
55 |
|
>= x11-libs/qt4-dbus-4.8 |
56 |
|
>= x11-libs/qt4-opengl-4.8 |
57 |
|
>= x11-libs/qt4-webkit-4.8 |
58 |
|
>= x11-libs/qt4-declarative-4.8" |
59 |
|
;; |
60 |
|
esac |
61 |
|
|
62 |
|
case ${PNAME} in |
63 |
|
phonon|phonon-backend-*|oxygen-icons|kde-base-artwork|kdeartwork-*|kde-wallpapers|automoc4) ;; # no phonon deps required |
64 |
|
*) |
65 |
|
DEPEND="${DEPEND} |
66 |
|
>= virtual/phonon |
67 |
|
>= virtual/phonon-backend" |
68 |
|
;; |
69 |
|
esac |
70 |
|
|
71 |
SDEPEND="${SDEPEND} |
SDEPEND="${SDEPEND} |
72 |
>= dev-util/cmake-2.4.7 |
>= dev-util/cmake-2.8.12 |
73 |
>= dev-util/pkgconfig-0.20 |
>= dev-util/pkgconfig-0.25 |
74 |
>= x11-proto/xf86vidmodeproto-2 |
>= app-text/docbook-xml-dtd42-4.2 |
75 |
>= x11-proto/xineramaproto-1" |
>= app-text/docbook-xsl-stylesheets-1.76" |
76 |
|
|
77 |
|
if [[ ${PNAME} != automoc4 ]] |
78 |
|
then |
79 |
|
SDEPEND="${SDEPEND} |
80 |
|
>= kde-base/automoc4-0.9.88" |
81 |
|
fi |
82 |
|
|
83 |
# small hack to fix kdemirrors |
# small hack to fix kdemirrors |
84 |
[[ ${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") |
90 |
mirror://${PNAME}/${SRCFILE} |
mirror://${PNAME}/${SRCFILE} |
91 |
) |
) |
92 |
|
|
93 |
|
UP2DATE="updatecmd -listonly http://download.kde.org/stable/ | grep 'stable/[0-9]' | sed -n 's:.*/\([0-9].*\)/:\1:;$ p'" |
94 |
|
|
95 |
# exported functions and variables for mage-file |
# exported functions and variables for mage-file |
96 |
SPECIAL_VARS="KDEDIR" |
SPECIAL_VARS="${SPECIAL_VARS} KDEDIR" |
97 |
SPECIAL_FUNCTIONS="kde4_buildsycoca kde4_postinstall kde4_postremove" |
SPECIAL_FUNCTIONS="${SPECIAL_FUNCTIONS} kde4_postinstall kde4_postremove" |
98 |
|
|
99 |
|
kde4_add_nepomuk_depend() |
100 |
|
{ |
101 |
|
local var="$1" |
102 |
|
local dep="$2" |
103 |
|
[[ -n ${var} ]] || die "kde4_add_nepomuk_depend(): no variable given" |
104 |
|
[[ -n ${dep} ]] || die "kde4_add_nepomuk_depend(): no deps given" |
105 |
|
|
106 |
|
if [[ ${KDE4_ENABLE_NEPOMUK} = 1 ]] |
107 |
|
then |
108 |
|
eval "$(echo -e ${var}=\"\${${var}}\\n${dep}\")" |
109 |
|
else |
110 |
|
[[ ${SILENT} = 0 ]] && echo "Nepomuk disabled, not adding '${dep}' to '${var}'" |
111 |
|
fi |
112 |
|
} |
113 |
|
|
114 |
|
kde4_add_baloo_depend() |
115 |
|
{ |
116 |
|
local var="$1" |
117 |
|
local dep="$2" |
118 |
|
[[ -n ${var} ]] || die "kde4_add_baloo_depend(): no variable given" |
119 |
|
[[ -n ${dep} ]] || die "kde4_add_baloo_depend(): no deps given" |
120 |
|
|
121 |
|
if [[ ${KDE4_ENABLE_BALOO} = 1 ]] |
122 |
|
then |
123 |
|
eval "$(echo -e ${var}=\"\${${var}}\\n${dep}\")" |
124 |
|
else |
125 |
|
[[ ${SILENT} = 0 ]] && echo "Baloo disabled, not adding '${dep}' to '${var}'" |
126 |
|
fi |
127 |
|
} |
128 |
|
|
129 |
kde4_configure() |
kde4_configure() |
130 |
{ |
{ |
132 |
|
|
133 |
# disabled, seems to be broken atm |
# disabled, seems to be broken atm |
134 |
# # use --enable-final only on i*86 |
# # use --enable-final only on i*86 |
135 |
# [[ ${ARCH} = i*86 ]] && configure_opts="${configure_opts} -DKDE4_ENABLE_FINAL=ON" |
# [[ ${ARCH} = i*86 ]] && configure_opts+=" -DKDE4_ENABLE_FINAL=ON" |
136 |
configure_opts="${configure_opts} -DCMAKE_BUILD_TYPE=Release" |
configure_opts+=" -DCMAKE_BUILD_TYPE=Release" |
137 |
|
|
138 |
# use full rpath on non /usr installations |
# use full rpath on non /usr installations |
139 |
[[ ${KDEDIR} != /usr ]] && configure_opts="${configure_opts} -DKDE4_USE_ALWAYS_FULL_RPATH=ON" |
[[ ${KDEDIR} != /usr ]] && configure_opts+=" -DKDE4_USE_ALWAYS_FULL_RPATH=ON" |
140 |
|
|
141 |
# add akonadi dbus dir |
# add akonadi dbus dir |
142 |
if [[ ${PNAME/4/} = akonadi ]] || [[ ${PNAME/4/} = kdepim-runtime ]] |
if [[ ${PNAME/4/} = akonadi ]] || [[ ${PNAME/4/} = kdepim-runtime ]] |
143 |
then |
then |
144 |
configure_opts="${configure_opts} -DAKONADI_DBUS_INTERFACES_DIR=${PREFIX:-/usr/share/dbus-1/interfaces/}" |
configure_opts+=" -DAKONADI_DBUS_INTERFACES_DIR=$(mget-dbus-interfaces-dir)" |
145 |
configure_opts="${configure_opts} -DAKONADI_DBUS_SERVICES_DIR=${PREFIX:-/usr/share/dbus-1/services/}" |
configure_opts+=" -DAKONADI_DBUS_SERVICES_DIR=$(mget-dbus-session-bus-services-dir)" |
146 |
fi |
fi |
147 |
|
|
148 |
# add commandline given arguments |
# add commandline given arguments |
149 |
configure_opts="${configure_opts} $@" |
configure_opts+=" $@" |
150 |
|
|
151 |
# remove build dir if exist |
# remove build dir if exist |
152 |
[[ -d ${BUILDDIR}/build ]] && rm -rf ${BUILDDIR}/build |
[[ -d ${BUILDDIR}/build ]] && rm -rf ${BUILDDIR}/build |
156 |
cd ${BUILDDIR}/build |
cd ${BUILDDIR}/build |
157 |
|
|
158 |
cmake_configure \ |
cmake_configure \ |
159 |
-DCMAKE_INSTALL_PREFIX=${PREFIX:-${KDEDIR}} \ |
-DCMAKE_INSTALL_PREFIX=${KDEDIR} \ |
160 |
-DSYSCONF_INSTALL_DIR=${PREFIX:-${KDECONFDIR}} \ |
-DSYSCONF_INSTALL_DIR=${KDECONFDIR} \ |
161 |
-DLIB_INSTALL_DIR=${PREFIX:-${KDEDIR}/$(mlibdir)} \ |
-DLIB_INSTALL_DIR=${KDEDIR}/$(mlibdir) \ |
162 |
-DKDE4_DBUS_INTERFACES_DIR=${PREFIX:-"/usr/share/dbus-1/interfaces/"} \ |
-DDBUS_INTERFACES_INSTALL_DIR=$(mget-dbus-interfaces-dir) \ |
163 |
-DKDE4_DBUS_SERVICES_DIR=${PREFIX:-"/usr/share/dbus-1/services/"} \ |
-DDBUS_SERVICES_INSTALL_DIR=$(mget-dbus-session-bus-services-dir) \ |
164 |
|
-DKDE4_DBUS_INTERFACES_DIR=$(mget-dbus-interfaces-dir) \ |
165 |
|
-DKDE4_DBUS_SERVICES_DIR=$(mget-dbus-session-bus-services-dir) \ |
166 |
-DKDE4_ENABLE_FPIE=ON \ |
-DKDE4_ENABLE_FPIE=ON \ |
167 |
-DKDE4_BUILD_TESTS=OFF \ |
-DKDE4_BUILD_TESTS=OFF \ |
168 |
-DKDE4_ENABLE_HTMLHANDBOOK=ON \ |
-DKDE4_ENABLE_HTMLHANDBOOK=ON \ |
188 |
cd ${BUILDDIR}/build |
cd ${BUILDDIR}/build |
189 |
mmake DESTDIR=${BINDIR} ${KDE4_MAKE_OPTS} install || die |
mmake DESTDIR=${BINDIR} ${KDE4_MAKE_OPTS} install || die |
190 |
|
|
191 |
# # move dbus service dirs to a proper location if KDEDIR != /usr |
# move dbus service dirs to a proper location if KDEDIR != /usr |
192 |
# if [[ ${KDEDIR} != /usr ]] |
if [[ ${KDEDIR} != /usr ]] |
193 |
# then |
then |
194 |
# if [[ -d ${BINDIR}/${KDEDIR}/share/dbus-1 ]] |
if [[ -d ${BINDIR}/${KDEDIR}/share/dbus-1 ]] |
195 |
# then |
then |
196 |
# minstalldir /usr/share || die |
echo -e "${COLYELLOW}Warning: using dbus hotfix, dbus locations should be fixed!${COLDEFAULT}" |
197 |
# mv ${BINDIR}/${KDEDIR}/share/dbus-1 ${BINDIR}/usr/share/ || die |
minstalldir /usr/share || die |
198 |
# fi |
cp -R ${BINDIR}/${KDEDIR}/share/dbus-1 ${BINDIR}/usr/share/ || die |
199 |
# fi |
rm -r ${BINDIR}/${KDEDIR}/share/dbus-1 || die |
200 |
|
fi |
201 |
|
fi |
202 |
|
# or if KDECONFDIR != /etc |
203 |
|
if [[ ${KDECONFDIR} != /etc ]] |
204 |
|
then |
205 |
|
if [[ -d ${BINDIR}/${KDECONFDIR}/dbus-1 ]] |
206 |
|
then |
207 |
|
echo -e "${COLYELLOW}Warning: using dbus hotfix, dbus locations should be fixed!${COLDEFAULT}" |
208 |
|
minstalldir /etc || die |
209 |
|
cp -R ${BINDIR}/${KDECONFDIR}/dbus-1 ${BINDIR}/etc/ || die |
210 |
|
rm -r ${BINDIR}/${KDECONFDIR}/dbus-1 || die |
211 |
|
fi |
212 |
|
fi |
213 |
|
|
214 |
cd ${SRCDIR} |
cd ${SRCDIR} |
215 |
local i |
local i |
223 |
done |
done |
224 |
} |
} |
225 |
|
|
226 |
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 |
|