Annotation of /trunk/include/kde4.sminc
Parent Directory | Revision Log
Revision 2 -
(hide annotations)
(download)
Fri Oct 10 13:29:42 2008 UTC (15 years, 11 months ago) by niro
Original Path: trunk/core/include/kde4.sminc
File size: 3704 byte(s)
Fri Oct 10 13:29:42 2008 UTC (15 years, 11 months ago) by niro
Original Path: trunk/core/include/kde4.sminc
File size: 3704 byte(s)
import repo
1 | niro | 2 | # $Header: /magellan-cvs/smage/include/kde4.sminc,v 1.16 2008/04/05 08:24:39 niro Exp $ |
2 | |||
3 | sminclude mtools cmake | ||
4 | |||
5 | ## some global vars ## | ||
6 | export QTDIR=/opt/qt4 | ||
7 | export KDEDIR=/opt/kde4 | ||
8 | export KDECONFDIR=/etc/kde4 | ||
9 | export QT_PLUGIN_PATH=${KDEDIR}/$(mlibdir)/kde4/plugins | ||
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-4.3.0" | ||
31 | |||
32 | SDEPEND="${SDEPEND} | ||
33 | >= dev-util/cmake-2.4.7 | ||
34 | >= dev-util/pkgconfig-0.20 | ||
35 | >= x11-proto/xf86vidmodeproto-2 | ||
36 | >= x11-proto/xineramaproto-1" | ||
37 | |||
38 | # small hack to fix kdemirrors | ||
39 | [[ ${KDE_MIRROR_UNSTABLE} = 1 ]] && KDE_MIRRORS=$(echo ${KDE_MIRRORS} | sed "s:/stable:/unstable:g") | ||
40 | |||
41 | SRC_URI=( | ||
42 | ${SRC_URI[*]} | ||
43 | kde://${PVER}/src/${SRCFILE} | ||
44 | kde://${PVER%.*}/src/${SRCFILE} | ||
45 | mirror://${PNAME}/${SRCFILE} | ||
46 | ) | ||
47 | |||
48 | # exported functions and variables for mage-file | ||
49 | SPECIAL_VARS="KDEDIR" | ||
50 | SPECIAL_FUNCTIONS="kde4_buildsycoca kde4_postinstall kde4_postremove" | ||
51 | |||
52 | kde4_configure() | ||
53 | { | ||
54 | local configure_opts | ||
55 | |||
56 | # disabled, seems to be broken atm | ||
57 | # # use --enable-final only on i*86 | ||
58 | # [[ ${ARCH} = i*86 ]] && configure_opts="${configure_opts} -DKDE4_ENABLE_FINAL=ON" | ||
59 | |||
60 | # add commandline given arguments | ||
61 | configure_opts="${configure_opts} $@" | ||
62 | |||
63 | # remove build dir if exist | ||
64 | [[ -d ${BUILDDIR}/build ]] && rm -rf ${BUILDDIR}/build | ||
65 | |||
66 | # build outside of the source dir | ||
67 | install -d ${BUILDDIR}/build || die | ||
68 | cd ${BUILDDIR}/build | ||
69 | |||
70 | cmake_configure \ | ||
71 | -DCMAKE_INSTALL_PREFIX=${PREFIX:-${KDEDIR}} \ | ||
72 | -DLIB_INSTALL_DIR=${PREFIX:-${KDEDIR}/$(mlibdir)} \ | ||
73 | -DKDE4_USE_ALWAYS_FULL_RPATH=ON \ | ||
74 | -DKDE4_ENABLE_FPIE=ON \ | ||
75 | -DKDE4_BUILD_TESTS=OFF \ | ||
76 | -DKDE4_ENABLE_HTMLHANDBOOK=ON \ | ||
77 | ${configure_opts} \ | ||
78 | || die | ||
79 | } | ||
80 | |||
81 | kde4_src_prepare() | ||
82 | { | ||
83 | munpack ${SRCFILE} || die | ||
84 | } | ||
85 | |||
86 | kde4_src_compile() | ||
87 | { | ||
88 | cd ${SRCDIR} | ||
89 | |||
90 | kde4_configure || die | ||
91 | mmake || die | ||
92 | } | ||
93 | |||
94 | kde4_src_install() | ||
95 | { | ||
96 | cd ${BUILDDIR}/build | ||
97 | mmake DESTDIR=${BINDIR} ${KDE3_MAKE_OPTS} install || die | ||
98 | |||
99 | cd ${SRCDIR} | ||
100 | local i | ||
101 | for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \ | ||
102 | FAQ LICENSE NEWS README TODO | ||
103 | do | ||
104 | if [ -f ${SRCDIR}/${i} ] | ||
105 | then | ||
106 | minstalldocs ${i} || die | ||
107 | fi | ||
108 | done | ||
109 | } | ||
110 | |||
111 | kde4_buildsycoca() | ||
112 | { | ||
113 | if [[ -x ${KDEDIR}/bin/kbuildsycoca4 ]] && | ||
114 | [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] | ||
115 | then | ||
116 | # install services dir with right permissions | ||
117 | install -m0755 -o root -g root -d ${MROOT}/usr/share/services | ||
118 | |||
119 | # kbuildsycoco4 needs a dbus session, but should not use the users session. | ||
120 | # so we start an own session here | ||
121 | |||
122 | # export everything the be able to kill the session | ||
123 | echo "Starting dbus session for kbuildsycoca4 ..." | ||
124 | local i | ||
125 | for i in $(dbus-launch) | ||
126 | do | ||
127 | export "$i" | ||
128 | done | ||
129 | |||
130 | echo "Running kbuildsycoca4 to build global database ..." | ||
131 | XDG_DATA_DIRS="${MROOT}/usr/share:${MROOT}${KDEDIR}/share:${MROOT}/usr/local/share" | ||
132 | ${MROOT}${KDEDIR}/bin/kbuildsycoca4 --global --noincremental &> /dev/null | ||
133 | |||
134 | echo "Killing dbus session for kbuildsycoca4 ..." | ||
135 | kill ${DBUS_SESSION_BUS_PID} | ||
136 | unset DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PID | ||
137 | fi | ||
138 | } | ||
139 | |||
140 | kde4_postinstall() | ||
141 | { | ||
142 | # rebuild system konfiguration cache | ||
143 | kde4_buildsycoca | ||
144 | } | ||
145 | |||
146 | kde4_postremove() | ||
147 | { | ||
148 | # rebuild system konfiguration cache | ||
149 | kde4_buildsycoca | ||
150 | } | ||
151 | |||
152 | export_inherits kde4 src_prepare src_compile src_install postinstall postremove |