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

Contents of /eclass/qt4.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.27 - (hide annotations) (download)
Wed Oct 3 14:59:04 2007 UTC (6 years, 9 months ago) by caleb
Branch: MAIN
Changes since 1.26: +2 -2 lines
Add 4.3.2

1 caleb 1.1 # Copyright 2005 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 caleb 1.27 # $Header: /var/cvsroot/gentoo-x86/eclass/qt4.eclass,v 1.26 2007/09/14 21:30:04 caleb Exp $
4 caleb 1.1 #
5     # Author Caleb Tennis <caleb@gentoo.org>
6     #
7     # This eclass is simple. Inherit it, and in your depend, do something like this:
8     #
9 nyhm 1.9 # DEPEND="$(qt4_min_version 4)"
10 caleb 1.1 #
11     # and it handles the rest for you
12     #
13 caleb 1.4 # 08.16.06 - Renamed qt_min_* to qt4_min_* to avoid conflicts with the qt3 eclass.
14     # - Caleb Tennis <caleb@gentoo.org>
15 caleb 1.1
16 caleb 1.20 inherit eutils multilib toolchain-funcs versionator
17 caleb 1.1
18 caleb 1.22 IUSE="${IUSE}"
19 caleb 1.21
20 caleb 1.1 QTPKG="x11-libs/qt-"
21 genstef 1.13 QT4MAJORVERSIONS="4.3 4.2 4.1 4.0"
22 caleb 1.27 QT4VERSIONS="4.3.2 4.3.1-r1 4.3.1 4.3.0-r2 4.3.0-r1 4.3.0 4.3.0_rc1 4.3.0_beta1 4.2.3-r1 4.2.3 4.2.2 4.2.1 4.2.0-r2 4.2.0-r1 4.2.0 4.1.4-r2 4.1.4-r1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.0.1 4.0.0"
23 caleb 1.1
24 caleb 1.4 qt4_min_version() {
25 caleb 1.1 echo "|| ("
26 caleb 1.4 qt4_min_version_list "$@"
27 caleb 1.1 echo ")"
28     }
29    
30 caleb 1.4 qt4_min_version_list() {
31 caleb 1.1 local MINVER="$1"
32     local VERSIONS=""
33    
34     case "${MINVER}" in
35     4|4.0|4.0.0) VERSIONS="=${QTPKG}4*";;
36 flameeyes 1.6 4.1|4.1.0|4.2|4.2.0)
37 caleb 1.1 for x in ${QT4MAJORVERSIONS}; do
38     if $(version_is_at_least "${MINVER}" "${x}"); then
39     VERSIONS="${VERSIONS} =${QTPKG}${x}*"
40     fi
41     done
42     ;;
43     4*)
44     for x in ${QT4VERSIONS}; do
45     if $(version_is_at_least "${MINVER}" "${x}"); then
46     VERSIONS="${VERSIONS} =${QTPKG}${x}"
47     fi
48     done
49     ;;
50     *) VERSIONS="=${QTPKG}4*";;
51     esac
52    
53     echo "${VERSIONS}"
54     }
55 caleb 1.16
56     qt4_pkg_setup() {
57 caleb 1.20 for x in ${QT4_BUILT_WITH_USE_CHECK}; do
58 caleb 1.18 if ! built_with_use =x11-libs/qt-4* $x; then
59 caleb 1.20 die "This package requires Qt4 to be built with the '${x}' use flag."
60 caleb 1.16 fi
61     done
62     }
63 caleb 1.20
64     eqmake4() {
65     local LOGFILE="${T}/qmake-$$.out"
66     local projprofile="${1}"
67     [ -z ${projprofile} ] && projprofile="${PN}.pro"
68     shift 1
69    
70     ebegin "Processing qmake ${projprofile}"
71    
72     # file exists?
73     if [ ! -f ${projprofile} ]; then
74     echo
75     eerror "Project .pro file \"${projprofile}\" does not exists"
76     eerror "qmake cannot handle non-existing .pro files"
77     echo
78     eerror "This shouldn't happen - please send a bug report to bugs.gentoo.org"
79     echo
80     die "Project file not found in ${PN} sources"
81     fi
82    
83     echo >> ${LOGFILE}
84     echo "****** qmake ${projprofile} ******" >> ${LOGFILE}
85     echo >> ${LOGFILE}
86    
87     # as a workaround for broken qmake, put everything into file
88 caleb 1.22 if has debug ${IUSE} && use debug; then
89 caleb 1.20 echo -e "$CONFIG -= release\nCONFIG += no_fixpath debug" >> ${projprofile}
90     else
91     echo -e "$CONFIG -= debug\nCONFIG += no_fixpath release" >> ${projprofile}
92     fi
93    
94     /usr/bin/qmake ${projprofile} \
95     QTDIR=/usr/$(get_libdir) \
96     QMAKE=/usr/bin/qmake \
97     QMAKE_CC=$(tc-getCC) \
98     QMAKE_CXX=$(tc-getCXX) \
99     QMAKE_LINK=$(tc-getCXX) \
100     QMAKE_CFLAGS_RELEASE="${CFLAGS}" \
101     QMAKE_CFLAGS_DEBUG="${CFLAGS}" \
102     QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS}" \
103     QMAKE_CXXFLAGS_DEBUG="${CXXFLAGS}" \
104     QMAKE_LFLAGS_RELEASE="${LDFLAGS}" \
105     QMAKE_LFLAGS_DEBUG="${LDFLAGS}" \
106     QMAKE_RPATH= \
107     ${@} >> ${LOGFILE} 2>&1
108    
109     local result=$?
110     eend ${result}
111    
112     # was qmake successful?
113     if [ ${result} -ne 0 ]; then
114     echo
115     eerror "Running qmake on \"${projprofile}\" has failed"
116     echo
117     eerror "This shouldn't happen - please send a bug report to bugs.gentoo.org"
118     echo
119     die "qmake failed on ${projprofile}"
120     fi
121    
122     return ${result}
123     }
124    
125     EXPORT_FUNCTIONS pkg_setup

  ViewVC Help
Powered by ViewVC 1.1.20