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