Magellan Linux

Contents of /branches/R11-stable/include/kde4.sminc

Parent Directory Parent Directory | Revision Log Revision Log


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