/[gentoo-x86]/eclass/qt4.eclass
Gentoo

Diff of /eclass/qt4.eclass

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

Revision 1.30 Revision 1.32
1# Copyright 2005 Gentoo Foundation 1# Copyright 2005 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/Attic/qt4.eclass,v 1.30 2007/12/19 18:07:47 caleb Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/qt4.eclass,v 1.32 2008/01/05 18:44:38 caleb Exp $
4 4
5# @ECLASS: qt4.eclass 5# @ECLASS: qt4.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Caleb Tennis <caleb@gentoo.org> 7# Caleb Tennis <caleb@gentoo.org>
8# @BLURB: 8# @BLURB:
26# This function should be called in package DEPENDs whenever it depends on qt4. 26# This function should be called in package DEPENDs whenever it depends on qt4.
27# Simple example - in your depend, do something like this: 27# Simple example - in your depend, do something like this:
28# DEPEND="$(qt4_min_version 4.2)" 28# DEPEND="$(qt4_min_version 4.2)"
29# if package can be build with qt-4.2 or higher. 29# if package can be build with qt-4.2 or higher.
30qt4_min_version() { 30qt4_min_version() {
31 # This is much simpler for EAPI 1, we can use a slot dependency
32 if [[ "${EAPI}" -ge 1 ]]; then
33 echo ">=${QTPKG}${1}:4"
34 else
31 echo "|| (" 35 echo "|| ("
32 qt4_min_version_list "$@" 36 qt4_min_version_list "$@"
33 echo ")" 37 echo ")"
38 fi
34} 39}
35 40
36qt4_min_version_list() { 41qt4_min_version_list() {
37 local MINVER="$1" 42 local MINVER="$1"
38 local VERSIONS="" 43 local VERSIONS=""
70# - QT4_BUILT_WITH_USE_CHECK - contains use flags that need to be turned on for 75# - QT4_BUILT_WITH_USE_CHECK - contains use flags that need to be turned on for
71# =x11-libs/qt-4* 76# =x11-libs/qt-4*
72# - QT4_OPTIONAL_BUILT_WITH_USE_CHECK - qt4 flags that provides some 77# - QT4_OPTIONAL_BUILT_WITH_USE_CHECK - qt4 flags that provides some
73# functionality, but can alternatively be disabled in ${CATEGORY}/${PN} 78# functionality, but can alternatively be disabled in ${CATEGORY}/${PN}
74# (so qt4 don't have to be recompiled) 79# (so qt4 don't have to be recompiled)
80#
81# flags to watch for for Qt4.4:
82# zlib png | opengl dbus qt3support | sqlite3 ssl
75qt4_pkg_setup() { 83qt4_pkg_setup() {
84
85 QT4_BEST_VERSION="$(best_version =x11-libs/qt-4*)"
86 QT4_MINOR_VERSION="$(get_version_component_range 2 ${QT4_BEST_VERSION/*qt-/})"
87
76 local requiredflags="" 88 local requiredflags=""
77 for x in ${QT4_BUILT_WITH_USE_CHECK}; do 89 for x in ${QT4_BUILT_WITH_USE_CHECK}; do
90 if [[ "${QT4_MINOR_VERSION}" -ge 4 ]]; then
91 # The use flags are different in 4.4 and above, and it's a split package, so this is used to catch
92 # the various use flag combos specified in the ebuilds to make sure we don't error out.
93
94 if [[ ${x} == zlib || ${x} == png ]]; then
95 # Qt 4.4+ is built with zlib and png by default, so the use flags aren't needed
96 continue;
97 elif [[ ${x} == opengl || ${x} == dbus || ${x} == qt3support ]]; then
98 # Make sure the qt-${x} package has been already installed
99
100 if ! has_version x11-libs/qt-${x}; then
101 eerror "You must first install the x11-libs/qt-${x} package."
102 die "Install x11-libs/qt-${x}"
103 fi
104 elif [[ ${x} == ssl ]]; then
105 if ! has_version x11-libs/qt-core || ! built_with_use x11-libs/qt-core ssl; then
106 eerror "You must first install the x11-libs/qt-core package with the ssl flag enabled."
107 die "Install x1-libs/qt-core with USE=\"ssl\""
108 fi
109 elif [[ ${x} == sqlite3 ]]; then
110 if ! has_version x11-libs/qt-sql || ! built_with_use x11-libs/qt-sql sqlite; then
111 eerror "You must first install the x11-libs/qt-sql package with the sqlite flag enabled."
112 die "Install x11-libs/qt-sql with USE="\sqlite\""
113 fi
114 fi
78 if ! built_with_use =x11-libs/qt-4* ${x}; then 115 elif ! built_with_use =x11-libs/qt-4* ${x}; then
79 requiredflags="${requiredflags} ${x}" 116 requiredflags="${requiredflags} ${x}"
80 fi 117 fi
81 done 118 done
82 119
83 local optionalflags="" 120 local optionalflags=""

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.32

  ViewVC Help
Powered by ViewVC 1.1.20