Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1927 - (show annotations) (download)
Wed Jun 10 16:20:46 2009 UTC (14 years, 11 months ago) by niro
Original Path: trunk/core/include/kde4.sminc
File size: 3600 byte(s)
-splitof qt4 settings to an extra include
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
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 >= x11-libs/libXinerama-1"
29
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
58 # add commandline given arguments
59 configure_opts="${configure_opts} $@"
60
61 # remove build dir if exist
62 [[ -d ${BUILDDIR}/build ]] && rm -rf ${BUILDDIR}/build
63
64 # build outside of the source dir
65 install -d ${BUILDDIR}/build || die
66 cd ${BUILDDIR}/build
67
68 cmake_configure \
69 -DCMAKE_INSTALL_PREFIX=${PREFIX:-${KDEDIR}} \
70 -DLIB_INSTALL_DIR=${PREFIX:-${KDEDIR}/$(mlibdir)} \
71 -DKDE4_USE_ALWAYS_FULL_RPATH=ON \
72 -DKDE4_ENABLE_FPIE=ON \
73 -DKDE4_BUILD_TESTS=OFF \
74 -DKDE4_ENABLE_HTMLHANDBOOK=ON \
75 ${configure_opts} \
76 || die
77 }
78
79 kde4_src_prepare()
80 {
81 munpack ${SRCFILE} || die
82 }
83
84 kde4_src_compile()
85 {
86 cd ${SRCDIR}
87
88 kde4_configure || die
89 mmake ${KDE4_MAKE_OPTS} || die
90 }
91
92 kde4_src_install()
93 {
94 cd ${BUILDDIR}/build
95 mmake DESTDIR=${BINDIR} ${KDE4_MAKE_OPTS} install || die
96
97 cd ${SRCDIR}
98 local i
99 for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \
100 FAQ LICENSE NEWS README TODO
101 do
102 if [ -f ${SRCDIR}/${i} ]
103 then
104 minstalldocs ${i} || die
105 fi
106 done
107 }
108
109 kde4_buildsycoca()
110 {
111 if [[ -x ${KDEDIR}/bin/kbuildsycoca4 ]] &&
112 [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
113 then
114 # install services dir with right permissions
115 install -m0755 -o root -g root -d ${MROOT}/usr/share/services
116
117 # kbuildsycoco4 needs a dbus session, but should not use the users session.
118 # so we start an own session here
119
120 # export everything the be able to kill the session
121 echo "Starting dbus session for kbuildsycoca4 ..."
122 local i
123 for i in $(dbus-launch)
124 do
125 export "$i"
126 done
127
128 echo "Running kbuildsycoca4 to build global database ..."
129 XDG_DATA_DIRS="${MROOT}/usr/share:${MROOT}${KDEDIR}/share:${MROOT}/usr/local/share"
130 ${MROOT}${KDEDIR}/bin/kbuildsycoca4 --global --noincremental &> /dev/null
131
132 echo "Killing dbus session for kbuildsycoca4 ..."
133 kill ${DBUS_SESSION_BUS_PID}
134 unset DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PID
135 fi
136 }
137
138 kde4_postinstall()
139 {
140 # rebuild system konfiguration cache
141 kde4_buildsycoca
142 }
143
144 kde4_postremove()
145 {
146 # rebuild system konfiguration cache
147 kde4_buildsycoca
148 }
149
150 export_inherits kde4 src_prepare src_compile src_install postinstall postremove