/[gentoo-x86]/eclass/kde4-base.eclass
Gentoo

Diff of /eclass/kde4-base.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.122 Revision 1.130
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2013 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.122 2013/02/02 16:58:00 dilfridge Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.130 2013/08/15 15:29:58 kensington Exp $
4 4
5# @ECLASS: kde4-base.eclass 5# @ECLASS: kde4-base.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# kde@gentoo.org 7# kde@gentoo.org
8# @BLURB: This eclass provides functions for kde 4.X ebuilds 8# @BLURB: This eclass provides functions for kde 4.X ebuilds
9# @DESCRIPTION: 9# @DESCRIPTION:
10# The kde4-base.eclass provides support for building KDE4 based ebuilds 10# The kde4-base.eclass provides support for building KDE4 based ebuilds
11# and KDE4 applications. 11# and KDE4 applications.
12# 12#
13# NOTE: KDE 4 ebuilds currently support EAPI "3". This will be reviewed 13# NOTE: KDE 4 ebuilds currently support EAPIs 4 and 5. This will be
14# over time as new EAPI versions are approved. 14# reviewed over time as new EAPI versions are approved.
15
16if [[ ${___ECLASS_ONCE_KDE4_BASE} != "recur -_+^+_- spank" ]] ; then
17___ECLASS_ONCE_KDE4_BASE="recur -_+^+_- spank"
15 18
16# @ECLASS-VARIABLE: KDE_SELINUX_MODULE 19# @ECLASS-VARIABLE: KDE_SELINUX_MODULE
17# @DESCRIPTION: 20# @DESCRIPTION:
18# If set to "none", do nothing. 21# If set to "none", do nothing.
19# For any other value, add selinux to IUSE, and depending on that useflag 22# For any other value, add selinux to IUSE, and depending on that useflag
104unset buildsystem_eclass 107unset buildsystem_eclass
105unset export_fns 108unset export_fns
106 109
107# @ECLASS-VARIABLE: DECLARATIVE_REQUIRED 110# @ECLASS-VARIABLE: DECLARATIVE_REQUIRED
108# @DESCRIPTION: 111# @DESCRIPTION:
109# Is qt-declarative required? Possible values are 'always', 'optional' and 'never'. 112# Is qtdeclarative required? Possible values are 'always', 'optional' and 'never'.
110# This variable must be set before inheriting any eclasses. Defaults to 'never'. 113# This variable must be set before inheriting any eclasses. Defaults to 'never'.
111DECLARATIVE_REQUIRED="${DECLARATIVE_REQUIRED:-never}" 114DECLARATIVE_REQUIRED="${DECLARATIVE_REQUIRED:-never}"
112 115
113# @ECLASS-VARIABLE: QTHELP_REQUIRED 116# @ECLASS-VARIABLE: QTHELP_REQUIRED
114# @DESCRIPTION: 117# @DESCRIPTION:
115# Is qt-assistant required? Possible values are 'always', 'optional' and 'never'. 118# Is qthelp required? Possible values are 'always', 'optional' and 'never'.
116# This variable must be set before inheriting any eclasses. Defaults to 'never'. 119# This variable must be set before inheriting any eclasses. Defaults to 'never'.
117QTHELP_REQUIRED="${QTHELP_REQUIRED:-never}" 120QTHELP_REQUIRED="${QTHELP_REQUIRED:-never}"
118 121
119# @ECLASS-VARIABLE: OPENGL_REQUIRED 122# @ECLASS-VARIABLE: OPENGL_REQUIRED
120# @DESCRIPTION: 123# @DESCRIPTION:
121# Is qt-opengl required? Possible values are 'always', 'optional' and 'never'. 124# Is qtopengl required? Possible values are 'always', 'optional' and 'never'.
122# This variable must be set before inheriting any eclasses. Defaults to 'never'. 125# This variable must be set before inheriting any eclasses. Defaults to 'never'.
123OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}" 126OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}"
124 127
125# @ECLASS-VARIABLE: MULTIMEDIA_REQUIRED 128# @ECLASS-VARIABLE: MULTIMEDIA_REQUIRED
126# @DESCRIPTION: 129# @DESCRIPTION:
127# Is qt-multimedia required? Possible values are 'always', 'optional' and 'never'. 130# Is qtmultimedia required? Possible values are 'always', 'optional' and 'never'.
128# This variable must be set before inheriting any eclasses. Defaults to 'never'. 131# This variable must be set before inheriting any eclasses. Defaults to 'never'.
129MULTIMEDIA_REQUIRED="${MULTIMEDIA_REQUIRED:-never}" 132MULTIMEDIA_REQUIRED="${MULTIMEDIA_REQUIRED:-never}"
130 133
131# @ECLASS-VARIABLE: CPPUNIT_REQUIRED 134# @ECLASS-VARIABLE: CPPUNIT_REQUIRED
132# @DESCRIPTION: 135# @DESCRIPTION:
174 177
175 # This code is to prevent portage from searching GENTOO_MIRRORS for 178 # This code is to prevent portage from searching GENTOO_MIRRORS for
176 # packages that will never be mirrored. (As they only will ever be in 179 # packages that will never be mirrored. (As they only will ever be in
177 # the overlay). 180 # the overlay).
178 case ${PV} in 181 case ${PV} in
179 *9999* | 4.?.[6-9]?) 182 *9999* | 4.?.[6-9]? | 4.??.[6-9]?)
180 RESTRICT+=" mirror" 183 RESTRICT+=" mirror"
181 ;; 184 ;;
182 esac 185 esac
183 ;; 186 ;;
184 kdevelop) 187 kdevelop)
188esac 191esac
189 192
190# @ECLASS-VARIABLE: QT_MINIMAL 193# @ECLASS-VARIABLE: QT_MINIMAL
191# @DESCRIPTION: 194# @DESCRIPTION:
192# Determine version of qt we enforce as minimal for the package. 195# Determine version of qt we enforce as minimal for the package.
193if version_is_at_least 4.8.50 "${KDE_MINIMAL}"; then
194 # Upstream has added an *undeclared* dependency on Qt 4.8...
195 QT_MINIMAL="${QT_MINIMAL:-4.8.0}" 196QT_MINIMAL="${QT_MINIMAL:-4.8.0}"
196else
197 QT_MINIMAL="${QT_MINIMAL:-4.7.4}"
198fi
199 197
200# Declarative dependencies 198# Declarative dependencies
201qtdeclarativedepend=" 199qtdeclarativedepend="
202 >=x11-libs/qt-declarative-${QT_MINIMAL}:4 200 >=dev-qt/qtdeclarative-${QT_MINIMAL}:4
203" 201"
204case ${DECLARATIVE_REQUIRED} in 202case ${DECLARATIVE_REQUIRED} in
205 always) 203 always)
206 COMMONDEPEND+=" ${qtdeclarativedepend}" 204 COMMONDEPEND+=" ${qtdeclarativedepend}"
207 ;; 205 ;;
213esac 211esac
214unset qtdeclarativedepend 212unset qtdeclarativedepend
215 213
216# QtHelp dependencies 214# QtHelp dependencies
217qthelpdepend=" 215qthelpdepend="
218 >=x11-libs/qt-assistant-${QT_MINIMAL}:4 216 >=dev-qt/qthelp-${QT_MINIMAL}:4
219" 217"
220case ${QTHELP_REQUIRED} in 218case ${QTHELP_REQUIRED} in
221 always) 219 always)
222 COMMONDEPEND+=" ${qthelpdepend}" 220 COMMONDEPEND+=" ${qthelpdepend}"
223 ;; 221 ;;
228esac 226esac
229unset qthelpdepend 227unset qthelpdepend
230 228
231# OpenGL dependencies 229# OpenGL dependencies
232qtopengldepend=" 230qtopengldepend="
233 >=x11-libs/qt-opengl-${QT_MINIMAL}:4 231 >=dev-qt/qtopengl-${QT_MINIMAL}:4
234" 232"
235case ${OPENGL_REQUIRED} in 233case ${OPENGL_REQUIRED} in
236 always) 234 always)
237 COMMONDEPEND+=" ${qtopengldepend}" 235 COMMONDEPEND+=" ${qtopengldepend}"
238 ;; 236 ;;
244esac 242esac
245unset qtopengldepend 243unset qtopengldepend
246 244
247# MultiMedia dependencies 245# MultiMedia dependencies
248qtmultimediadepend=" 246qtmultimediadepend="
249 >=x11-libs/qt-multimedia-${QT_MINIMAL}:4 247 >=dev-qt/qtmultimedia-${QT_MINIMAL}:4
250" 248"
251case ${MULTIMEDIA_REQUIRED} in 249case ${MULTIMEDIA_REQUIRED} in
252 always) 250 always)
253 COMMONDEPEND+=" ${qtmultimediadepend}" 251 COMMONDEPEND+=" ${qtmultimediadepend}"
254 ;; 252 ;;
278 276
279# KDE dependencies 277# KDE dependencies
280# Qt accessibility classes are needed in various places, bug 325461 278# Qt accessibility classes are needed in various places, bug 325461
281kdecommondepend=" 279kdecommondepend="
282 dev-lang/perl 280 dev-lang/perl
283 >=x11-libs/qt-core-${QT_MINIMAL}:4[qt3support,ssl]
284 >=x11-libs/qt-dbus-${QT_MINIMAL}:4
285 >=x11-libs/qt-gui-${QT_MINIMAL}:4[accessibility,dbus]
286 >=x11-libs/qt-qt3support-${QT_MINIMAL}:4[accessibility] 281 >=dev-qt/qt3support-${QT_MINIMAL}:4[accessibility]
282 >=dev-qt/qtcore-${QT_MINIMAL}:4[qt3support,ssl]
283 >=dev-qt/qtdbus-${QT_MINIMAL}:4
284 || (
285 ( >=dev-qt/qtgui-4.8.5:4[accessibility,dbus(+)] dev-qt/designer:4[-phonon] )
286 <dev-qt/qtgui-4.8.5:4[accessibility,dbus(+)]
287 )
287 >=x11-libs/qt-script-${QT_MINIMAL}:4 288 >=dev-qt/qtscript-${QT_MINIMAL}:4
288 >=x11-libs/qt-sql-${QT_MINIMAL}:4[qt3support] 289 >=dev-qt/qtsql-${QT_MINIMAL}:4[qt3support]
289 >=x11-libs/qt-svg-${QT_MINIMAL}:4 290 >=dev-qt/qtsvg-${QT_MINIMAL}:4
290 >=x11-libs/qt-test-${QT_MINIMAL}:4 291 >=dev-qt/qttest-${QT_MINIMAL}:4
291 >=x11-libs/qt-webkit-${QT_MINIMAL}:4 292 >=dev-qt/qtwebkit-${QT_MINIMAL}:4
292 !aqua? ( 293 !aqua? (
293 x11-libs/libXext 294 x11-libs/libXext
294 x11-libs/libXt 295 x11-libs/libXt
295 x11-libs/libXxf86vm 296 x11-libs/libXxf86vm
296 x11-libs/libXcomposite 297 x11-libs/libXcomposite
333# all packages needs oxygen icons for basic iconset 334# all packages needs oxygen icons for basic iconset
334if [[ ${PN} != oxygen-icons ]]; then 335if [[ ${PN} != oxygen-icons ]]; then
335 kderdepend+=" $(add_kdebase_dep oxygen-icons)" 336 kderdepend+=" $(add_kdebase_dep oxygen-icons)"
336fi 337fi
337 338
338# add a dependency over kde-l10n if EAPI4 or better is around
339if [[ ${KDEBASE} != "kde-base" && -n ${KDE_LINGUAS} && ${EAPI:-0} != 3 ]]; then 339if [[ ${KDEBASE} != "kde-base" && -n ${KDE_LINGUAS} ]]; then
340 for _lingua in ${KDE_LINGUAS}; do 340 for _lingua in ${KDE_LINGUAS}; do
341 # if our package has lignuas, pull in kde-l10n with selected lingua enabled, 341 # if our package has lignuas, pull in kde-l10n with selected lingua enabled,
342 # but only for selected ones. 342 # but only for selected ones.
343 # this can't be done on one line because if user doesn't use any localisation 343 # this can't be done on one line because if user doesn't use any localisation
344 # then he is probably not interested in kde-l10n at all. 344 # then he is probably not interested in kde-l10n at all.
376 IUSE+=" selinux" 376 IUSE+=" selinux"
377 kdecommondepend+=" selinux? ( sec-policy/selinux-${KDE_SELINUX_MODULE} )" 377 kdecommondepend+=" selinux? ( sec-policy/selinux-${KDE_SELINUX_MODULE} )"
378 ;; 378 ;;
379esac 379esac
380 380
381# We always need the aqua useflag because otherwise we cannot = refer to it inside
382# add_kdebase_dep. This was always kind of a bug, but came to light with EAPI=5
383# (where referring to a use flag not in IUSE masks the ebuild).
384# The only alternative would be to prohibit using add_kdebase_dep if KDE_REQUIRED=never
385IUSE+=" aqua"
386
381case ${KDE_REQUIRED} in 387case ${KDE_REQUIRED} in
382 always) 388 always)
383 IUSE+=" aqua"
384 [[ -n ${kdecommondepend} ]] && COMMONDEPEND+=" ${kdecommondepend}" 389 [[ -n ${kdecommondepend} ]] && COMMONDEPEND+=" ${kdecommondepend}"
385 [[ -n ${kdedepend} ]] && DEPEND+=" ${kdedepend}" 390 [[ -n ${kdedepend} ]] && DEPEND+=" ${kdedepend}"
386 [[ -n ${kderdepend} ]] && RDEPEND+=" ${kderdepend}" 391 [[ -n ${kderdepend} ]] && RDEPEND+=" ${kderdepend}"
387 ;; 392 ;;
388 optional) 393 optional)
389 IUSE+=" aqua kde" 394 IUSE+=" kde"
390 [[ -n ${kdecommondepend} ]] && COMMONDEPEND+=" kde? ( ${kdecommondepend} )" 395 [[ -n ${kdecommondepend} ]] && COMMONDEPEND+=" kde? ( ${kdecommondepend} )"
391 [[ -n ${kdedepend} ]] && DEPEND+=" kde? ( ${kdedepend} )" 396 [[ -n ${kdedepend} ]] && DEPEND+=" kde? ( ${kdedepend} )"
392 [[ -n ${kderdepend} ]] && RDEPEND+=" kde? ( ${kderdepend} )" 397 [[ -n ${kderdepend} ]] && RDEPEND+=" kde? ( ${kderdepend} )"
393 ;; 398 ;;
394 *) ;; 399 *) ;;
415 # we calculate URI only for known KDEBASE modules 420 # we calculate URI only for known KDEBASE modules
416 [[ -n ${KDEBASE} ]] || return 421 [[ -n ${KDEBASE} ]] || return
417 422
418 # calculate tarball module name 423 # calculate tarball module name
419 if [[ -n ${KMNAME} ]]; then 424 if [[ -n ${KMNAME} ]]; then
420 # fixup kdebase-apps name
421 case ${KMNAME} in
422 kdebase-apps)
423 _kmname="kdebase" ;;
424 *)
425 _kmname="${KMNAME}" ;; 425 _kmname="${KMNAME}"
426 esac
427 else 426 else
428 _kmname=${PN} 427 _kmname=${PN}
429 fi 428 fi
430 _kmname_pv="${_kmname}-${PV}" 429 _kmname_pv="${_kmname}-${PV}"
431 case ${KDEBASE} in 430 case ${KDEBASE} in
433 case ${PV} in 432 case ${PV} in
434 4.4.11.1) 433 4.4.11.1)
435 # KDEPIM 4.4, special case 434 # KDEPIM 4.4, special case
436 # TODO: Remove this part when KDEPIM 4.4 gets out of the tree 435 # TODO: Remove this part when KDEPIM 4.4 gets out of the tree
437 SRC_URI="mirror://kde/stable/kdepim-${PV}/src/${_kmname_pv}.tar.bz2" ;; 436 SRC_URI="mirror://kde/stable/kdepim-${PV}/src/${_kmname_pv}.tar.bz2" ;;
438 4.[89].8[05] | 4.[89].9[0235678]) 437 4.?.[6-9]? | 4.??.[6-9]?)
439 # Unstable KDE SC releases 438 # Unstable KDE SC releases
440 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.xz" ;; 439 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.xz" ;;
441 4.[1234567].[12345]) 440 4.[1-7].[12345])
442 # Stable KDE SC with old .bz2 support 441 # Stable KDE SC with old .bz2 support
443 SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2" ;; 442 SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2" ;;
444 *) 443 *)
445 # Stable KDE SC releases 444 # Stable KDE SC releases
446 SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.xz" ;; 445 SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.xz" ;;
447 esac 446 esac
448 ;; 447 ;;
449 kdevelop|kdevelop-php*|kdevplatform) 448 kdevelop|kdevelop-php*|kdevplatform)
450 case ${KDEVELOP_VERSION} in 449 case ${KDEVELOP_VERSION} in
451 4.[12].[6-9]*) SRC_URI="mirror://kde/unstable/kdevelop/${KDEVELOP_VERSION}/src/${P}.tar.bz2" ;; 450 4.[123].[6-9]*) SRC_URI="mirror://kde/unstable/kdevelop/${KDEVELOP_VERSION}/src/${P}.tar.bz2" ;;
452 *) SRC_URI="mirror://kde/stable/kdevelop/${KDEVELOP_VERSION}/src/${P}.tar.bz2" ;; 451 *) SRC_URI="mirror://kde/stable/kdevelop/${KDEVELOP_VERSION}/src/${P}.tar.bz2" ;;
453 esac 452 esac
454 ;; 453 ;;
455 esac 454 esac
456} 455}
592 591
593 # Check if gcc compiler is fresh enough. 592 # Check if gcc compiler is fresh enough.
594 # In theory should be in pkg_pretend but we check it only for kdelibs there 593 # In theory should be in pkg_pretend but we check it only for kdelibs there
595 # and for others we do just quick scan in pkg_setup because pkg_pretend 594 # and for others we do just quick scan in pkg_setup because pkg_pretend
596 # executions consume quite some time. 595 # executions consume quite some time.
597 # We can only do this for EAPI 4 or later because the MERGE_TYPE variable
598 # is otherwise undefined.
599 if [[ ${EAPI:-0} != 3 ]]; then
600 if [[ ${MERGE_TYPE} != binary ]]; then 596 if [[ ${MERGE_TYPE} != binary ]]; then
601 [[ $(gcc-major-version) -lt 4 ]] || \ 597 [[ $(gcc-major-version) -lt 4 ]] || \
602 ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -le 3 ]] ) \ 598 ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -le 3 ]] ) \
603 && die "Sorry, but gcc-4.3 and earlier wont work for KDE (see bug 354837)." 599 && die "Sorry, but gcc-4.3 and earlier wont work for KDE (see bug 354837)."
604 fi
605 fi 600 fi
606 601
607 KDEDIR=/usr 602 KDEDIR=/usr
608 : ${PREFIX:=/usr} 603 : ${PREFIX:=/usr}
609 EKDEDIR=${EPREFIX}/usr 604 EKDEDIR=${EPREFIX}/usr
622 debug-print-function ${FUNCNAME} "$@" 617 debug-print-function ${FUNCNAME} "$@"
623 618
624 if [[ ${KDE_BUILD_TYPE} = live ]]; then 619 if [[ ${KDE_BUILD_TYPE} = live ]]; then
625 case ${KDE_SCM} in 620 case ${KDE_SCM} in
626 svn) 621 svn)
627 migrate_store_dir
628 subversion_src_unpack 622 subversion_src_unpack
629 ;; 623 ;;
630 git) 624 git)
631 git-2_src_unpack 625 git-2_src_unpack
632 ;; 626 ;;
836 done 830 done
837 fi 831 fi
838 832
839 cmake-utils_src_install 833 cmake-utils_src_install
840 834
841 # In EAPI 4+, we don't want ${PREFIX}/share/doc/HTML to be compressed, 835 # We don't want ${PREFIX}/share/doc/HTML to be compressed,
842 # because then khelpcenter can't find the docs 836 # because then khelpcenter can't find the docs
843 [[ ${EAPI:-0} != 3 && -d ${ED}/${PREFIX}/share/doc/HTML ]] && 837 [[ -d ${ED}/${PREFIX}/share/doc/HTML ]] &&
844 docompress -x ${PREFIX}/share/doc/HTML 838 docompress -x ${PREFIX}/share/doc/HTML
845} 839}
846 840
847# @FUNCTION: kde4-base_pkg_preinst 841# @FUNCTION: kde4-base_pkg_preinst
848# @DESCRIPTION: 842# @DESCRIPTION:
899 gnome2_icon_cache_update 893 gnome2_icon_cache_update
900 fdo-mime_desktop_database_update 894 fdo-mime_desktop_database_update
901 fdo-mime_mime_database_update 895 fdo-mime_mime_database_update
902 buildsycoca 896 buildsycoca
903} 897}
898
899fi

Legend:
Removed from v.1.122  
changed lines
  Added in v.1.130

  ViewVC Help
Powered by ViewVC 1.1.20