Annotation of /trunk/include/kde4.sminc
Parent Directory | Revision Log
Revision 4090 -
(hide annotations)
(download)
Wed Nov 18 23:17:22 2009 UTC (14 years, 11 months ago) by niro
Original Path: trunk/core/include/kde4.sminc
File size: 4560 byte(s)
Wed Nov 18 23:17:22 2009 UTC (14 years, 11 months ago) by niro
Original Path: trunk/core/include/kde4.sminc
File size: 4560 byte(s)
-added proper akonadi dbus dirs
1 | niro | 1927 | # $Id$ |
2 | niro | 2 | |
3 | niro | 1927 | sminclude mtools cmake qt4 |
4 | niro | 2 | |
5 | ## some global vars ## | ||
6 | export KDEDIR=/opt/kde4 | ||
7 | export KDECONFDIR=/etc/kde4 | ||
8 | export QT_PLUGIN_PATH=${KDEDIR}/$(mlibdir)/kde4/plugins | ||
9 | |||
10 | # fixes some compile issues ala "kde-config: command not found" | ||
11 | export PATH="${KDEDIR}/bin:${PATH}" | ||
12 | export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${KDEDIR}/$(mlibdir)/pkgconfig | ||
13 | |||
14 | # if kde is already installed it may fuck up the build process because it | ||
15 | # try to use the wrong docp etc. | ||
16 | # so we prevent this: | ||
17 | export KDEDIRS=${KDEDIR} | ||
18 | |||
19 | # some sane default values | ||
20 | : ${PCATEGORIE="kde-base"} | ||
21 | : ${SRCFILE="${PNAME/4/}-${PVER}.tar.bz2"} | ||
22 | : ${SRCDIR="${BUILDDIR}/${PNAME/4/}-${PVER}"} | ||
23 | : ${DESCRIPTION="${PNAME}"} | ||
24 | : ${HOMEPAGE="http://www.kde.org/"} | ||
25 | |||
26 | DEPEND="${DEPEND} | ||
27 | >= x11-libs/libXt-1 | ||
28 | niro | 1927 | >= x11-libs/libXinerama-1" |
29 | niro | 2 | |
30 | SDEPEND="${SDEPEND} | ||
31 | >= dev-util/cmake-2.4.7 | ||
32 | >= dev-util/pkgconfig-0.20 | ||
33 | >= x11-proto/xf86vidmodeproto-2 | ||
34 | >= x11-proto/xineramaproto-1" | ||
35 | |||
36 | # small hack to fix kdemirrors | ||
37 | [[ ${KDE_MIRROR_UNSTABLE} = 1 ]] && KDE_MIRRORS=$(echo ${KDE_MIRRORS} | sed "s:/stable:/unstable:g") | ||
38 | |||
39 | SRC_URI=( | ||
40 | ${SRC_URI[*]} | ||
41 | kde://${PVER}/src/${SRCFILE} | ||
42 | kde://${PVER%.*}/src/${SRCFILE} | ||
43 | mirror://${PNAME}/${SRCFILE} | ||
44 | ) | ||
45 | |||
46 | # exported functions and variables for mage-file | ||
47 | SPECIAL_VARS="KDEDIR" | ||
48 | SPECIAL_FUNCTIONS="kde4_buildsycoca kde4_postinstall kde4_postremove" | ||
49 | |||
50 | kde4_configure() | ||
51 | { | ||
52 | local configure_opts | ||
53 | |||
54 | # disabled, seems to be broken atm | ||
55 | # # use --enable-final only on i*86 | ||
56 | # [[ ${ARCH} = i*86 ]] && configure_opts="${configure_opts} -DKDE4_ENABLE_FINAL=ON" | ||
57 | niro | 4083 | configure_opts="${configure_opts} -DCMAKE_BUILD_TYPE=Release" |
58 | niro | 2 | |
59 | niro | 4083 | # use full rpath on non /usr installations |
60 | [[ ${KDEDIR} != /usr ]] && configure_opts="${configure_opts} -DKDE4_USE_ALWAYS_FULL_RPATH=ON" | ||
61 | |||
62 | niro | 4090 | # add akonadi dbus dir |
63 | if [[ ${PNAME/4/} = akonadi ]] || [[ ${PNAME/4/} = kdepim-runtime ]] | ||
64 | then | ||
65 | configure_opts="${configure_opts} -DAKONADI_DBUS_INTERFACES_DIR=${PREFIX:-/usr/share/dbus-1/interfaces/}" | ||
66 | configure_opts="${configure_opts} -DAKONADI_DBUS_SERVICES_DIR=${PREFIX:-/usr/share/dbus-1/services/}" | ||
67 | fi | ||
68 | |||
69 | niro | 2 | # add commandline given arguments |
70 | configure_opts="${configure_opts} $@" | ||
71 | |||
72 | # remove build dir if exist | ||
73 | [[ -d ${BUILDDIR}/build ]] && rm -rf ${BUILDDIR}/build | ||
74 | |||
75 | # build outside of the source dir | ||
76 | install -d ${BUILDDIR}/build || die | ||
77 | cd ${BUILDDIR}/build | ||
78 | |||
79 | cmake_configure \ | ||
80 | -DCMAKE_INSTALL_PREFIX=${PREFIX:-${KDEDIR}} \ | ||
81 | niro | 4083 | -DSYSCONF_INSTALL_DIR=${PREFIX:-${KDECONFDIR}} \ |
82 | niro | 2 | -DLIB_INSTALL_DIR=${PREFIX:-${KDEDIR}/$(mlibdir)} \ |
83 | niro | 4083 | -DKDE4_DBUS_INTERFACES_DIR=${PREFIX:-"/usr/share/dbus-1/interfaces/"} \ |
84 | -DKDE4_DBUS_SERVICES_DIR=${PREFIX:-"/usr/share/dbus-1/services/"} \ | ||
85 | niro | 2 | -DKDE4_ENABLE_FPIE=ON \ |
86 | -DKDE4_BUILD_TESTS=OFF \ | ||
87 | -DKDE4_ENABLE_HTMLHANDBOOK=ON \ | ||
88 | ${configure_opts} \ | ||
89 | || die | ||
90 | } | ||
91 | |||
92 | kde4_src_prepare() | ||
93 | { | ||
94 | munpack ${SRCFILE} || die | ||
95 | } | ||
96 | |||
97 | kde4_src_compile() | ||
98 | { | ||
99 | cd ${SRCDIR} | ||
100 | |||
101 | kde4_configure || die | ||
102 | niro | 1921 | mmake ${KDE4_MAKE_OPTS} || die |
103 | niro | 2 | } |
104 | |||
105 | kde4_src_install() | ||
106 | { | ||
107 | cd ${BUILDDIR}/build | ||
108 | niro | 1921 | mmake DESTDIR=${BINDIR} ${KDE4_MAKE_OPTS} install || die |
109 | niro | 2 | |
110 | niro | 4090 | # # move dbus service dirs to a proper location if KDEDIR != /usr |
111 | # if [[ ${KDEDIR} != /usr ]] | ||
112 | # then | ||
113 | # if [[ -d ${BINDIR}/${KDEDIR}/share/dbus-1 ]] | ||
114 | # then | ||
115 | # minstalldir /usr/share || die | ||
116 | # mv ${BINDIR}/${KDEDIR}/share/dbus-1 ${BINDIR}/usr/share/ || die | ||
117 | # fi | ||
118 | # fi | ||
119 | |||
120 | niro | 2 | cd ${SRCDIR} |
121 | local i | ||
122 | for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \ | ||
123 | FAQ LICENSE NEWS README TODO | ||
124 | do | ||
125 | if [ -f ${SRCDIR}/${i} ] | ||
126 | then | ||
127 | minstalldocs ${i} || die | ||
128 | fi | ||
129 | done | ||
130 | } | ||
131 | |||
132 | kde4_buildsycoca() | ||
133 | { | ||
134 | if [[ -x ${KDEDIR}/bin/kbuildsycoca4 ]] && | ||
135 | [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] | ||
136 | then | ||
137 | # install services dir with right permissions | ||
138 | install -m0755 -o root -g root -d ${MROOT}/usr/share/services | ||
139 | |||
140 | # kbuildsycoco4 needs a dbus session, but should not use the users session. | ||
141 | # so we start an own session here | ||
142 | |||
143 | # export everything the be able to kill the session | ||
144 | echo "Starting dbus session for kbuildsycoca4 ..." | ||
145 | local i | ||
146 | for i in $(dbus-launch) | ||
147 | do | ||
148 | export "$i" | ||
149 | done | ||
150 | |||
151 | echo "Running kbuildsycoca4 to build global database ..." | ||
152 | XDG_DATA_DIRS="${MROOT}/usr/share:${MROOT}${KDEDIR}/share:${MROOT}/usr/local/share" | ||
153 | ${MROOT}${KDEDIR}/bin/kbuildsycoca4 --global --noincremental &> /dev/null | ||
154 | |||
155 | echo "Killing dbus session for kbuildsycoca4 ..." | ||
156 | kill ${DBUS_SESSION_BUS_PID} | ||
157 | unset DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PID | ||
158 | fi | ||
159 | } | ||
160 | |||
161 | kde4_postinstall() | ||
162 | { | ||
163 | # rebuild system konfiguration cache | ||
164 | kde4_buildsycoca | ||
165 | } | ||
166 | |||
167 | kde4_postremove() | ||
168 | { | ||
169 | # rebuild system konfiguration cache | ||
170 | kde4_buildsycoca | ||
171 | } | ||
172 | |||
173 | export_inherits kde4 src_prepare src_compile src_install postinstall postremove |