| 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/gtk+/gtk+-3.4.4.ebuild,v 1.13 2012/12/06 06:13:35 tetromino Exp $
|
| 4 |
|
| 5 |
EAPI="4"
|
| 6 |
|
| 7 |
inherit autotools eutils flag-o-matic gnome.org gnome2-utils multilib virtualx
|
| 8 |
|
| 9 |
DESCRIPTION="Gimp ToolKit +"
|
| 10 |
HOMEPAGE="http://www.gtk.org/"
|
| 11 |
|
| 12 |
LICENSE="LGPL-2+"
|
| 13 |
SLOT="3"
|
| 14 |
# NOTE: This gtk+ has multi-gdk-backend support, see:
|
| 15 |
# * http://blogs.gnome.org/kris/2010/12/29/gdk-3-0-on-mac-os-x/
|
| 16 |
# * http://mail.gnome.org/archives/gtk-devel-list/2010-November/msg00099.html
|
| 17 |
# I tried this and got it all compiling, but the end result is unusable as it
|
| 18 |
# horribly mixes up the backends -- grobian
|
| 19 |
IUSE="aqua colord cups debug examples +introspection packagekit test vim-syntax wayland X xinerama"
|
| 20 |
REQUIRED_USE="
|
| 21 |
|| ( aqua wayland X )
|
| 22 |
xinerama? ( X )"
|
| 23 |
|
| 24 |
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
|
| 25 |
|
| 26 |
# FIXME: introspection data is built against system installation of gtk+:3
|
| 27 |
# NOTE: cairo[svg] dep is due to bug 291283 (not patched to avoid eautoreconf)
|
| 28 |
# Use gtk+:2 for gtk-update-icon-cache
|
| 29 |
COMMON_DEPEND="X? (
|
| 30 |
x11-libs/libXrender
|
| 31 |
x11-libs/libX11
|
| 32 |
>=x11-libs/libXi-1.3
|
| 33 |
x11-libs/libXt
|
| 34 |
x11-libs/libXext
|
| 35 |
>=x11-libs/libXrandr-1.3
|
| 36 |
x11-libs/libXcursor
|
| 37 |
x11-libs/libXfixes
|
| 38 |
x11-libs/libXcomposite
|
| 39 |
x11-libs/libXdamage
|
| 40 |
xinerama? ( x11-libs/libXinerama )
|
| 41 |
)
|
| 42 |
wayland? (
|
| 43 |
dev-libs/wayland
|
| 44 |
media-libs/mesa[egl,wayland]
|
| 45 |
x11-libs/cairo[opengl]
|
| 46 |
x11-libs/libxkbcommon
|
| 47 |
)
|
| 48 |
>=dev-libs/glib-2.32
|
| 49 |
>=x11-libs/pango-1.30[introspection?]
|
| 50 |
>=dev-libs/atk-2.2[introspection?]
|
| 51 |
>=x11-libs/cairo-1.10.0[aqua?,glib,svg,X?]
|
| 52 |
>=x11-libs/gdk-pixbuf-2.26:2[introspection?,X?]
|
| 53 |
>=x11-libs/gtk+-2.24:2
|
| 54 |
media-libs/fontconfig
|
| 55 |
x11-misc/shared-mime-info
|
| 56 |
colord? ( >=x11-misc/colord-0.1.9 )
|
| 57 |
cups? ( >=net-print/cups-1.2 )
|
| 58 |
introspection? ( >=dev-libs/gobject-introspection-1.32 )"
|
| 59 |
DEPEND="${COMMON_DEPEND}
|
| 60 |
virtual/pkgconfig
|
| 61 |
X? (
|
| 62 |
x11-proto/xextproto
|
| 63 |
x11-proto/xproto
|
| 64 |
x11-proto/inputproto
|
| 65 |
x11-proto/damageproto
|
| 66 |
xinerama? ( x11-proto/xineramaproto )
|
| 67 |
)
|
| 68 |
>=dev-libs/gobject-introspection-common-1.32
|
| 69 |
>=dev-util/gtk-doc-am-1.11
|
| 70 |
test? (
|
| 71 |
media-fonts/font-misc-misc
|
| 72 |
media-fonts/font-cursor-misc )"
|
| 73 |
# gtk+-3.2.2 breaks Alt key handling in <=x11-libs/vte-0.30.1:2.90
|
| 74 |
# gtk+-3.3.18 breaks scrolling in <=x11-libs/vte-0.31.0:2.90
|
| 75 |
# >=xorg-server-1.11.4 needed for
|
| 76 |
# http://mail.gnome.org/archives/desktop-devel-list/2012-March/msg00024.html
|
| 77 |
# eautoreconf requires dev-libs/gobject-introspection-common
|
| 78 |
RDEPEND="${COMMON_DEPEND}
|
| 79 |
!<gnome-base/gail-1000
|
| 80 |
!<x11-libs/vte-0.31.0:2.90
|
| 81 |
packagekit? ( app-admin/packagekit-base )
|
| 82 |
X? ( !<x11-base/xorg-server-1.11.4 )"
|
| 83 |
PDEPEND="vim-syntax? ( app-vim/gtk-syntax )"
|
| 84 |
|
| 85 |
strip_builddir() {
|
| 86 |
local rule=$1
|
| 87 |
shift
|
| 88 |
local directory=$1
|
| 89 |
shift
|
| 90 |
sed -e "s/^\(${rule} =.*\)${directory}\(.*\)$/\1\2/" -i $@ \
|
| 91 |
|| die "Could not strip director ${directory} from build."
|
| 92 |
}
|
| 93 |
|
| 94 |
src_prepare() {
|
| 95 |
# -O3 and company cause random crashes in applications. Bug #133469
|
| 96 |
replace-flags -O3 -O2
|
| 97 |
strip-flags
|
| 98 |
|
| 99 |
# https://bugzilla.gnome.org/show_bug.cgi?id=654108
|
| 100 |
epatch "${FILESDIR}/${PN}-3.3.18-fallback-theme.patch"
|
| 101 |
|
| 102 |
# Apparently needed for new libxkbcommon headers; bug #408131
|
| 103 |
epatch "${FILESDIR}/${PN}-3.3.20-wayland-xkbcommon-headers.patch"
|
| 104 |
|
| 105 |
# Build fix for uclibc from gtk+-3.5.x; bug #441634; needs eautoreconf
|
| 106 |
epatch "${FILESDIR}/${PN}-3.4.4-isnan.patch"
|
| 107 |
|
| 108 |
# Non-working test in gentoo's env
|
| 109 |
sed 's:\(g_test_add_func ("/ui-tests/keys-events.*\):/*\1*/:g' \
|
| 110 |
-i gtk/tests/testing.c || die "sed 1 failed"
|
| 111 |
sed '\%/recent-manager/add%,/recent_manager_purge/ d' \
|
| 112 |
-i gtk/tests/recentmanager.c || die "sed 2 failed"
|
| 113 |
|
| 114 |
# FIXME: multiple reftests fail when run from portage (but succeed when
|
| 115 |
# run from a manual compile in a temp directory)
|
| 116 |
sed -e 's:\(SUBDIRS.*\)reftests:\1:' \
|
| 117 |
-i tests/Makefile.* || die "sed 3 failed"
|
| 118 |
|
| 119 |
# Test results depend on the list of mounted filesystems!
|
| 120 |
rm -v tests/a11y/pickers.{ui,txt} || die "rm failed"
|
| 121 |
|
| 122 |
if ! use test; then
|
| 123 |
# don't waste time building tests
|
| 124 |
strip_builddir SRC_SUBDIRS tests Makefile.am
|
| 125 |
[[ ${PV} != 9999 ]] && strip_builddir SRC_SUBDIRS tests Makefile.in
|
| 126 |
fi
|
| 127 |
|
| 128 |
if ! use examples; then
|
| 129 |
# don't waste time building demos
|
| 130 |
strip_builddir SRC_SUBDIRS demos Makefile.am
|
| 131 |
[[ ${PV} != 9999 ]] && strip_builddir SRC_SUBDIRS demos Makefile.in
|
| 132 |
fi
|
| 133 |
|
| 134 |
epatch_user
|
| 135 |
|
| 136 |
eautoreconf # for 3.4.4-isnan.patch
|
| 137 |
}
|
| 138 |
|
| 139 |
src_configure() {
|
| 140 |
local myconf="$(use_enable aqua quartz-backend)
|
| 141 |
$(use_enable colord)
|
| 142 |
$(use_enable cups cups auto)
|
| 143 |
$(use_enable introspection)
|
| 144 |
$(use_enable packagekit)
|
| 145 |
$(use_enable wayland wayland-backend)
|
| 146 |
$(use_enable X x11-backend)
|
| 147 |
$(use_enable X xcomposite)
|
| 148 |
$(use_enable X xdamage)
|
| 149 |
$(use_enable X xfixes)
|
| 150 |
$(use_enable X xkb)
|
| 151 |
$(use_enable X xrandr)
|
| 152 |
$(use_enable xinerama)
|
| 153 |
--disable-papi
|
| 154 |
--enable-gtk2-dependency"
|
| 155 |
|
| 156 |
# Passing --disable-debug is not recommended for production use
|
| 157 |
use debug && myconf="${myconf} --enable-debug=yes"
|
| 158 |
|
| 159 |
# need libdir here to avoid a double slash in a path that libtool doesn't
|
| 160 |
# grok so well during install (// between $EPREFIX and usr ...)
|
| 161 |
econf --libdir="${EPREFIX}/usr/$(get_libdir)" ${myconf}
|
| 162 |
}
|
| 163 |
|
| 164 |
src_test() {
|
| 165 |
# Tests require a new gnome-themes-standard, but adding it to DEPEND
|
| 166 |
# would result in circular dependencies.
|
| 167 |
# https://bugzilla.gnome.org/show_bug.cgi?id=669562
|
| 168 |
if ! has_version '>=x11-themes/gnome-themes-standard-3.3.91'; then
|
| 169 |
ewarn "Tests will be skipped because >=gnome-themes-standard-3.3.91"
|
| 170 |
ewarn "is not installed. Please re-run tests after installing the"
|
| 171 |
ewarn "required version of gnome-themes-standard."
|
| 172 |
return 0
|
| 173 |
fi
|
| 174 |
|
| 175 |
unset DBUS_SESSION_BUS_ADDRESS
|
| 176 |
|
| 177 |
# Exporting HOME fixes tests using XDG directories spec since all defaults
|
| 178 |
# are based on $HOME. It is also backward compatible with functions not
|
| 179 |
# yet ported to this spec.
|
| 180 |
XDG_DATA_HOME="${T}" HOME="${T}" Xemake check || die "tests failed"
|
| 181 |
}
|
| 182 |
|
| 183 |
src_install() {
|
| 184 |
emake DESTDIR="${D}" install
|
| 185 |
|
| 186 |
insinto /etc/gtk-3.0
|
| 187 |
doins "${FILESDIR}"/settings.ini
|
| 188 |
|
| 189 |
dodoc AUTHORS ChangeLog* HACKING NEWS* README*
|
| 190 |
|
| 191 |
# Remove unneeded *.la files
|
| 192 |
find "${D}" -name '*.la' -exec rm -f {} + || die
|
| 193 |
|
| 194 |
# add -framework Carbon to the .pc files
|
| 195 |
use aqua && for i in gtk+-3.0.pc gtk+-quartz-3.0.pc gtk+-unix-print-3.0.pc; do
|
| 196 |
sed -i -e "s:Libs\: :Libs\: -framework Carbon :" "${ED}"usr/$(get_libdir)/pkgconfig/$i || die "sed failed"
|
| 197 |
done
|
| 198 |
}
|
| 199 |
|
| 200 |
pkg_preinst() {
|
| 201 |
gnome2_schemas_savelist
|
| 202 |
}
|
| 203 |
|
| 204 |
pkg_postinst() {
|
| 205 |
gnome2_schemas_update
|
| 206 |
|
| 207 |
local GTK3_MODDIR="${EROOT}usr/$(get_libdir)/gtk-3.0/3.0.0"
|
| 208 |
gtk-query-immodules-3.0 > "${GTK3_MODDIR}/immodules.cache" \
|
| 209 |
|| ewarn "Failed to run gtk-query-immodules-3.0"
|
| 210 |
|
| 211 |
if ! has_version "app-text/evince"; then
|
| 212 |
elog "Please install app-text/evince for print preview functionality."
|
| 213 |
elog "Alternatively, check \"gtk-print-preview-command\" documentation and"
|
| 214 |
elog "add it to your settings.ini file."
|
| 215 |
fi
|
| 216 |
}
|
| 217 |
|
| 218 |
pkg_postrm() {
|
| 219 |
gnome2_schemas_update
|
| 220 |
}
|