Magellan Linux

Annotation of /trunk/include/kde4.sminc

Parent Directory Parent Directory | Revision Log Revision Log


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