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