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