Magellan Linux

Annotation of /trunk/include/kde4.sminc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 33244 - (hide annotations) (download)
Mon Oct 21 10:10:55 2019 UTC (4 years, 7 months ago) by niro
File size: 5869 byte(s)
-use variable builddir functions
1 niro 1927 # $Id$
2 niro 2
3 niro 21143 sminclude mtools cmake qt4 dbus
4 niro 21142 msetfeature "!check" # no check target in Makefile
5 niro 2
6     ## some global vars ##
7 niro 6839 export KDEDIR=/usr
8 niro 2 export KDECONFDIR=/etc/kde4
9     export QT_PLUGIN_PATH=${KDEDIR}/$(mlibdir)/kde4/plugins
10    
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 niro 23681 # nepomuk or baloo support or both?
21     KDE4_ENABLE_NEPOMUK=0
22     KDE4_ENABLE_BALOO=1
23    
24 niro 2 # some sane default values
25 niro 9863 : ${PCAT="kde-base"}
26 niro 15565 if [[ -z ${SRCFILE} ]]
27 niro 12339 then
28 niro 23309 if [[ ${PVER%%.*} = 0 ]]
29 niro 15565 then
30 niro 23309 KDE4_TARBALL_EXTENSION="tar.bz2"
31     elif [[ ${PVER//.} -ge 483 ]]
32     then
33 niro 15565 KDE4_TARBALL_EXTENSION="tar.xz"
34     else
35     KDE4_TARBALL_EXTENSION="tar.bz2"
36     fi
37 niro 12339 fi
38     : ${SRCFILE="${PNAME/4/}-${PVER}.${KDE4_TARBALL_EXTENSION}"}
39 niro 2 : ${SRCDIR="${BUILDDIR}/${PNAME/4/}-${PVER}"}
40     : ${DESCRIPTION="${PNAME}"}
41     : ${HOMEPAGE="http://www.kde.org/"}
42    
43 niro 23332 case ${PNAME} in
44 niro 23339 oxygen-icons|kde-base-artwork|kdeartwork-*|kde-wallpapers) ;; # no common deps required
45 niro 23332 *)
46     DEPEND="${DEPEND}
47     >= x11-libs/libXt-1
48     >= x11-libs/libXinerama-1
49     >= x11-libs/qt4-gui-4.8
50     >= x11-libs/qt4-qt3support-4.8
51     >= x11-libs/qt4-script-4.8
52     >= x11-libs/qt4-sql-4.8
53     >= x11-libs/qt4-svg-4.8
54     >= x11-libs/qt4-test-4.8
55     >= x11-libs/qt4-dbus-4.8
56     >= x11-libs/qt4-opengl-4.8
57     >= x11-libs/qt4-webkit-4.8
58     >= x11-libs/qt4-declarative-4.8"
59     ;;
60     esac
61 niro 2
62 niro 23332 case ${PNAME} in
63 niro 23339 phonon|phonon-backend-*|oxygen-icons|kde-base-artwork|kdeartwork-*|kde-wallpapers|automoc4) ;; # no phonon deps required
64 niro 23332 *)
65     DEPEND="${DEPEND}
66     >= virtual/phonon
67     >= virtual/phonon-backend"
68     ;;
69     esac
70 niro 5637
71 niro 2 SDEPEND="${SDEPEND}
72 niro 21141 >= dev-util/cmake-2.8.12
73 niro 23681 >= dev-util/pkgconfig-0.25
74     >= app-text/docbook-xml-dtd42-4.2
75     >= app-text/docbook-xsl-stylesheets-1.76"
76 niro 2
77 niro 8532 if [[ ${PNAME} != automoc4 ]]
78     then
79     SDEPEND="${SDEPEND}
80     >= kde-base/automoc4-0.9.88"
81     fi
82    
83 niro 2 # small hack to fix kdemirrors
84     [[ ${KDE_MIRROR_UNSTABLE} = 1 ]] && KDE_MIRRORS=$(echo ${KDE_MIRRORS} | sed "s:/stable:/unstable:g")
85    
86     SRC_URI=(
87     ${SRC_URI[*]}
88     kde://${PVER}/src/${SRCFILE}
89     kde://${PVER%.*}/src/${SRCFILE}
90     mirror://${PNAME}/${SRCFILE}
91     )
92    
93 niro 21141 UP2DATE="updatecmd -listonly http://download.kde.org/stable/ | grep 'stable/[0-9]' | sed -n 's:.*/\([0-9].*\)/:\1:;$ p'"
94    
95 niro 2 # exported functions and variables for mage-file
96 niro 4788 SPECIAL_VARS="${SPECIAL_VARS} KDEDIR"
97 niro 6918 SPECIAL_FUNCTIONS="${SPECIAL_FUNCTIONS} kde4_postinstall kde4_postremove"
98 niro 2
99 niro 23681 kde4_add_nepomuk_depend()
100     {
101     local var="$1"
102     local dep="$2"
103     [[ -n ${var} ]] || die "kde4_add_nepomuk_depend(): no variable given"
104     [[ -n ${dep} ]] || die "kde4_add_nepomuk_depend(): no deps given"
105    
106     if [[ ${KDE4_ENABLE_NEPOMUK} = 1 ]]
107     then
108     eval "$(echo -e ${var}=\"\${${var}}\\n${dep}\")"
109     else
110     [[ ${SILENT} = 0 ]] && echo "Nepomuk disabled, not adding '${dep}' to '${var}'"
111     fi
112     }
113    
114     kde4_add_baloo_depend()
115     {
116     local var="$1"
117     local dep="$2"
118     [[ -n ${var} ]] || die "kde4_add_baloo_depend(): no variable given"
119     [[ -n ${dep} ]] || die "kde4_add_baloo_depend(): no deps given"
120    
121     if [[ ${KDE4_ENABLE_BALOO} = 1 ]]
122     then
123     eval "$(echo -e ${var}=\"\${${var}}\\n${dep}\")"
124     else
125     [[ ${SILENT} = 0 ]] && echo "Baloo disabled, not adding '${dep}' to '${var}'"
126     fi
127     }
128    
129 niro 2 kde4_configure()
130     {
131     local configure_opts
132    
133     # disabled, seems to be broken atm
134     # # use --enable-final only on i*86
135 niro 4091 # [[ ${ARCH} = i*86 ]] && configure_opts+=" -DKDE4_ENABLE_FINAL=ON"
136     configure_opts+=" -DCMAKE_BUILD_TYPE=Release"
137 niro 2
138 niro 4083 # use full rpath on non /usr installations
139 niro 4091 [[ ${KDEDIR} != /usr ]] && configure_opts+=" -DKDE4_USE_ALWAYS_FULL_RPATH=ON"
140 niro 4083
141 niro 4090 # add akonadi dbus dir
142     if [[ ${PNAME/4/} = akonadi ]] || [[ ${PNAME/4/} = kdepim-runtime ]]
143     then
144 niro 21143 configure_opts+=" -DAKONADI_DBUS_INTERFACES_DIR=$(mget-dbus-interfaces-dir)"
145     configure_opts+=" -DAKONADI_DBUS_SERVICES_DIR=$(mget-dbus-session-bus-services-dir)"
146 niro 4090 fi
147    
148 niro 2 # add commandline given arguments
149 niro 4091 configure_opts+=" $@"
150 niro 2
151     # build outside of the source dir
152 niro 33244 cmake_setup_builddir || die
153 niro 2
154     cmake_configure \
155 niro 4091 -DCMAKE_INSTALL_PREFIX=${KDEDIR} \
156     -DSYSCONF_INSTALL_DIR=${KDECONFDIR} \
157     -DLIB_INSTALL_DIR=${KDEDIR}/$(mlibdir) \
158 niro 21143 -DDBUS_INTERFACES_INSTALL_DIR=$(mget-dbus-interfaces-dir) \
159     -DDBUS_SERVICES_INSTALL_DIR=$(mget-dbus-session-bus-services-dir) \
160     -DKDE4_DBUS_INTERFACES_DIR=$(mget-dbus-interfaces-dir) \
161     -DKDE4_DBUS_SERVICES_DIR=$(mget-dbus-session-bus-services-dir) \
162 niro 2 -DKDE4_ENABLE_FPIE=ON \
163     -DKDE4_BUILD_TESTS=OFF \
164     -DKDE4_ENABLE_HTMLHANDBOOK=ON \
165     ${configure_opts} \
166     || die
167     }
168    
169     kde4_src_prepare()
170     {
171     munpack ${SRCFILE} || die
172     }
173    
174     kde4_src_compile()
175     {
176     cd ${SRCDIR}
177    
178     kde4_configure || die
179 niro 33244 cmake_mmake ${KDE4_MAKE_OPTS} || die
180 niro 2 }
181    
182     kde4_src_install()
183     {
184     cd ${BUILDDIR}/build
185 niro 1921 mmake DESTDIR=${BINDIR} ${KDE4_MAKE_OPTS} install || die
186 niro 2
187 niro 4091 # move dbus service dirs to a proper location if KDEDIR != /usr
188     if [[ ${KDEDIR} != /usr ]]
189     then
190     if [[ -d ${BINDIR}/${KDEDIR}/share/dbus-1 ]]
191     then
192     echo -e "${COLYELLOW}Warning: using dbus hotfix, dbus locations should be fixed!${COLDEFAULT}"
193     minstalldir /usr/share || die
194     cp -R ${BINDIR}/${KDEDIR}/share/dbus-1 ${BINDIR}/usr/share/ || die
195     rm -r ${BINDIR}/${KDEDIR}/share/dbus-1 || die
196     fi
197     fi
198 niro 15751 # or if KDECONFDIR != /etc
199     if [[ ${KDECONFDIR} != /etc ]]
200     then
201     if [[ -d ${BINDIR}/${KDECONFDIR}/dbus-1 ]]
202     then
203 niro 15752 echo -e "${COLYELLOW}Warning: using dbus hotfix, dbus locations should be fixed!${COLDEFAULT}"
204 niro 15751 minstalldir /etc || die
205     cp -R ${BINDIR}/${KDECONFDIR}/dbus-1 ${BINDIR}/etc/ || die
206     rm -r ${BINDIR}/${KDECONFDIR}/dbus-1 || die
207     fi
208     fi
209 niro 4090
210 niro 2 cd ${SRCDIR}
211     local i
212     for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \
213     FAQ LICENSE NEWS README TODO
214     do
215     if [ -f ${SRCDIR}/${i} ]
216     then
217     minstalldocs ${i} || die
218     fi
219     done
220     }
221    
222 niro 7127 export_inherits kde4 src_prepare src_compile src_install