Magellan Linux

Annotation of /trunk/include/kde4.sminc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8496 - (hide annotations) (download)
Wed Jul 20 15:00:37 2011 UTC (13 years, 3 months ago) by niro
Original Path: branches/magellan-next/include/kde4.sminc
File size: 4025 byte(s)
-udpated qt deps 4.5 -> 4.7, cmake and pkgconfig
-handle phonon-backends as well

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     : ${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 niro 8496 >= x11-libs/qt4-gui-4.7
31     >= x11-libs/qt4-qt3support-4.7
32     >= x11-libs/qt4-script-4.7
33     >= x11-libs/qt4-sql-4.7
34     >= x11-libs/qt4-svg-4.7
35     >= x11-libs/qt4-test-4.7
36     >= x11-libs/qt4-dbus-4.7
37     >= x11-libs/qt4-opengl-4.7
38     >= x11-libs/qt4-webkit-4.7"
39 niro 2
40 niro 8496 if [[ ${PNAME} != phonon ]] && [[ ${PNAME} != phonon-backend-* ]]
41 niro 5637 then
42     DEPEND="${DEPEND}
43 niro 8496 >= virtual/phonon
44     >= virtual/phonon-backend"
45 niro 5637 fi
46    
47 niro 2 SDEPEND="${SDEPEND}
48 niro 8496 >= dev-util/cmake-2.8.5
49     >= dev-util/pkgconfig-0.25
50 niro 2 >= 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 niro 6918 SPECIAL_FUNCTIONS="${SPECIAL_FUNCTIONS} 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     -DDBUS_INTERFACES_INSTALL_DIR=${DBUS_SYSTEM_DIR}/interfaces/ \
101     -DDBUS_SERVICES_INSTALL_DIR=${DBUS_SYSTEM_DIR}/services/ \
102     -DKDE4_DBUS_INTERFACES_DIR=${DBUS_SYSTEM_DIR}/interfaces/ \
103     -DKDE4_DBUS_SERVICES_DIR=${DBUS_SYSTEM_DIR}/services/ \
104 niro 2 -DKDE4_ENABLE_FPIE=ON \
105     -DKDE4_BUILD_TESTS=OFF \
106     -DKDE4_ENABLE_HTMLHANDBOOK=ON \
107     ${configure_opts} \
108     || die
109     }
110    
111     kde4_src_prepare()
112     {
113     munpack ${SRCFILE} || die
114     }
115    
116     kde4_src_compile()
117     {
118     cd ${SRCDIR}
119    
120     kde4_configure || die
121 niro 1921 mmake ${KDE4_MAKE_OPTS} || die
122 niro 2 }
123    
124     kde4_src_install()
125     {
126     cd ${BUILDDIR}/build
127 niro 1921 mmake DESTDIR=${BINDIR} ${KDE4_MAKE_OPTS} install || die
128 niro 2
129 niro 4091 # move dbus service dirs to a proper location if KDEDIR != /usr
130     if [[ ${KDEDIR} != /usr ]]
131     then
132     if [[ -d ${BINDIR}/${KDEDIR}/share/dbus-1 ]]
133     then
134     echo -e "${COLYELLOW}Warning: using dbus hotfix, dbus locations should be fixed!${COLDEFAULT}"
135     minstalldir /usr/share || die
136     cp -R ${BINDIR}/${KDEDIR}/share/dbus-1 ${BINDIR}/usr/share/ || die
137     rm -r ${BINDIR}/${KDEDIR}/share/dbus-1 || die
138     fi
139     fi
140 niro 4090
141 niro 2 cd ${SRCDIR}
142     local i
143     for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \
144     FAQ LICENSE NEWS README TODO
145     do
146     if [ -f ${SRCDIR}/${i} ]
147     then
148     minstalldocs ${i} || die
149     fi
150     done
151     }
152    
153 niro 7127 export_inherits kde4 src_prepare src_compile src_install