Annotation of /trunk/include/kde4.sminc
Parent Directory | Revision Log
Revision 12339 -
(hide annotations)
(download)
Wed May 16 20:18:33 2012 UTC (12 years, 5 months ago) by niro
File size: 4269 byte(s)
Wed May 16 20:18:33 2012 UTC (12 years, 5 months ago) by niro
File size: 4269 byte(s)
-use tar.xz extionsion with >=kde-4.8.3
1 | niro | 1927 | # $Id$ |
2 | niro | 2 | |
3 | niro | 1927 | sminclude mtools cmake qt4 |
4 | niro | 2 | |
5 | ## some global vars ## | ||
6 | niro | 6839 | export KDEDIR=/usr |
7 | niro | 2 | 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 | niro | 9863 | : ${PCAT="kde-base"} |
22 | niro | 12339 | if [[ ${PVER//.} -ge 483 ]] |
23 | then | ||
24 | KDE4_TARBALL_EXTENSION="tar.xz" | ||
25 | else | ||
26 | KDE4_TARBALL_EXTENSION="tar.bz2" | ||
27 | fi | ||
28 | : ${SRCFILE="${PNAME/4/}-${PVER}.${KDE4_TARBALL_EXTENSION}"} | ||
29 | niro | 2 | : ${SRCDIR="${BUILDDIR}/${PNAME/4/}-${PVER}"} |
30 | : ${DESCRIPTION="${PNAME}"} | ||
31 | : ${HOMEPAGE="http://www.kde.org/"} | ||
32 | |||
33 | DEPEND="${DEPEND} | ||
34 | >= x11-libs/libXt-1 | ||
35 | niro | 5394 | >= x11-libs/libXinerama-1 |
36 | niro | 8496 | >= x11-libs/qt4-gui-4.7 |
37 | >= x11-libs/qt4-qt3support-4.7 | ||
38 | >= x11-libs/qt4-script-4.7 | ||
39 | >= x11-libs/qt4-sql-4.7 | ||
40 | >= x11-libs/qt4-svg-4.7 | ||
41 | >= x11-libs/qt4-test-4.7 | ||
42 | >= x11-libs/qt4-dbus-4.7 | ||
43 | >= x11-libs/qt4-opengl-4.7 | ||
44 | niro | 12279 | >= x11-libs/qt4-webkit-4.7 |
45 | >= x11-libs/qt4-declarative-4.7" | ||
46 | niro | 2 | |
47 | niro | 8496 | if [[ ${PNAME} != phonon ]] && [[ ${PNAME} != phonon-backend-* ]] |
48 | niro | 5637 | then |
49 | DEPEND="${DEPEND} | ||
50 | niro | 8496 | >= virtual/phonon |
51 | >= virtual/phonon-backend" | ||
52 | niro | 5637 | fi |
53 | |||
54 | niro | 2 | SDEPEND="${SDEPEND} |
55 | niro | 8496 | >= dev-util/cmake-2.8.5 |
56 | >= dev-util/pkgconfig-0.25 | ||
57 | niro | 2 | >= x11-proto/xf86vidmodeproto-2 |
58 | >= x11-proto/xineramaproto-1" | ||
59 | |||
60 | niro | 8532 | if [[ ${PNAME} != automoc4 ]] |
61 | then | ||
62 | SDEPEND="${SDEPEND} | ||
63 | >= kde-base/automoc4-0.9.88" | ||
64 | fi | ||
65 | |||
66 | niro | 2 | # small hack to fix kdemirrors |
67 | [[ ${KDE_MIRROR_UNSTABLE} = 1 ]] && KDE_MIRRORS=$(echo ${KDE_MIRRORS} | sed "s:/stable:/unstable:g") | ||
68 | |||
69 | SRC_URI=( | ||
70 | ${SRC_URI[*]} | ||
71 | kde://${PVER}/src/${SRCFILE} | ||
72 | kde://${PVER%.*}/src/${SRCFILE} | ||
73 | mirror://${PNAME}/${SRCFILE} | ||
74 | ) | ||
75 | |||
76 | # exported functions and variables for mage-file | ||
77 | niro | 4788 | SPECIAL_VARS="${SPECIAL_VARS} KDEDIR" |
78 | niro | 6918 | SPECIAL_FUNCTIONS="${SPECIAL_FUNCTIONS} kde4_postinstall kde4_postremove" |
79 | niro | 2 | |
80 | kde4_configure() | ||
81 | { | ||
82 | local configure_opts | ||
83 | |||
84 | # disabled, seems to be broken atm | ||
85 | # # use --enable-final only on i*86 | ||
86 | niro | 4091 | # [[ ${ARCH} = i*86 ]] && configure_opts+=" -DKDE4_ENABLE_FINAL=ON" |
87 | configure_opts+=" -DCMAKE_BUILD_TYPE=Release" | ||
88 | niro | 2 | |
89 | niro | 4083 | # use full rpath on non /usr installations |
90 | niro | 4091 | [[ ${KDEDIR} != /usr ]] && configure_opts+=" -DKDE4_USE_ALWAYS_FULL_RPATH=ON" |
91 | niro | 4083 | |
92 | niro | 4090 | # add akonadi dbus dir |
93 | if [[ ${PNAME/4/} = akonadi ]] || [[ ${PNAME/4/} = kdepim-runtime ]] | ||
94 | then | ||
95 | niro | 4091 | configure_opts+=" -DAKONADI_DBUS_INTERFACES_DIR=${DBUS_SYSTEM_DIR}/interfaces/" |
96 | configure_opts+=" -DAKONADI_DBUS_SERVICES_DIR=${DBUS_SYSTEM_DIR}/services/" | ||
97 | niro | 4090 | fi |
98 | |||
99 | niro | 2 | # add commandline given arguments |
100 | niro | 4091 | configure_opts+=" $@" |
101 | niro | 2 | |
102 | # remove build dir if exist | ||
103 | [[ -d ${BUILDDIR}/build ]] && rm -rf ${BUILDDIR}/build | ||
104 | |||
105 | # build outside of the source dir | ||
106 | install -d ${BUILDDIR}/build || die | ||
107 | cd ${BUILDDIR}/build | ||
108 | |||
109 | cmake_configure \ | ||
110 | niro | 4091 | -DCMAKE_INSTALL_PREFIX=${KDEDIR} \ |
111 | -DSYSCONF_INSTALL_DIR=${KDECONFDIR} \ | ||
112 | -DLIB_INSTALL_DIR=${KDEDIR}/$(mlibdir) \ | ||
113 | -DDBUS_INTERFACES_INSTALL_DIR=${DBUS_SYSTEM_DIR}/interfaces/ \ | ||
114 | -DDBUS_SERVICES_INSTALL_DIR=${DBUS_SYSTEM_DIR}/services/ \ | ||
115 | -DKDE4_DBUS_INTERFACES_DIR=${DBUS_SYSTEM_DIR}/interfaces/ \ | ||
116 | -DKDE4_DBUS_SERVICES_DIR=${DBUS_SYSTEM_DIR}/services/ \ | ||
117 | niro | 2 | -DKDE4_ENABLE_FPIE=ON \ |
118 | -DKDE4_BUILD_TESTS=OFF \ | ||
119 | -DKDE4_ENABLE_HTMLHANDBOOK=ON \ | ||
120 | ${configure_opts} \ | ||
121 | || die | ||
122 | } | ||
123 | |||
124 | kde4_src_prepare() | ||
125 | { | ||
126 | munpack ${SRCFILE} || die | ||
127 | } | ||
128 | |||
129 | kde4_src_compile() | ||
130 | { | ||
131 | cd ${SRCDIR} | ||
132 | |||
133 | kde4_configure || die | ||
134 | niro | 1921 | mmake ${KDE4_MAKE_OPTS} || die |
135 | niro | 2 | } |
136 | |||
137 | kde4_src_install() | ||
138 | { | ||
139 | cd ${BUILDDIR}/build | ||
140 | niro | 1921 | mmake DESTDIR=${BINDIR} ${KDE4_MAKE_OPTS} install || die |
141 | niro | 2 | |
142 | niro | 4091 | # move dbus service dirs to a proper location if KDEDIR != /usr |
143 | if [[ ${KDEDIR} != /usr ]] | ||
144 | then | ||
145 | if [[ -d ${BINDIR}/${KDEDIR}/share/dbus-1 ]] | ||
146 | then | ||
147 | echo -e "${COLYELLOW}Warning: using dbus hotfix, dbus locations should be fixed!${COLDEFAULT}" | ||
148 | minstalldir /usr/share || die | ||
149 | cp -R ${BINDIR}/${KDEDIR}/share/dbus-1 ${BINDIR}/usr/share/ || die | ||
150 | rm -r ${BINDIR}/${KDEDIR}/share/dbus-1 || die | ||
151 | fi | ||
152 | fi | ||
153 | niro | 4090 | |
154 | niro | 2 | cd ${SRCDIR} |
155 | local i | ||
156 | for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \ | ||
157 | FAQ LICENSE NEWS README TODO | ||
158 | do | ||
159 | if [ -f ${SRCDIR}/${i} ] | ||
160 | then | ||
161 | minstalldocs ${i} || die | ||
162 | fi | ||
163 | done | ||
164 | } | ||
165 | |||
166 | niro | 7127 | export_inherits kde4 src_prepare src_compile src_install |