Magellan Linux

Annotation of /trunk/include/kde4.sminc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5712 - (hide annotations) (download)
Sat Aug 7 12:14:16 2010 UTC (13 years, 9 months ago) by niro
Original Path: trunk/core/include/kde4.sminc
File size: 5112 byte(s)
-fixed missing functions
1 niro 1927 # $Id$
2 niro 2
3 niro 1927 sminclude mtools cmake qt4
4 niro 2
5     ## some global vars ##
6     export KDEDIR=/opt/kde4
7     export KDECONFDIR=/etc/kde4
8 niro 5712 export KDEDEFAULTHOME=.kde4
9 niro 2 export QT_PLUGIN_PATH=${KDEDIR}/$(mlibdir)/kde4/plugins
10 niro 4091 export DBUS_SYSTEM_DIR=/usr/share/dbus-1
11 niro 2
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     : ${PCATEGORIE="kde-base"}
23     : ${SRCFILE="${PNAME/4/}-${PVER}.tar.bz2"}
24     : ${SRCDIR="${BUILDDIR}/${PNAME/4/}-${PVER}"}
25     : ${DESCRIPTION="${PNAME}"}
26     : ${HOMEPAGE="http://www.kde.org/"}
27    
28     DEPEND="${DEPEND}
29     >= x11-libs/libXt-1
30 niro 5394 >= x11-libs/libXinerama-1
31     >= x11-libs/qt4-gui-4.5
32     >= x11-libs/qt4-qt3support-4.5
33     >= x11-libs/qt4-script-4.5
34     >= x11-libs/qt4-sql-4.5
35     >= x11-libs/qt4-svg-4.5
36 niro 5466 >= x11-libs/qt4-test-4.5
37     >= x11-libs/qt4-dbus-4.5
38     >= x11-libs/qt4-opengl-4.5
39 niro 5637 >= x11-libs/qt4-webkit-4.5"
40 niro 2
41 niro 5637 if [[ ${PNAME} != phonon ]]
42     then
43     DEPEND="${DEPEND}
44     >= virtual/phonon"
45     fi
46    
47 niro 2 SDEPEND="${SDEPEND}
48     >= dev-util/cmake-2.4.7
49     >= dev-util/pkgconfig-0.20
50     >= x11-proto/xf86vidmodeproto-2
51     >= x11-proto/xineramaproto-1"
52    
53     # small hack to fix kdemirrors
54     [[ ${KDE_MIRROR_UNSTABLE} = 1 ]] && KDE_MIRRORS=$(echo ${KDE_MIRRORS} | sed "s:/stable:/unstable:g")
55    
56     SRC_URI=(
57     ${SRC_URI[*]}
58     kde://${PVER}/src/${SRCFILE}
59     kde://${PVER%.*}/src/${SRCFILE}
60     mirror://${PNAME}/${SRCFILE}
61     )
62    
63     # exported functions and variables for mage-file
64 niro 4788 SPECIAL_VARS="${SPECIAL_VARS} KDEDIR"
65     SPECIAL_FUNCTIONS="${SPECIAL_FUNCTIONS} kde4_buildsycoca kde4_postinstall kde4_postremove"
66 niro 2
67     kde4_configure()
68     {
69     local configure_opts
70    
71     # disabled, seems to be broken atm
72     # # use --enable-final only on i*86
73 niro 4091 # [[ ${ARCH} = i*86 ]] && configure_opts+=" -DKDE4_ENABLE_FINAL=ON"
74     configure_opts+=" -DCMAKE_BUILD_TYPE=Release"
75 niro 2
76 niro 4083 # use full rpath on non /usr installations
77 niro 4091 [[ ${KDEDIR} != /usr ]] && configure_opts+=" -DKDE4_USE_ALWAYS_FULL_RPATH=ON"
78 niro 4083
79 niro 4090 # add akonadi dbus dir
80     if [[ ${PNAME/4/} = akonadi ]] || [[ ${PNAME/4/} = kdepim-runtime ]]
81     then
82 niro 4091 configure_opts+=" -DAKONADI_DBUS_INTERFACES_DIR=${DBUS_SYSTEM_DIR}/interfaces/"
83     configure_opts+=" -DAKONADI_DBUS_SERVICES_DIR=${DBUS_SYSTEM_DIR}/services/"
84 niro 4090 fi
85    
86 niro 2 # add commandline given arguments
87 niro 4091 configure_opts+=" $@"
88 niro 2
89     # remove build dir if exist
90     [[ -d ${BUILDDIR}/build ]] && rm -rf ${BUILDDIR}/build
91    
92     # build outside of the source dir
93     install -d ${BUILDDIR}/build || die
94     cd ${BUILDDIR}/build
95    
96     cmake_configure \
97 niro 4091 -DCMAKE_INSTALL_PREFIX=${KDEDIR} \
98     -DSYSCONF_INSTALL_DIR=${KDECONFDIR} \
99     -DLIB_INSTALL_DIR=${KDEDIR}/$(mlibdir) \
100 niro 5712 -DKDE_DEFAULT_HOME=${KDEDEFAULTHOME} \
101 niro 4091 -DDBUS_INTERFACES_INSTALL_DIR=${DBUS_SYSTEM_DIR}/interfaces/ \
102     -DDBUS_SERVICES_INSTALL_DIR=${DBUS_SYSTEM_DIR}/services/ \
103     -DKDE4_DBUS_INTERFACES_DIR=${DBUS_SYSTEM_DIR}/interfaces/ \
104     -DKDE4_DBUS_SERVICES_DIR=${DBUS_SYSTEM_DIR}/services/ \
105 niro 2 -DKDE4_ENABLE_FPIE=ON \
106     -DKDE4_BUILD_TESTS=OFF \
107     -DKDE4_ENABLE_HTMLHANDBOOK=ON \
108     ${configure_opts} \
109     || die
110     }
111    
112     kde4_src_prepare()
113     {
114     munpack ${SRCFILE} || die
115     }
116    
117     kde4_src_compile()
118     {
119     cd ${SRCDIR}
120    
121     kde4_configure || die
122 niro 1921 mmake ${KDE4_MAKE_OPTS} || die
123 niro 2 }
124    
125     kde4_src_install()
126     {
127     cd ${BUILDDIR}/build
128 niro 1921 mmake DESTDIR=${BINDIR} ${KDE4_MAKE_OPTS} install || die
129 niro 2
130 niro 4091 # move dbus service dirs to a proper location if KDEDIR != /usr
131     if [[ ${KDEDIR} != /usr ]]
132     then
133     if [[ -d ${BINDIR}/${KDEDIR}/share/dbus-1 ]]
134     then
135     echo -e "${COLYELLOW}Warning: using dbus hotfix, dbus locations should be fixed!${COLDEFAULT}"
136     minstalldir /usr/share || die
137     cp -R ${BINDIR}/${KDEDIR}/share/dbus-1 ${BINDIR}/usr/share/ || die
138     rm -r ${BINDIR}/${KDEDIR}/share/dbus-1 || die
139     fi
140     fi
141 niro 4090
142 niro 2 cd ${SRCDIR}
143     local i
144     for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \
145     FAQ LICENSE NEWS README TODO
146     do
147     if [ -f ${SRCDIR}/${i} ]
148     then
149     minstalldocs ${i} || die
150     fi
151     done
152     }
153    
154     kde4_buildsycoca()
155     {
156     if [[ -x ${KDEDIR}/bin/kbuildsycoca4 ]] &&
157     [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
158     then
159     # install services dir with right permissions
160     install -m0755 -o root -g root -d ${MROOT}/usr/share/services
161    
162     # kbuildsycoco4 needs a dbus session, but should not use the users session.
163     # so we start an own session here
164    
165     # export everything the be able to kill the session
166     echo "Starting dbus session for kbuildsycoca4 ..."
167     local i
168     for i in $(dbus-launch)
169     do
170     export "$i"
171     done
172    
173     echo "Running kbuildsycoca4 to build global database ..."
174     XDG_DATA_DIRS="${MROOT}/usr/share:${MROOT}${KDEDIR}/share:${MROOT}/usr/local/share"
175     ${MROOT}${KDEDIR}/bin/kbuildsycoca4 --global --noincremental &> /dev/null
176    
177     echo "Killing dbus session for kbuildsycoca4 ..."
178     kill ${DBUS_SESSION_BUS_PID}
179     unset DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PID
180     fi
181     }
182    
183     kde4_postinstall()
184     {
185     # rebuild system konfiguration cache
186     kde4_buildsycoca
187     }
188    
189     kde4_postremove()
190     {
191     # rebuild system konfiguration cache
192     kde4_buildsycoca
193     }
194    
195     export_inherits kde4 src_prepare src_compile src_install postinstall postremove