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

Diff of /eclass/qt4-build.eclass

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

Revision 1.20 Revision 1.25
1# Copyright 2007-2009 Gentoo Foundation 1# Copyright 2007-2009 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/qt4-build.eclass,v 1.20 2009/02/11 21:14:59 yngwin Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.25 2009/03/04 20:37:08 yngwin Exp $
4 4
5# @ECLASS: qt4-build.eclass 5# @ECLASS: qt4-build.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Ben de Groot <yngwin@gentoo.org> 7# Ben de Groot <yngwin@gentoo.org>,
8# Markos Chandras <hwoarang@gentoo.org> 8# Markos Chandras <hwoarang@gentoo.org>,
9# Caleb Tennis <caleb@gentoo.org> 9# Caleb Tennis <caleb@gentoo.org>
10# @BLURB: Eclass for Qt4 split ebuilds. 10# @BLURB: Eclass for Qt4 split ebuilds.
11# @DESCRIPTION: 11# @DESCRIPTION:
12# This eclass contains various functions that are used when building Qt4 12# This eclass contains various functions that are used when building Qt4
13 13
27esac 27esac
28MY_P=qt-x11-${SRCTYPE}-${MY_PV} 28MY_P=qt-x11-${SRCTYPE}-${MY_PV}
29S=${WORKDIR}/${MY_P} 29S=${WORKDIR}/${MY_P}
30 30
31HOMEPAGE="http://www.qtsoftware.com/" 31HOMEPAGE="http://www.qtsoftware.com/"
32SRC_URI="ftp://ftp.trolltech.com/qt/source/${MY_P}.tar.bz2" 32SRC_URI="http://download.qtsoftware.com/qt/source/${MY_P}.tar.bz2"
33 33
34case "${PV}" in 34case "${PV}" in
35 4.4.?) SRC_URI="${SRC_URI} mirror://gentoo/${MY_P}-headers.tar.bz2" ;; 35 4.4.?) SRC_URI="${SRC_URI} mirror://gentoo/${MY_P}-headers.tar.bz2" ;;
36 *) ;; 36 *) ;;
37esac 37esac
38
39if version_is_at_least 4.5 ${PV} ; then
40 LICENSE="|| ( LGPL-2.1 GPL-3 )"
41fi
38 42
39qt4-build_pkg_setup() { 43qt4-build_pkg_setup() {
40 # EAPI=2 ebuilds set use-deps, others need this: 44 # EAPI=2 ebuilds set use-deps, others need this:
41 if [[ $EAPI != 2 ]]; then 45 if [[ $EAPI != 2 ]]; then
42 # Make sure debug setting corresponds with qt-core (bug 258512) 46 # Make sure debug setting corresponds with qt-core (bug 258512)
72 if ! version_is_at_least 4.1 $(gcc-version) ; then 76 if ! version_is_at_least 4.1 $(gcc-version) ; then
73 ewarn "Using a GCC version lower than 4.1 is not supported!" 77 ewarn "Using a GCC version lower than 4.1 is not supported!"
74 echo 78 echo
75 ebeep 5 79 ebeep 5
76 fi 80 fi
77}
78 81
79qt4-build_src_unpack() {
80 local target targets
81 for target in configure LICENSE.{GPL2,GPL3} projects.pro \
82 src/{qbase,qt_targets,qt_install}.pri bin config.tests mkspecs qmake \
83 ${QT4_EXTRACT_DIRECTORIES}; do
84 targets="${targets} ${MY_P}/${target}"
85 done
86
87 echo tar xjpf "${DISTDIR}"/${MY_P}.tar.bz2 ${targets}
88 tar xjpf "${DISTDIR}"/${MY_P}.tar.bz2 ${targets}
89
90 case "${PV}" in
91 4.4.?)
92 echo tar xjpf "${DISTDIR}"/${MY_P}-headers.tar.bz2
93 tar xjpf "${DISTDIR}"/${MY_P}-headers.tar.bz2
94 ;;
95 esac
96
97 # Be backwards compatible for now
98 if [[ $EAPI != 2 ]]; then
99 qt4-build_src_prepare
100 fi
101}
102
103qt4-build_src_prepare() {
104 cd "${S}"
105
106 if [[ ${PN} != qt-core ]]; then
107 skip_qmake_build_patch
108 skip_project_generation_patch
109 symlink_binaries_to_buildtree
110 fi
111
112 # Bug 253127
113 if [[ $(gcc-major-version) -lt "4" ]] ; then
114 sed -e "/^QMAKE_CFLAGS\t/ s:$: -fno-stack-protector-all:" \
115 -i "${S}"/mkspecs/common/g++.conf || die "sed ${S}/mkspecs/common/g++.conf failed"
116 fi
117
118 sed -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \
119 -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \
120 -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=${LDFLAGS}:" \
121 -e "s:X11R6/::" \
122 -i "${S}"/mkspecs/$(qt_mkspecs_dir)/qmake.conf || die "sed ${S}/mkspecs/$(qt_mkspecs_dir)/qmake.conf failed"
123
124 sed -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \
125 -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \
126 -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=${LDFLAGS}:" \
127 -i "${S}"/mkspecs/common/g++.conf || die "sed ${S}/mkspecs/common/g++.conf failed"
128}
129
130qt4-build_src_configure() {
131 if use custom-cxxflags; then 82 if use custom-cxxflags; then
132 echo 83 echo
133 ewarn "You have set USE=custom-cxxflags, which means Qt will be built with the" 84 ewarn "You have set USE=custom-cxxflags, which means Qt will be built with the"
134 ewarn "CXXFLAGS you have set in /etc/make.conf. This is not supported, and we" 85 ewarn "CXXFLAGS you have set in /etc/make.conf. This is not supported, and we"
135 ewarn "recommend to unset this useflag. But you are free to experiment with it." 86 ewarn "recommend to unset this useflag. But you are free to experiment with it."
136 ewarn "Just do not start crying if it breaks your system, or eats your kitten" 87 ewarn "Just do not start crying if it breaks your system, or eats your kitten"
137 ewarn "for breakfast. ;-) " 88 ewarn "for breakfast. ;-) "
138 echo 89 echo
139 else 90 fi
91
92}
93
94qt4-build_src_unpack() {
95 local target targets
96 for target in configure LICENSE.{GPL2,GPL3} projects.pro \
97 src/{qbase,qt_targets,qt_install}.pri bin config.tests mkspecs qmake \
98 ${QT4_EXTRACT_DIRECTORIES}; do
99 targets="${targets} ${MY_P}/${target}"
100 done
101
102 echo tar xjpf "${DISTDIR}"/${MY_P}.tar.bz2 ${targets}
103 tar xjpf "${DISTDIR}"/${MY_P}.tar.bz2 ${targets}
104
105 case "${PV}" in
106 4.4.?)
107 echo tar xjpf "${DISTDIR}"/${MY_P}-headers.tar.bz2
108 tar xjpf "${DISTDIR}"/${MY_P}-headers.tar.bz2
109 ;;
110 esac
111
112 # Be backwards compatible for now
113 if [[ $EAPI != 2 ]]; then
114 qt4-build_src_prepare
115 fi
116}
117
118qt4-build_src_prepare() {
119 cd "${S}"
120
121 if [[ ${PN} != qt-core ]]; then
122 skip_qmake_build_patch
123 skip_project_generation_patch
124 symlink_binaries_to_buildtree
125 fi
126
127 if ! use custom-cxxflags;then
140 # Don't let the user go too overboard with flags. 128 # Don't let the user go too overboard with flags.
141 strip-flags 129 strip-flags
142 replace-flags -O3 -O2 130 replace-flags -O3 -O2
143 fi 131 fi
144 132
133 # Bug 253127
145 # Unsupported old gcc versions - hardened needs this :( 134 # Unsupported old gcc versions - hardened needs this :(
146 if [[ $(gcc-major-version) -lt "4" ]] ; then 135 if [[ $(gcc-major-version) -lt "4" ]] ; then
147 ewarn "Appending -fno-stack-protector to CXXFLAGS" 136 ewarn "Appending -fno-stack-protector to CXXFLAGS"
148 append-cxxflags -fno-stack-protector 137 append-cxxflags -fno-stack-protector
149 fi 138 fi
151 # Bug 178652 140 # Bug 178652
152 if [[ "$(gcc-major-version)" == "3" ]] && use amd64; then 141 if [[ "$(gcc-major-version)" == "3" ]] && use amd64; then
153 ewarn "Appending -fno-gcse to CFLAGS/CXXFLAGS" 142 ewarn "Appending -fno-gcse to CFLAGS/CXXFLAGS"
154 append-flags -fno-gcse 143 append-flags -fno-gcse
155 fi 144 fi
145
146 # Bug 172219
147 sed -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \
148 -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \
149 -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=${LDFLAGS}:" \
150 -e "s:X11R6/::" \
151 -i "${S}"/mkspecs/$(qt_mkspecs_dir)/qmake.conf || die "sed ${S}/mkspecs/$(qt_mkspecs_dir)/qmake.conf failed"
152
153 sed -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \
154 -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \
155 -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=${LDFLAGS}:" \
156 -i "${S}"/mkspecs/common/g++.conf || die "sed ${S}/mkspecs/common/g++.conf failed"
157
158}
159
160qt4-build_src_configure() {
156 161
157 myconf="$(standard_configure_options) ${myconf}" 162 myconf="$(standard_configure_options) ${myconf}"
158 163
159 echo ./configure ${myconf} 164 echo ./configure ${myconf}
160 ./configure ${myconf} || die "./configure failed" 165 ./configure ${myconf} || die "./configure failed"

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.25

  ViewVC Help
Powered by ViewVC 1.1.20