/[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.151 Revision 1.159
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2015 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.151 2013/10/14 17:24:36 pesa Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.159 2015/03/06 14:08:07 dlan Exp $
4 4
5# @ECLASS: qt4-build.eclass 5# @ECLASS: qt4-build.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Qt herd <qt@gentoo.org> 7# Qt herd <qt@gentoo.org>
8# @BLURB: Eclass for Qt4 split ebuilds. 8# @BLURB: Eclass for Qt4 split ebuilds.
12case ${EAPI} in 12case ${EAPI} in
13 4|5) : ;; 13 4|5) : ;;
14 *) die "qt4-build.eclass: unsupported EAPI=${EAPI:-0}" ;; 14 *) die "qt4-build.eclass: unsupported EAPI=${EAPI:-0}" ;;
15esac 15esac
16 16
17inherit eutils flag-o-matic multilib toolchain-funcs versionator 17inherit eutils flag-o-matic multilib toolchain-funcs
18 18
19if [[ ${PV} == *9999* ]]; then 19HOMEPAGE="https://www.qt.io/ https://qt-project.org/"
20 QT4_BUILD_TYPE="live"
21 inherit git-r3
22else
23 QT4_BUILD_TYPE="release"
24fi
25
26HOMEPAGE="http://qt-project.org/ http://qt.digia.com/"
27LICENSE="|| ( LGPL-2.1 GPL-3 )" 20LICENSE="|| ( LGPL-2.1 GPL-3 )"
21SLOT="4"
28 22
29MY_PV=${PV/_/-} 23case ${PV} in
30MY_P=qt-everywhere-opensource-src-${MY_PV} 24 4.?.9999)
31 25 QT4_BUILD_TYPE="live"
32case ${QT4_BUILD_TYPE} in
33 live)
34 EGIT_REPO_URI=( 26 EGIT_REPO_URI=(
35 "git://gitorious.org/qt/qt.git" 27 "git://gitorious.org/qt/qt.git"
36 "https://git.gitorious.org/qt/qt.git" 28 "https://git.gitorious.org/qt/qt.git"
37 ) 29 )
38 EGIT_BRANCH=${PV%.9999} 30 EGIT_BRANCH=${PV%.9999}
31 inherit git-r3
39 ;; 32 ;;
40 release) 33 *)
34 QT4_BUILD_TYPE="release"
35 MY_P=qt-everywhere-opensource-src-${PV/_/-}
41 SRC_URI="http://download.qt-project.org/official_releases/qt/${PV%.*}/${PV}/${MY_P}.tar.gz" 36 SRC_URI="http://download.qt.io/archive/qt/${PV%.*}/${PV}/${MY_P}.tar.gz"
37 S=${WORKDIR}/${MY_P}
42 ;; 38 ;;
43esac 39esac
44 40
45IUSE="aqua debug pch" 41IUSE="aqua debug pch"
46[[ ${CATEGORY}/${PN} != dev-qt/qtwebkit ]] && IUSE+=" c++0x"
47[[ ${CATEGORY}/${PN} != dev-qt/qtxmlpatterns ]] && IUSE+=" +exceptions" 42[[ ${PN} != qtxmlpatterns ]] && IUSE+=" +exceptions"
48 43
49DEPEND="virtual/pkgconfig" 44DEPEND="virtual/pkgconfig"
50if [[ ${QT4_BUILD_TYPE} == live ]]; then 45if [[ ${QT4_BUILD_TYPE} == live ]]; then
51 DEPEND+=" dev-lang/perl" 46 DEPEND+=" dev-lang/perl"
52fi 47fi
53 48
54S=${WORKDIR}/${MY_P}
55
56# @FUNCTION: qt4-build_pkg_setup 49# @FUNCTION: qt4-build_pkg_setup
57# @DESCRIPTION: 50# @DESCRIPTION:
58# Sets up PATH and LD_LIBRARY_PATH. 51# Sets up PATH and LD_LIBRARY_PATH.
59qt4-build_pkg_setup() { 52qt4-build_pkg_setup() {
60 # Protect users by not allowing downgrades between releases. 53 # Warn users of possible breakage when downgrading to a previous release.
61 # Downgrading revisions within the same release should be allowed. 54 # Downgrading revisions within the same release is safe.
62 if has_version ">${CATEGORY}/${P}-r9999:4"; then 55 if has_version ">${CATEGORY}/${P}-r9999:4"; then
63 if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then 56 ewarn
64 eerror " *** Sanity check to keep you from breaking your system ***"
65 eerror "Downgrading Qt is completely unsupported and will break your system!"
66 die "aborting to save your system"
67 else
68 ewarn "Downgrading Qt is completely unsupported and will break your system!" 57 ewarn "Downgrading Qt is completely unsupported and can break your system!"
69 fi 58 ewarn
70 fi 59 fi
71 60
72 PATH="${S}/bin${PATH:+:}${PATH}" 61 PATH="${S}/bin${PATH:+:}${PATH}"
73 if [[ ${CHOST} != *-darwin* ]]; then 62 if [[ ${CHOST} != *-darwin* ]]; then
74 LD_LIBRARY_PATH="${S}/lib${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}" 63 LD_LIBRARY_PATH="${S}/lib${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}"
81 QT4_EXTRACT_DIRECTORIES="src/gui/kernel/qapplication_mac.mm 70 QT4_EXTRACT_DIRECTORIES="src/gui/kernel/qapplication_mac.mm
82 ${QT4_EXTRACT_DIRECTORIES}" 71 ${QT4_EXTRACT_DIRECTORIES}"
83 fi 72 fi
84} 73}
85 74
75# @ECLASS-VARIABLE: PATCHES
76# @DEFAULT_UNSET
77# @DESCRIPTION:
78# Array variable containing all the patches to be applied. This variable
79# is expected to be defined in the global scope of ebuilds. Make sure to
80# specify the full path. This variable is used in src_prepare phase.
81#
82# Example:
83# @CODE
84# PATCHES=(
85# "${FILESDIR}/mypatch.patch"
86# "${FILESDIR}/patches_folder/"
87# )
88# @CODE
89
86# @ECLASS-VARIABLE: QT4_EXTRACT_DIRECTORIES 90# @ECLASS-VARIABLE: QT4_EXTRACT_DIRECTORIES
87# @DEFAULT_UNSET 91# @DEFAULT_UNSET
88# @DESCRIPTION: 92# @DESCRIPTION:
89# Space-separated list including the directories that will be extracted from 93# Space-separated list of directories that will be extracted
90# Qt tarball. 94# from Qt tarball.
91 95
92# @ECLASS-VARIABLE: QT4_TARGET_DIRECTORIES 96# @ECLASS-VARIABLE: QT4_TARGET_DIRECTORIES
93# @DEFAULT_UNSET 97# @DEFAULT_UNSET
94# @DESCRIPTION: 98# @DESCRIPTION:
95# Arguments for build_target_directories. Takes the directories in which the 99# Space-separated list of directories that will be configured,
96# code should be compiled. This is a space-separated list. 100# compiled, and installed. All paths must be relative to ${S}.
97 101
98# @FUNCTION: qt4-build_src_unpack 102# @FUNCTION: qt4-build_src_unpack
99# @DESCRIPTION: 103# @DESCRIPTION:
100# Unpacks the sources. 104# Unpacks the sources.
101qt4-build_src_unpack() { 105qt4-build_src_unpack() {
102 setqtenv 106 setqtenv
103 107
104 if ! version_is_at_least 4.1 $(gcc-version); then 108 if [[ $(gcc-major-version) -lt 4 ]] || [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 4 ]]; then
109 ewarn
105 ewarn "Using a GCC version lower than 4.1 is not supported." 110 ewarn "Using a GCC version lower than 4.4 is not supported."
106 elif use_if_iuse c++0x && ! version_is_at_least 4.4 $(gcc-version); then 111 ewarn
107 ewarn "USE=c++0x requires GCC 4.4 or later."
108 fi 112 fi
109 113
110 if [[ ${CATEGORY}/${PN} == dev-qt/qtwebkit ]]; then 114 if [[ ${PN} == qtwebkit ]]; then
111 eshopts_push -s extglob 115 eshopts_push -s extglob
112 if is-flagq '-g?(gdb)?([1-9])'; then 116 if is-flagq '-g?(gdb)?([1-9])'; then
113 echo 117 ewarn
114 ewarn "You have enabled debug info (probably have -g or -ggdb in your CFLAGS/CXXFLAGS)." 118 ewarn "You have enabled debug info (probably have -g or -ggdb in your CFLAGS/CXXFLAGS)."
115 ewarn "You may experience really long compilation times and/or increased memory usage." 119 ewarn "You may experience really long compilation times and/or increased memory usage."
116 ewarn "If compilation fails, please try removing -g/-ggdb before reporting a bug." 120 ewarn "If compilation fails, please try removing -g/-ggdb before reporting a bug."
117 ewarn "For more info check out https://bugs.gentoo.org/307861" 121 ewarn "For more info check out https://bugs.gentoo.org/307861"
118 echo 122 ewarn
119 fi 123 fi
120 eshopts_pop 124 eshopts_pop
121 fi 125 fi
122 126
123 case ${QT4_BUILD_TYPE} in 127 case ${QT4_BUILD_TYPE} in
138 eend $? || die "failed to unpack" 142 eend $? || die "failed to unpack"
139 ;; 143 ;;
140 esac 144 esac
141} 145}
142 146
143# @ECLASS-VARIABLE: PATCHES
144# @DEFAULT_UNSET
145# @DESCRIPTION:
146# PATCHES array variable containing all various patches to be applied.
147# This variable is expected to be defined in global scope of ebuild.
148# Make sure to specify the full path. This variable is utilised in
149# src_prepare() phase.
150#
151# @CODE
152# PATCHES=( "${FILESDIR}/mypatch.patch"
153# "${FILESDIR}/patches_folder/" )
154# @CODE
155
156# @FUNCTION: qt4-build_src_prepare 147# @FUNCTION: qt4-build_src_prepare
157# @DESCRIPTION: 148# @DESCRIPTION:
158# Prepare the sources before the configure phase. Strip CFLAGS if necessary, and fix 149# Prepare the sources before the configure phase. Strip CFLAGS if necessary, and fix
159# the build system in order to respect CFLAGS/CXXFLAGS/LDFLAGS specified in make.conf. 150# the build system in order to respect CFLAGS/CXXFLAGS/LDFLAGS specified in make.conf.
160qt4-build_src_prepare() { 151qt4-build_src_prepare() {
163 if [[ ${QT4_BUILD_TYPE} == live ]]; then 154 if [[ ${QT4_BUILD_TYPE} == live ]]; then
164 QTDIR="." ./bin/syncqt || die "syncqt failed" 155 QTDIR="." ./bin/syncqt || die "syncqt failed"
165 fi 156 fi
166 157
167 # avoid X11 dependency in non-gui packages 158 # avoid X11 dependency in non-gui packages
168 local nolibx11_pkgs="qtcore qtdbus qtscript qtsql qttest qtxmlpatterns" 159 local nolibx11_pkgs="qtbearer qtcore qtdbus qtscript qtsql qttest qtxmlpatterns"
169 has ${PN} ${nolibx11_pkgs} && qt_nolibx11 160 has ${PN} ${nolibx11_pkgs} && qt_nolibx11
170 161
171 if use aqua; then 162 if use aqua; then
172 # provide a proper macx-g++-64 163 # provide a proper macx-g++-64
173 use x64-macos && ln -s macx-g++ mkspecs/$(qt_mkspecs_dir) 164 use x64-macos && ln -s macx-g++ mkspecs/$(qt_mkspecs_dir)
332 ppc-macos) conf+=" -arch ppc" ;; 323 ppc-macos) conf+=" -arch ppc" ;;
333 ppc|ppc64|ppc-*) conf+=" -arch powerpc" ;; 324 ppc|ppc64|ppc-*) conf+=" -arch powerpc" ;;
334 sparc|sparc-*|sparc64-*) conf+=" -arch sparc" ;; 325 sparc|sparc-*|sparc64-*) conf+=" -arch sparc" ;;
335 x86-macos) conf+=" -arch x86" ;; 326 x86-macos) conf+=" -arch x86" ;;
336 x86|x86-*) conf+=" -arch i386" ;; 327 x86|x86-*) conf+=" -arch i386" ;;
337 alpha|arm|ia64|mips|s390) conf+=" -arch $(tc-arch)" ;; 328 alpha|arm|arm64|ia64|mips|s390) conf+=" -arch $(tc-arch)" ;;
338 hppa|sh) conf+=" -arch generic" ;; 329 hppa|sh) conf+=" -arch generic" ;;
339 *) die "$(tc-arch) is unsupported by this eclass. Please file a bug." ;; 330 *) die "$(tc-arch) is unsupported by this eclass. Please file a bug." ;;
340 esac 331 esac
341 332
342 conf+=" -platform $(qt_mkspecs_dir)" 333 conf+=" -platform $(qt_mkspecs_dir)"

Legend:
Removed from v.1.151  
changed lines
  Added in v.1.159

  ViewVC Help
Powered by ViewVC 1.1.20