Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 15565 - (hide annotations) (download)
Fri Jan 4 09:40:45 2013 UTC (11 years, 4 months ago) by niro
Original Path: trunk/include/kde4.sminc
File size: 4361 byte(s)
-eval tarball extension if no srcfile was given
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 niro 9863 : ${PCAT="kde-base"}
22 niro 15565 if [[ -z ${SRCFILE} ]]
23 niro 12339 then
24 niro 15565 if [[ ${PVER//.} -ge 483 ]]
25     then
26     KDE4_TARBALL_EXTENSION="tar.xz"
27     else
28     KDE4_TARBALL_EXTENSION="tar.bz2"
29     fi
30 niro 12339 fi
31     : ${SRCFILE="${PNAME/4/}-${PVER}.${KDE4_TARBALL_EXTENSION}"}
32 niro 2 : ${SRCDIR="${BUILDDIR}/${PNAME/4/}-${PVER}"}
33     : ${DESCRIPTION="${PNAME}"}
34     : ${HOMEPAGE="http://www.kde.org/"}
35    
36 niro 13883 if [[ ${PNAME} != oxygen-icons ]]
37     then
38     DEPEND="${DEPEND}
39     >= x11-libs/libXt-1
40     >= x11-libs/libXinerama-1
41     >= x11-libs/qt4-gui-4.7
42     >= x11-libs/qt4-qt3support-4.7
43     >= x11-libs/qt4-script-4.7
44     >= x11-libs/qt4-sql-4.7
45     >= x11-libs/qt4-svg-4.7
46     >= x11-libs/qt4-test-4.7
47     >= x11-libs/qt4-dbus-4.7
48     >= x11-libs/qt4-opengl-4.7
49     >= x11-libs/qt4-webkit-4.7
50     >= x11-libs/qt4-declarative-4.7"
51     fi
52 niro 2
53 niro 8496 if [[ ${PNAME} != phonon ]] && [[ ${PNAME} != phonon-backend-* ]]
54 niro 5637 then
55     DEPEND="${DEPEND}
56 niro 8496 >= virtual/phonon
57     >= virtual/phonon-backend"
58 niro 5637 fi
59    
60 niro 2 SDEPEND="${SDEPEND}
61 niro 8496 >= dev-util/cmake-2.8.5
62     >= dev-util/pkgconfig-0.25
63 niro 2 >= x11-proto/xf86vidmodeproto-2
64     >= x11-proto/xineramaproto-1"
65    
66 niro 8532 if [[ ${PNAME} != automoc4 ]]
67     then
68     SDEPEND="${SDEPEND}
69     >= kde-base/automoc4-0.9.88"
70     fi
71    
72 niro 2 # small hack to fix kdemirrors
73     [[ ${KDE_MIRROR_UNSTABLE} = 1 ]] && KDE_MIRRORS=$(echo ${KDE_MIRRORS} | sed "s:/stable:/unstable:g")
74    
75     SRC_URI=(
76     ${SRC_URI[*]}
77     kde://${PVER}/src/${SRCFILE}
78     kde://${PVER%.*}/src/${SRCFILE}
79     mirror://${PNAME}/${SRCFILE}
80     )
81    
82     # exported functions and variables for mage-file
83 niro 4788 SPECIAL_VARS="${SPECIAL_VARS} KDEDIR"
84 niro 6918 SPECIAL_FUNCTIONS="${SPECIAL_FUNCTIONS} kde4_postinstall kde4_postremove"
85 niro 2
86     kde4_configure()
87     {
88     local configure_opts
89    
90     # disabled, seems to be broken atm
91     # # use --enable-final only on i*86
92 niro 4091 # [[ ${ARCH} = i*86 ]] && configure_opts+=" -DKDE4_ENABLE_FINAL=ON"
93     configure_opts+=" -DCMAKE_BUILD_TYPE=Release"
94 niro 2
95 niro 4083 # use full rpath on non /usr installations
96 niro 4091 [[ ${KDEDIR} != /usr ]] && configure_opts+=" -DKDE4_USE_ALWAYS_FULL_RPATH=ON"
97 niro 4083
98 niro 4090 # add akonadi dbus dir
99     if [[ ${PNAME/4/} = akonadi ]] || [[ ${PNAME/4/} = kdepim-runtime ]]
100     then
101 niro 4091 configure_opts+=" -DAKONADI_DBUS_INTERFACES_DIR=${DBUS_SYSTEM_DIR}/interfaces/"
102     configure_opts+=" -DAKONADI_DBUS_SERVICES_DIR=${DBUS_SYSTEM_DIR}/services/"
103 niro 4090 fi
104    
105 niro 2 # add commandline given arguments
106 niro 4091 configure_opts+=" $@"
107 niro 2
108     # remove build dir if exist
109     [[ -d ${BUILDDIR}/build ]] && rm -rf ${BUILDDIR}/build
110    
111     # build outside of the source dir
112     install -d ${BUILDDIR}/build || die
113     cd ${BUILDDIR}/build
114    
115     cmake_configure \
116 niro 4091 -DCMAKE_INSTALL_PREFIX=${KDEDIR} \
117     -DSYSCONF_INSTALL_DIR=${KDECONFDIR} \
118     -DLIB_INSTALL_DIR=${KDEDIR}/$(mlibdir) \
119     -DDBUS_INTERFACES_INSTALL_DIR=${DBUS_SYSTEM_DIR}/interfaces/ \
120     -DDBUS_SERVICES_INSTALL_DIR=${DBUS_SYSTEM_DIR}/services/ \
121     -DKDE4_DBUS_INTERFACES_DIR=${DBUS_SYSTEM_DIR}/interfaces/ \
122     -DKDE4_DBUS_SERVICES_DIR=${DBUS_SYSTEM_DIR}/services/ \
123 niro 2 -DKDE4_ENABLE_FPIE=ON \
124     -DKDE4_BUILD_TESTS=OFF \
125     -DKDE4_ENABLE_HTMLHANDBOOK=ON \
126     ${configure_opts} \
127     || die
128     }
129    
130     kde4_src_prepare()
131     {
132     munpack ${SRCFILE} || die
133     }
134    
135     kde4_src_compile()
136     {
137     cd ${SRCDIR}
138    
139     kde4_configure || die
140 niro 1921 mmake ${KDE4_MAKE_OPTS} || die
141 niro 2 }
142    
143     kde4_src_install()
144     {
145     cd ${BUILDDIR}/build
146 niro 1921 mmake DESTDIR=${BINDIR} ${KDE4_MAKE_OPTS} install || die
147 niro 2
148 niro 4091 # move dbus service dirs to a proper location if KDEDIR != /usr
149     if [[ ${KDEDIR} != /usr ]]
150     then
151     if [[ -d ${BINDIR}/${KDEDIR}/share/dbus-1 ]]
152     then
153     echo -e "${COLYELLOW}Warning: using dbus hotfix, dbus locations should be fixed!${COLDEFAULT}"
154     minstalldir /usr/share || die
155     cp -R ${BINDIR}/${KDEDIR}/share/dbus-1 ${BINDIR}/usr/share/ || die
156     rm -r ${BINDIR}/${KDEDIR}/share/dbus-1 || die
157     fi
158     fi
159 niro 4090
160 niro 2 cd ${SRCDIR}
161     local i
162     for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \
163     FAQ LICENSE NEWS README TODO
164     do
165     if [ -f ${SRCDIR}/${i} ]
166     then
167     minstalldocs ${i} || die
168     fi
169     done
170     }
171    
172 niro 7127 export_inherits kde4 src_prepare src_compile src_install