1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
8 DESCRIPTION
="The Qt toolkit is a comprehensive C++ application development framework."
9 HOMEPAGE
="http://www.trolltech.com/"
11 LICENSE
="|| ( QPL-1.0 GPL-3 GPL-2 )"
13 KEYWORDS
="~amd64 ~x86"
14 IUSE
="doc glib +qt3support ssl"
16 RDEPEND
="sys-libs/zlib
17 glib? ( dev-libs/glib )
18 ssl? ( dev-libs/openssl )
19 !<=x11-libs/qt-4.4.0_alpha:${SLOT}"
23 QT4_TARGET_DIRECTORIES
="
31 QT4_EXTRACT_DIRECTORIES
="
37 src/plugins/plugins.pro
38 src/plugins/qpluginbase.pri
41 src/3rdparty/harfbuzz/
51 if has_version x11-libs
/qt-core
; then
52 # Check to see if they've changed the glib flag since the last time installing this package.
54 if use glib
&& ! built_with_use x11-libs
/qt-core glib
&& has_version x11-libs
/qt-gui
; then
55 ewarn
"You have changed the \"glib\" use flag since the last time you have emerged this package."
56 ewarn
"You should also re-emerge x11-libs/qt-gui in order for it to pick up this change."
57 elif ! use glib
&& built_with_use x11-libs
/qt-core glib
&& has_version x11-libs
/qt-gui
; then
58 ewarn
"You have changed the \"glib\" use flag since the last time you have emerged this package."
59 ewarn
"You should also re-emerge x11-libs/qt-gui in order for it to pick up this change."
62 # Check to see if they've changed the qt3support flag since the last time installing this package.
63 # If so, give a list of packages they need to uninstall first.
65 if use qt3support
&& ! built_with_use x11-libs
/qt-core qt3support
; then
67 ewarn
"You have changed the \"qt3support\" use flag since the last time you have emerged this package."
68 for x
in sql opengl gui qt3support
; do
69 local pkg
="x11-libs/qt-${x}"
70 if has_version
$pkg; then
71 need_to_remove
="${need_to_remove} ${pkg}"
74 if [[ -n ${need_to_remove} ]]; then
75 die
"You must first uninstall these packages before continuing: \n\t\t${need_to_remove}"
77 elif ! use qt3support
&& built_with_use x11-libs
/qt-core qt3support
; then
79 ewarn
"You have changed the \"qt3support\" use flag since the last time you have emerged this package."
80 for x
in sql opengl gui qt3support
; do
81 local pkg
="x11-libs/qt-${x}"
82 if has_version
$pkg; then
83 need_to_remove
="${need_to_remove} ${pkg}"
86 if [[ -n ${need_to_remove} ]]; then
87 die
"You must first uninstall these packages before continuing: \n\t\t${need_to_remove}"
94 use doc
&& QT4_EXTRACT_DIRECTORIES
="${QT4_EXTRACT_DIRECTORIES}
98 qt4-qt-copy_src_unpack
107 $(qt_use ssl openssl)
108 $(qt_use qt3support)"
110 myconf
="${myconf} -no-xkb -no-tablet -no-fontconfig -no-xrender -no-xrandr
111 -no-xfixes -no-xcursor -no-xinerama -no-xshape -no-sm -no-opengl
112 -no-nas-sound -no-dbus -iconv -no-cups -no-nis -no-gif -no-libpng
113 -no-libmng -no-libjpeg -system-zlib -no-webkit -no-phonon -no-xmlpatterns
114 -no-freetype -no-libtiff -no-accessibility -no-fontconfig -no-opengl
118 myconf
="${myconf} -nomake docs"
121 qt4-build_src_compile
125 dobin
"${S}"/bin
/{qmake
,moc
,rcc
,uic
} || die
"dobin failed."
127 install_directories src
/{corelib
,xml
,network
,plugins
/codecs
}
129 emake INSTALL_ROOT
="${D}" install_mkspecs || die
"emake install_mkspecs failed"
132 emake INSTALL_ROOT
="${D}" install_htmldocs || die
"emake install_htmldocs failed."
135 emake INSTALL_ROOT
="${D}" install_translations || die
"emake install_translations failed"
139 # List all the multilib libdirs
141 for libdir
in $
(get_all_libdirs
); do
142 libdirs
="${libdirs}:/usr/${libdir}/qt4"
145 cat <<-EOF > "${T}/44qt4"
150 dodir
/${QTDATADIR}/mkspecs
/gentoo
151 mv "${D}"/${QTDATADIR}/mkspecs/qconfig.pri "${D}${QTDATADIR}"/mkspecs
/gentoo || \
152 die
"Failed to move qconfig.pri"
154 sed -i -e '2a#include <Gentoo/gentoo-qconfig.h>\n' \
155 "${D}${QTHEADERDIR}"/QtCore
/qconfig.h \
156 "${D}${QTHEADERDIR}"/Qt
/qconfig.h || die
"sed for qconfig.h failed."
159 QCONFIG_DEFINE
="$(use glib && echo QT_GLIB)
160 $(use ssl && echo QT_OPENSSL)"
164 keepdir
"${QTSYSCONFDIR}"