eclass/qt4-qt-copy.eclass: I HATE EPATCH KTHNXBAI.
[gentoo-soor-overlay.git] / x11-libs / qt-core / qt-core-4.4.0_rc1.ebuild
blob65d05c1ecd57e6ac126e6017a476ae9326c69114
1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
5 EAPI="1"
6 inherit qt4-qt-copy
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 )"
12 SLOT="4"
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}"
20 DEPEND="${RDEPEND}
21 dev-util/pkgconfig"
23 QT4_TARGET_DIRECTORIES="
24 src/tools/moc/
25 src/tools/rcc/
26 src/tools/uic/
27 src/corelib/
28 src/xml/
29 src/network/
30 src/plugins/codecs/"
31 QT4_EXTRACT_DIRECTORIES="
32 include/Qt/
33 include/QtCore/
34 include/QtNetwork/
35 include/QtScript/
36 include/QtXml/
37 src/plugins/plugins.pro
38 src/plugins/qpluginbase.pri
39 src/src.pro
40 src/3rdparty/des/
41 src/3rdparty/harfbuzz/
42 src/3rdparty/md4/
43 src/3rdparty/md5/
44 src/3rdparty/sha1/
45 src/script/
46 translations/"
48 pkg_setup() {
49 qt4-build_pkg_setup
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
66 local need_to_remove
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}"
73 done
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
78 local need_to_remove
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}"
85 done
86 if [[ -n ${need_to_remove} ]]; then
87 die "You must first uninstall these packages before continuing: \n\t\t${need_to_remove}"
93 src_unpack() {
94 use doc && QT4_EXTRACT_DIRECTORIES="${QT4_EXTRACT_DIRECTORIES}
95 doc/
96 tools/qdoc3/"
98 qt4-qt-copy_src_unpack
101 src_compile() {
102 unset QMAKESPEC
103 local myconf
105 myconf="${myconf}
106 $(qt_use glib)
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
115 -no-svg"
117 if ! use doc; then
118 myconf="${myconf} -nomake docs"
121 qt4-build_src_compile
124 src_install() {
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"
131 if use doc; then
132 emake INSTALL_ROOT="${D}" install_htmldocs || die "emake install_htmldocs failed."
135 emake INSTALL_ROOT="${D}" install_translations || die "emake install_translations failed"
137 fix_library_files
139 # List all the multilib libdirs
140 local libdirs
141 for libdir in $(get_all_libdirs); do
142 libdirs="${libdirs}:/usr/${libdir}/qt4"
143 done
145 cat <<-EOF > "${T}/44qt4"
146 LDPATH=${libdirs:1}
148 doenvd "${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."
158 if use glib; then
159 QCONFIG_DEFINE="$(use glib && echo QT_GLIB)
160 $(use ssl && echo QT_OPENSSL)"
161 install_qconfigs
164 keepdir "${QTSYSCONFDIR}"