| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/x11-libs/qt-gui/qt-gui-4.8.2.ebuild,v 1.12 2012/10/14 17:09:30 armin76 Exp $
|
| 4 |
|
| 5 |
EAPI=4
|
| 6 |
|
| 7 |
inherit eutils qt4-build
|
| 8 |
|
| 9 |
DESCRIPTION="The GUI module for the Qt toolkit"
|
| 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="+accessibility cups dbus egl gif +glib gtkstyle mng nas nis qt3support tiff trace xinerama +xv"
|
| 17 |
|
| 18 |
REQUIRED_USE="
|
| 19 |
gtkstyle? ( glib )
|
| 20 |
"
|
| 21 |
|
| 22 |
RDEPEND="
|
| 23 |
app-admin/eselect-qtgraphicssystem
|
| 24 |
media-libs/fontconfig
|
| 25 |
media-libs/freetype:2
|
| 26 |
media-libs/libpng:0
|
| 27 |
sys-libs/zlib
|
| 28 |
virtual/jpeg
|
| 29 |
~x11-libs/qt-core-${PV}[aqua=,c++0x=,qpa=,debug=,glib=,qt3support=]
|
| 30 |
~x11-libs/qt-script-${PV}[aqua=,c++0x=,qpa=,debug=]
|
| 31 |
!aqua? (
|
| 32 |
x11-libs/libICE
|
| 33 |
x11-libs/libSM
|
| 34 |
x11-libs/libX11
|
| 35 |
x11-libs/libXcursor
|
| 36 |
x11-libs/libXext
|
| 37 |
x11-libs/libXi
|
| 38 |
x11-libs/libXrandr
|
| 39 |
x11-libs/libXrender
|
| 40 |
xinerama? ( x11-libs/libXinerama )
|
| 41 |
xv? ( x11-libs/libXv )
|
| 42 |
)
|
| 43 |
cups? ( net-print/cups )
|
| 44 |
dbus? ( ~x11-libs/qt-dbus-${PV}[aqua=,c++0x=,qpa=,debug=] )
|
| 45 |
egl? ( media-libs/mesa[egl] )
|
| 46 |
gtkstyle? ( x11-libs/gtk+:2[aqua=] )
|
| 47 |
mng? ( >=media-libs/libmng-1.0.9 )
|
| 48 |
nas? ( >=media-libs/nas-1.5 )
|
| 49 |
tiff? ( media-libs/tiff:0 )
|
| 50 |
"
|
| 51 |
DEPEND="${RDEPEND}
|
| 52 |
!aqua? (
|
| 53 |
x11-proto/inputproto
|
| 54 |
x11-proto/xextproto
|
| 55 |
xinerama? ( x11-proto/xineramaproto )
|
| 56 |
xv? ( x11-proto/videoproto )
|
| 57 |
)
|
| 58 |
"
|
| 59 |
PDEPEND="qt3support? ( ~x11-libs/qt-qt3support-${PV}[aqua=,c++0x=,debug=,qpa=] )"
|
| 60 |
|
| 61 |
PATCHES=(
|
| 62 |
"${FILESDIR}/${PN}-4.7.3-cups.patch"
|
| 63 |
"${FILESDIR}/${PV}-qatomic-x32.patch"
|
| 64 |
)
|
| 65 |
|
| 66 |
pkg_setup() {
|
| 67 |
# this belongs to pkg_pretend, we have to upgrade to EAPI 4 :)
|
| 68 |
# was planning to use a dep, but to reproduce this you have to
|
| 69 |
# clean-emerge qt-gui[gtkstyle] while having cairo[qt4] installed.
|
| 70 |
# no need to restrict normal first time users for that :)
|
| 71 |
if use gtkstyle && ! has_version x11-libs/qt-gui && has_version x11-libs/cairo[qt4]; then
|
| 72 |
echo
|
| 73 |
eerror "When building qt-gui[gtkstyle] from scratch with cairo present,"
|
| 74 |
eerror "cairo must have the qt4 use flag disabled, otherwise the gtk"
|
| 75 |
eerror "style cannot be built."
|
| 76 |
ewarn
|
| 77 |
eerror "You have the following options:"
|
| 78 |
eerror " - rebuild cairo with -qt4 USE"
|
| 79 |
eerror " - build qt-gui with -gtkstyle USE"
|
| 80 |
ewarn
|
| 81 |
eerror "After you successfully install qt-gui, you'll be able to"
|
| 82 |
eerror "re-enable the disabled use flag and/or reinstall cairo."
|
| 83 |
ewarn
|
| 84 |
echo
|
| 85 |
die "can't build ${PN} with USE=gtkstyle if cairo has 'qt4' USE flag enabled"
|
| 86 |
fi
|
| 87 |
|
| 88 |
QT4_TARGET_DIRECTORIES="
|
| 89 |
src/gui
|
| 90 |
src/scripttools
|
| 91 |
tools/designer
|
| 92 |
tools/linguist/linguist
|
| 93 |
src/plugins/imageformats/gif
|
| 94 |
src/plugins/imageformats/ico
|
| 95 |
src/plugins/imageformats/jpeg
|
| 96 |
src/plugins/inputmethods"
|
| 97 |
|
| 98 |
QT4_EXTRACT_DIRECTORIES="
|
| 99 |
include
|
| 100 |
src
|
| 101 |
tools"
|
| 102 |
|
| 103 |
use accessibility && QT4_TARGET_DIRECTORIES="${QT4_TARGET_DIRECTORIES} src/plugins/accessible/widgets"
|
| 104 |
use dbus && QT4_TARGET_DIRECTORIES="${QT4_TARGET_DIRECTORIES} tools/qdbus/qdbusviewer"
|
| 105 |
use mng && QT4_TARGET_DIRECTORIES="${QT4_TARGET_DIRECTORIES} src/plugins/imageformats/mng"
|
| 106 |
use tiff && QT4_TARGET_DIRECTORIES="${QT4_TARGET_DIRECTORIES} src/plugins/imageformats/tiff"
|
| 107 |
use trace && QT4_TARGET_DIRECTORIES="${QT4_TARGET_DIRECTORIES} src/plugins/graphicssystems/trace"
|
| 108 |
|
| 109 |
# mac version does not contain qtconfig?
|
| 110 |
[[ ${CHOST} == *-darwin* ]] || QT4_TARGET_DIRECTORIES+=" tools/qtconfig"
|
| 111 |
|
| 112 |
QT4_EXTRACT_DIRECTORIES="${QT4_TARGET_DIRECTORIES} ${QT4_EXTRACT_DIRECTORIES}"
|
| 113 |
|
| 114 |
qt4-build_pkg_setup
|
| 115 |
}
|
| 116 |
|
| 117 |
src_prepare() {
|
| 118 |
qt4-build_src_prepare
|
| 119 |
|
| 120 |
# Add -xvideo to the list of accepted configure options
|
| 121 |
sed -i -e 's:|-xinerama|:&-xvideo|:' configure
|
| 122 |
|
| 123 |
# Don't build plugins this go around, because they depend on qt3support lib
|
| 124 |
sed -i -e 's:CONFIG(shared:# &:g' tools/designer/src/src.pro
|
| 125 |
}
|
| 126 |
|
| 127 |
src_configure() {
|
| 128 |
export PATH="${S}/bin:${PATH}"
|
| 129 |
export LD_LIBRARY_PATH="${S}/lib:${LD_LIBRARY_PATH}"
|
| 130 |
|
| 131 |
myconf="$(qt_use accessibility)
|
| 132 |
$(qt_use cups)
|
| 133 |
$(use gif || echo -no-gif)
|
| 134 |
$(qt_use glib)
|
| 135 |
$(qt_use mng libmng system)
|
| 136 |
$(qt_use nas nas-sound system)
|
| 137 |
$(qt_use nis)
|
| 138 |
$(qt_use tiff libtiff system)
|
| 139 |
$(qt_use dbus qdbus)
|
| 140 |
$(qt_use dbus)
|
| 141 |
$(qt_use egl)
|
| 142 |
$(qt_use qt3support)
|
| 143 |
$(qt_use gtkstyle)
|
| 144 |
$(qt_use xinerama)
|
| 145 |
$(qt_use xv xvideo)"
|
| 146 |
|
| 147 |
myconf+="
|
| 148 |
-system-libpng -system-libjpeg
|
| 149 |
-no-sql-mysql -no-sql-psql -no-sql-ibase -no-sql-sqlite -no-sql-sqlite2 -no-sql-odbc
|
| 150 |
-sm -xshape -xsync -xcursor -xfixes -xrandr -xrender -mitshm -xinput -xkb
|
| 151 |
-fontconfig -no-svg -no-webkit -no-phonon -no-opengl"
|
| 152 |
|
| 153 |
[[ ${CHOST} == *86*-apple-darwin* ]] && myconf+=" -no-ssse3" #367045
|
| 154 |
|
| 155 |
qt4-build_src_configure
|
| 156 |
|
| 157 |
if use gtkstyle; then
|
| 158 |
einfo "patching the Makefile to fix qgtkstyle compilation"
|
| 159 |
sed "s:-I/usr/include/qt4 ::" -i src/gui/Makefile ||
|
| 160 |
die "sed failed"
|
| 161 |
fi
|
| 162 |
sed -i -e "s:-I/usr/include/qt4/QtGui ::" src/gui/Makefile || die "sed failed"
|
| 163 |
}
|
| 164 |
|
| 165 |
src_install() {
|
| 166 |
QCONFIG_ADD="
|
| 167 |
mitshm x11sm xcursor xfixes xinput xkb xrandr xrender xshape xsync
|
| 168 |
fontconfig gif png system-png jpeg system-jpeg
|
| 169 |
$(usev accessibility)
|
| 170 |
$(usev cups)
|
| 171 |
$(use mng && echo system-mng)
|
| 172 |
$(usev nas)
|
| 173 |
$(usev nis)
|
| 174 |
$(use tiff && echo system-tiff)
|
| 175 |
$(usev xinerama)
|
| 176 |
$(use xv && echo xvideo)"
|
| 177 |
QCONFIG_REMOVE="no-gif no-jpeg no-png"
|
| 178 |
QCONFIG_DEFINE="$(use accessibility && echo QT_ACCESSIBILITY)
|
| 179 |
$(use cups && echo QT_CUPS)
|
| 180 |
$(use egl && echo QT_EGL)
|
| 181 |
QT_FONTCONFIG
|
| 182 |
$(use gtkstyle && echo QT_STYLE_GTK)
|
| 183 |
QT_IMAGEFORMAT_JPEG QT_IMAGEFORMAT_PNG
|
| 184 |
$(use mng && echo QT_IMAGEFORMAT_MNG)
|
| 185 |
$(use nas && echo QT_NAS)
|
| 186 |
$(use nis && echo QT_NIS)
|
| 187 |
$(use tiff && echo QT_IMAGEFORMAT_TIFF)
|
| 188 |
QT_SESSIONMANAGER QT_SHAPE QT_XCURSOR QT_XFIXES
|
| 189 |
$(use xinerama && echo QT_XINERAMA)
|
| 190 |
QT_XINPUT QT_XKB QT_XRANDR QT_XRENDER QT_XSYNC
|
| 191 |
$(use xv && echo QT_XVIDEO)"
|
| 192 |
|
| 193 |
qt4-build_src_install
|
| 194 |
|
| 195 |
# qt-creator
|
| 196 |
# some qt-creator headers are located
|
| 197 |
# under /usr/include/qt4/QtDesigner/private.
|
| 198 |
# those headers are just includes of the headers
|
| 199 |
# which are located under tools/designer/src/lib/*
|
| 200 |
# So instead of installing both, we create the private folder
|
| 201 |
# and drop tools/designer/src/lib/* headers in it.
|
| 202 |
if use aqua && [[ ${CHOST##*-darwin} -ge 9 ]]; then
|
| 203 |
insinto "${QTLIBDIR#${EPREFIX}}"/QtDesigner.framework/Headers/private/
|
| 204 |
else
|
| 205 |
insinto "${QTHEADERDIR#${EPREFIX}}"/QtDesigner/private/
|
| 206 |
fi
|
| 207 |
doins "${S}"/tools/designer/src/lib/shared/*
|
| 208 |
doins "${S}"/tools/designer/src/lib/sdk/*
|
| 209 |
|
| 210 |
# install private headers
|
| 211 |
if use aqua && [[ ${CHOST##*-darwin} -ge 9 ]]; then
|
| 212 |
insinto "${QTLIBDIR#${EPREFIX}}"/QtGui.framework/Headers/private/
|
| 213 |
else
|
| 214 |
insinto "${QTHEADERDIR#${EPREFIX}}"/QtGui/private
|
| 215 |
fi
|
| 216 |
find "${S}"/src/gui -type f -name '*_p.h' -exec doins {} +
|
| 217 |
|
| 218 |
if use aqua && [[ ${CHOST##*-darwin} -ge 9 ]]; then
|
| 219 |
# rerun to get links to headers right
|
| 220 |
fix_includes
|
| 221 |
fi
|
| 222 |
|
| 223 |
# touch the available graphics systems
|
| 224 |
dodir /usr/share/qt4/graphicssystems
|
| 225 |
echo "default" > "${ED}"/usr/share/qt4/graphicssystems/raster || die
|
| 226 |
touch "${ED}"/usr/share/qt4/graphicssystems/native || die
|
| 227 |
|
| 228 |
doicon tools/designer/src/designer/images/designer.png \
|
| 229 |
tools/linguist/linguist/images/icons/linguist-128-32.png
|
| 230 |
use dbus && doicon tools/qdbus/qdbusviewer/images/qdbusviewer-128.png
|
| 231 |
make_desktop_entry designer Designer designer 'Qt;Development;GUIDesigner'
|
| 232 |
make_desktop_entry linguist Linguist linguist-128-32 'Qt;Development;GUIDesigner'
|
| 233 |
}
|
| 234 |
|
| 235 |
pkg_postinst() {
|
| 236 |
# raster is the default graphicssystems, set it on first install
|
| 237 |
eselect qtgraphicssystem set raster --use-old
|
| 238 |
|
| 239 |
elog "Starting with Qt 4.8, you may choose the active Qt Graphics System"
|
| 240 |
elog "by using a new eselect module called qtgraphicssystem."
|
| 241 |
elog "Run \`eselect qtgraphicssystem\` for more information."
|
| 242 |
|
| 243 |
if use gtkstyle; then
|
| 244 |
# see bug 388551
|
| 245 |
elog "For Qt's GTK style to work, you need to either export"
|
| 246 |
elog "the following variable into your environment:"
|
| 247 |
elog ' GTK2_RC_FILES="$HOME/.gtkrc-2.0"'
|
| 248 |
elog "or alternatively install gnome-base/libgnomeui"
|
| 249 |
fi
|
| 250 |
}
|