Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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