Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 21142 - (show annotations) (download)
Wed Mar 12 16:40:33 2014 UTC (10 years, 2 months ago) by niro
Original Path: trunk/include/kde4.sminc
File size: 4930 byte(s)
-no check target
1 # $Id$
2
3 sminclude mtools cmake qt4
4 msetfeature "!check" # no check target in Makefile
5
6 ## some global vars ##
7 export KDEDIR=/usr
8 export KDECONFDIR=/etc/kde4
9 export QT_PLUGIN_PATH=${KDEDIR}/$(mlibdir)/kde4/plugins
10 export DBUS_SYSTEM_DIR=/usr/share/dbus-1
11
12 # fixes some compile issues ala "kde-config: command not found"
13 export PATH="${KDEDIR}/bin:${PATH}"
14 export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${KDEDIR}/$(mlibdir)/pkgconfig
15
16 # if kde is already installed it may fuck up the build process because it
17 # try to use the wrong docp etc.
18 # so we prevent this:
19 export KDEDIRS=${KDEDIR}
20
21 # some sane default values
22 : ${PCAT="kde-base"}
23 if [[ -z ${SRCFILE} ]]
24 then
25 if [[ ${PVER//.} -ge 483 ]]
26 then
27 KDE4_TARBALL_EXTENSION="tar.xz"
28 else
29 KDE4_TARBALL_EXTENSION="tar.bz2"
30 fi
31 fi
32 : ${SRCFILE="${PNAME/4/}-${PVER}.${KDE4_TARBALL_EXTENSION}"}
33 : ${SRCDIR="${BUILDDIR}/${PNAME/4/}-${PVER}"}
34 : ${DESCRIPTION="${PNAME}"}
35 : ${HOMEPAGE="http://www.kde.org/"}
36
37 if [[ ${PNAME} != oxygen-icons ]]
38 then
39 DEPEND="${DEPEND}
40 >= x11-libs/libXt-1
41 >= x11-libs/libXinerama-1
42 >= x11-libs/qt4-gui-4.8
43 >= x11-libs/qt4-qt3support-4.8
44 >= x11-libs/qt4-script-4.8
45 >= x11-libs/qt4-sql-4.8
46 >= x11-libs/qt4-svg-4.8
47 >= x11-libs/qt4-test-4.8
48 >= x11-libs/qt4-dbus-4.8
49 >= x11-libs/qt4-opengl-4.8
50 >= x11-libs/qt4-webkit-4.8
51 >= x11-libs/qt4-declarative-4.8"
52 fi
53
54 if [[ ${PNAME} != phonon ]] && [[ ${PNAME} != phonon-backend-* ]] && [[ ${PNAME} != oxygen-icons ]]
55 then
56 DEPEND="${DEPEND}
57 >= virtual/phonon
58 >= virtual/phonon-backend"
59 fi
60
61 SDEPEND="${SDEPEND}
62 >= dev-util/cmake-2.8.12
63 >= dev-util/pkgconfig-0.25
64 >= x11-proto/xf86vidmodeproto-2
65 >= x11-proto/xineramaproto-1"
66
67 if [[ ${PNAME} != automoc4 ]]
68 then
69 SDEPEND="${SDEPEND}
70 >= kde-base/automoc4-0.9.88"
71 fi
72
73 # small hack to fix kdemirrors
74 [[ ${KDE_MIRROR_UNSTABLE} = 1 ]] && KDE_MIRRORS=$(echo ${KDE_MIRRORS} | sed "s:/stable:/unstable:g")
75
76 SRC_URI=(
77 ${SRC_URI[*]}
78 kde://${PVER}/src/${SRCFILE}
79 kde://${PVER%.*}/src/${SRCFILE}
80 mirror://${PNAME}/${SRCFILE}
81 )
82
83 UP2DATE="updatecmd -listonly http://download.kde.org/stable/ | grep 'stable/[0-9]' | sed -n 's:.*/\([0-9].*\)/:\1:;$ p'"
84
85 # exported functions and variables for mage-file
86 SPECIAL_VARS="${SPECIAL_VARS} KDEDIR"
87 SPECIAL_FUNCTIONS="${SPECIAL_FUNCTIONS} kde4_postinstall kde4_postremove"
88
89 kde4_configure()
90 {
91 local configure_opts
92
93 # disabled, seems to be broken atm
94 # # use --enable-final only on i*86
95 # [[ ${ARCH} = i*86 ]] && configure_opts+=" -DKDE4_ENABLE_FINAL=ON"
96 configure_opts+=" -DCMAKE_BUILD_TYPE=Release"
97
98 # use full rpath on non /usr installations
99 [[ ${KDEDIR} != /usr ]] && configure_opts+=" -DKDE4_USE_ALWAYS_FULL_RPATH=ON"
100
101 # add akonadi dbus dir
102 if [[ ${PNAME/4/} = akonadi ]] || [[ ${PNAME/4/} = kdepim-runtime ]]
103 then
104 configure_opts+=" -DAKONADI_DBUS_INTERFACES_DIR=${DBUS_SYSTEM_DIR}/interfaces/"
105 configure_opts+=" -DAKONADI_DBUS_SERVICES_DIR=${DBUS_SYSTEM_DIR}/services/"
106 fi
107
108 # add commandline given arguments
109 configure_opts+=" $@"
110
111 # remove build dir if exist
112 [[ -d ${BUILDDIR}/build ]] && rm -rf ${BUILDDIR}/build
113
114 # build outside of the source dir
115 install -d ${BUILDDIR}/build || die
116 cd ${BUILDDIR}/build
117
118 cmake_configure \
119 -DCMAKE_INSTALL_PREFIX=${KDEDIR} \
120 -DSYSCONF_INSTALL_DIR=${KDECONFDIR} \
121 -DLIB_INSTALL_DIR=${KDEDIR}/$(mlibdir) \
122 -DDBUS_INTERFACES_INSTALL_DIR=${DBUS_SYSTEM_DIR}/interfaces/ \
123 -DDBUS_SERVICES_INSTALL_DIR=${DBUS_SYSTEM_DIR}/services/ \
124 -DKDE4_DBUS_INTERFACES_DIR=${DBUS_SYSTEM_DIR}/interfaces/ \
125 -DKDE4_DBUS_SERVICES_DIR=${DBUS_SYSTEM_DIR}/services/ \
126 -DKDE4_ENABLE_FPIE=ON \
127 -DKDE4_BUILD_TESTS=OFF \
128 -DKDE4_ENABLE_HTMLHANDBOOK=ON \
129 ${configure_opts} \
130 || die
131 }
132
133 kde4_src_prepare()
134 {
135 munpack ${SRCFILE} || die
136 }
137
138 kde4_src_compile()
139 {
140 cd ${SRCDIR}
141
142 kde4_configure || die
143 mmake ${KDE4_MAKE_OPTS} || die
144 }
145
146 kde4_src_install()
147 {
148 cd ${BUILDDIR}/build
149 mmake DESTDIR=${BINDIR} ${KDE4_MAKE_OPTS} install || die
150
151 # move dbus service dirs to a proper location if KDEDIR != /usr
152 if [[ ${KDEDIR} != /usr ]]
153 then
154 if [[ -d ${BINDIR}/${KDEDIR}/share/dbus-1 ]]
155 then
156 echo -e "${COLYELLOW}Warning: using dbus hotfix, dbus locations should be fixed!${COLDEFAULT}"
157 minstalldir /usr/share || die
158 cp -R ${BINDIR}/${KDEDIR}/share/dbus-1 ${BINDIR}/usr/share/ || die
159 rm -r ${BINDIR}/${KDEDIR}/share/dbus-1 || die
160 fi
161 fi
162 # or if KDECONFDIR != /etc
163 if [[ ${KDECONFDIR} != /etc ]]
164 then
165 if [[ -d ${BINDIR}/${KDECONFDIR}/dbus-1 ]]
166 then
167 echo -e "${COLYELLOW}Warning: using dbus hotfix, dbus locations should be fixed!${COLDEFAULT}"
168 minstalldir /etc || die
169 cp -R ${BINDIR}/${KDECONFDIR}/dbus-1 ${BINDIR}/etc/ || die
170 rm -r ${BINDIR}/${KDECONFDIR}/dbus-1 || die
171 fi
172 fi
173
174 cd ${SRCDIR}
175 local i
176 for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \
177 FAQ LICENSE NEWS README TODO
178 do
179 if [ -f ${SRCDIR}/${i} ]
180 then
181 minstalldocs ${i} || die
182 fi
183 done
184 }
185
186 export_inherits kde4 src_prepare src_compile src_install