Line 0
Link Here
|
|
|
1 |
# Copyright 1999-2013 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/x11-libs/qt-core/qt-core-4.8.4-r1.ebuild,v 1.1 2013/01/03 15:30:58 kensington Exp $ |
4 |
|
5 |
EAPI=5 |
6 |
|
7 |
inherit qt4-build |
8 |
|
9 |
DESCRIPTION="The Qt toolkit is a comprehensive C++ application development framework" |
10 |
SLOT="4" |
11 |
if [[ ${QT4_BUILD_TYPE} == live ]]; then |
12 |
KEYWORDS="" |
13 |
else |
14 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" |
15 |
fi |
16 |
IUSE="+glib iconv icu qt3support ssl" |
17 |
|
18 |
DEPEND=" |
19 |
sys-libs/zlib |
20 |
glib? ( dev-libs/glib:2 ) |
21 |
icu? ( >=dev-libs/icu-49:= ) |
22 |
ssl? ( dev-libs/openssl ) |
23 |
!<x11-libs/cairo-1.10.2-r2 |
24 |
!x11-libs/qt:4 |
25 |
" |
26 |
RDEPEND="${DEPEND}" |
27 |
PDEPEND=" |
28 |
qt3support? ( ~x11-libs/qt-gui-${PV}[aqua=,debug=,glib=,qt3support] ) |
29 |
" |
30 |
|
31 |
PATCHES=( |
32 |
"${FILESDIR}/moc-workaround-for-boost-1.48.patch" |
33 |
"${FILESDIR}/qpropertyanimation-setProperty.patch" |
34 |
) |
35 |
|
36 |
pkg_setup() { |
37 |
QT4_TARGET_DIRECTORIES=" |
38 |
src/tools/bootstrap |
39 |
src/tools/moc |
40 |
src/tools/rcc |
41 |
src/tools/uic |
42 |
src/corelib |
43 |
src/xml |
44 |
src/network |
45 |
src/plugins/codecs |
46 |
tools/linguist/lconvert |
47 |
tools/linguist/lrelease |
48 |
tools/linguist/lupdate" |
49 |
|
50 |
QT4_EXTRACT_DIRECTORIES="${QT4_TARGET_DIRECTORIES} |
51 |
include/Qt |
52 |
include/QtCore |
53 |
include/QtDeclarative |
54 |
include/QtGui |
55 |
include/QtNetwork |
56 |
include/QtScript |
57 |
include/QtXml |
58 |
src/plugins/plugins.pro |
59 |
src/plugins/qpluginbase.pri |
60 |
src/src.pro |
61 |
src/3rdparty/des |
62 |
src/3rdparty/harfbuzz |
63 |
src/3rdparty/md4 |
64 |
src/3rdparty/md5 |
65 |
src/3rdparty/sha1 |
66 |
src/3rdparty/easing |
67 |
src/3rdparty/zlib_dependency.pri |
68 |
src/declarative |
69 |
src/gui |
70 |
src/script |
71 |
tools/shared |
72 |
tools/linguist/shared |
73 |
translations" |
74 |
|
75 |
qt4-build_pkg_setup |
76 |
} |
77 |
|
78 |
src_prepare() { |
79 |
# Don't pre-strip, bug 235026 |
80 |
for i in kr jp cn tw; do |
81 |
echo "CONFIG+=nostrip" >> "${S}"/src/plugins/codecs/${i}/${i}.pro |
82 |
done |
83 |
|
84 |
qt4-build_src_prepare |
85 |
|
86 |
# bug 172219 |
87 |
sed -i -e "s:CXXFLAGS.*=:CXXFLAGS=${CXXFLAGS} :" \ |
88 |
"${S}/qmake/Makefile.unix" || die "sed qmake/Makefile.unix CXXFLAGS failed" |
89 |
sed -i -e "s:LFLAGS.*=:LFLAGS=${LDFLAGS} :" \ |
90 |
"${S}/qmake/Makefile.unix" || die "sed qmake/Makefile.unix LDFLAGS failed" |
91 |
|
92 |
# bug 427782 |
93 |
sed -i -e "/^CPPFLAGS/s/-g//" \ |
94 |
"${S}/qmake/Makefile.unix" || die "sed qmake/Makefile.unix CPPFLAGS failed" |
95 |
sed -i -e "s/setBootstrapVariable QMAKE_CFLAGS_RELEASE/QMakeVar set QMAKE_CFLAGS_RELEASE/" \ |
96 |
-e "s/setBootstrapVariable QMAKE_CXXFLAGS_RELEASE/QMakeVar set QMAKE_CXXFLAGS_RELEASE/" \ |
97 |
"${S}/configure" || die "sed configure setBootstrapVariable failed" |
98 |
} |
99 |
|
100 |
src_configure() { |
101 |
myconf+=" |
102 |
-no-accessibility -no-xmlpatterns -no-multimedia -no-audio-backend -no-phonon |
103 |
-no-phonon-backend -no-svg -no-webkit -no-script -no-scripttools -no-declarative |
104 |
-system-zlib -no-gif -no-libtiff -no-libpng -no-libmng -no-libjpeg |
105 |
-no-cups -no-dbus -no-gtkstyle -no-nas-sound -no-opengl -no-openvg |
106 |
-no-sm -no-xshape -no-xvideo -no-xsync -no-xinerama -no-xcursor -no-xfixes |
107 |
-no-xrandr -no-xrender -no-mitshm -no-fontconfig -no-freetype -no-xinput -no-xkb |
108 |
$(qt_use glib) |
109 |
$(qt_use iconv) |
110 |
$(qt_use icu) |
111 |
$(use ssl && echo -openssl-linked || echo -no-openssl) |
112 |
$(qt_use qt3support)" |
113 |
|
114 |
qt4-build_src_configure |
115 |
} |
116 |
|
117 |
src_install() { |
118 |
dobin bin/{qmake,moc,rcc,uic,lconvert,lrelease,lupdate} |
119 |
|
120 |
install_directories src/{corelib,xml,network,plugins/codecs} |
121 |
|
122 |
emake INSTALL_ROOT="${D}" install_mkspecs |
123 |
|
124 |
# install private headers |
125 |
insinto "${QTHEADERDIR#${EPREFIX}}"/QtCore/private |
126 |
find "${S}"/src/corelib -type f -name "*_p.h" -exec doins {} + |
127 |
|
128 |
# use freshly built libraries |
129 |
local DYLD_FPATH= |
130 |
[[ -d "${S}"/lib/QtCore.framework ]] \ |
131 |
&& DYLD_FPATH=$(for x in "${S}"/lib/*.framework; do echo -n ":$x"; done) |
132 |
DYLD_LIBRARY_PATH="${S}/lib${DYLD_FPATH}" \ |
133 |
LD_LIBRARY_PATH="${S}/lib" \ |
134 |
"${S}"/bin/lrelease translations/*.ts \ |
135 |
|| die "generating translations failed" |
136 |
insinto "${QTTRANSDIR#${EPREFIX}}" |
137 |
doins translations/*.qm |
138 |
|
139 |
setqtenv |
140 |
fix_library_files |
141 |
|
142 |
# List all the multilib libdirs |
143 |
local libdirs= |
144 |
for libdir in $(get_all_libdirs); do |
145 |
libdirs+=":${EPREFIX}/usr/${libdir}/qt4" |
146 |
done |
147 |
|
148 |
cat <<-EOF > "${T}"/44qt4 |
149 |
LDPATH="${libdirs:1}" |
150 |
EOF |
151 |
doenvd "${T}"/44qt4 |
152 |
|
153 |
dodir "${QTDATADIR#${EPREFIX}}"/mkspecs/gentoo |
154 |
mv "${D}/${QTDATADIR}"/mkspecs/qconfig.pri "${D}${QTDATADIR}"/mkspecs/gentoo \ |
155 |
|| die "failed to move qconfig.pri" |
156 |
|
157 |
# Framework hacking |
158 |
if use aqua && [[ ${CHOST#*-darwin} -ge 9 ]]; then |
159 |
# TODO: do this better |
160 |
sed -i -e '2a#include <QtCore/Gentoo/gentoo-qconfig.h>\n' \ |
161 |
"${D}${QTLIBDIR}"/QtCore.framework/Headers/qconfig.h \ |
162 |
|| die "sed for qconfig.h failed." |
163 |
dosym "${QTHEADERDIR#${EPREFIX}}"/Gentoo "${QTLIBDIR#${EPREFIX}}"/QtCore.framework/Headers/Gentoo |
164 |
else |
165 |
sed -i -e '2a#include <Gentoo/gentoo-qconfig.h>\n' \ |
166 |
"${D}${QTHEADERDIR}"/QtCore/qconfig.h \ |
167 |
"${D}${QTHEADERDIR}"/Qt/qconfig.h \ |
168 |
|| die "sed for qconfig.h failed" |
169 |
fi |
170 |
|
171 |
QCONFIG_DEFINE="QT_ZLIB" |
172 |
install_qconfigs |
173 |
|
174 |
# remove .la files |
175 |
prune_libtool_files |
176 |
|
177 |
keepdir "${QTSYSCONFDIR#${EPREFIX}}" |
178 |
|
179 |
# Framework magic |
180 |
fix_includes |
181 |
} |