/[gentoo-x86]/dev-libs/glib/glib-2.30.2.ebuild
Gentoo

Contents of /dev-libs/glib/glib-2.30.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.16 - (show annotations) (download)
Tue Sep 25 11:40:57 2012 UTC (18 months, 3 weeks ago) by tetromino
Branch: MAIN
CVS Tags: HEAD
Changes since 1.15: +1 -1 lines
FILE REMOVED
Version bump. Notable changes: thumbnails now cached in XDG_CACHE_HOME; more stream classes implement GSeekable/GPollable. Drop old. Remove unused patches. Make license more precise.

(Portage version: 2.2.0_alpha132/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-libs/glib/glib-2.30.2.ebuild,v 1.15 2012/09/11 18:03:21 tetromino Exp $
4
5 EAPI="4"
6 PYTHON_DEPEND="utils? 2"
7 # Avoid runtime dependency on python when USE=test
8
9 inherit autotools gnome.org libtool eutils flag-o-matic gnome2-utils multilib pax-utils python toolchain-funcs virtualx
10
11 DESCRIPTION="The GLib library of C routines"
12 HOMEPAGE="http://www.gtk.org/"
13 SRC_URI="${SRC_URI}
14 http://pkgconfig.freedesktop.org/releases/pkg-config-0.26.tar.gz" # pkg.m4 for eautoreconf
15
16 LICENSE="LGPL-2"
17 SLOT="2"
18 IUSE="debug doc fam selinux +static-libs systemtap test utils xattr"
19 KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd ~x86-linux"
20
21 RDEPEND="virtual/libiconv
22 virtual/libffi
23 sys-libs/zlib
24 xattr? ( sys-apps/attr )
25 fam? ( virtual/fam )
26 utils? ( >=dev-util/gdbus-codegen-${PV} )"
27 DEPEND="${RDEPEND}
28 >=sys-devel/gettext-0.11
29 >=dev-util/gtk-doc-am-1.15
30 doc? (
31 >=dev-libs/libxslt-1.0
32 >=dev-util/gdbus-codegen-${PV}
33 >=dev-util/gtk-doc-1.15
34 ~app-text/docbook-xml-dtd-4.1.2 )
35 systemtap? ( >=dev-util/systemtap-1.3 )
36 test? (
37 sys-devel/gdb
38 =dev-lang/python-2*
39 >=dev-util/gdbus-codegen-${PV}
40 >=sys-apps/dbus-1.2.14 )
41 !<dev-util/gtk-doc-1.15-r2"
42 PDEPEND="x11-misc/shared-mime-info
43 !<gnome-base/gvfs-1.6.4-r990"
44 # shared-mime-info needed for gio/xdgmime, bug #409481
45 # Earlier versions of gvfs do not work with glib
46
47 pkg_setup() {
48 # Needed for gio/tests/gdbus-testserver.py
49 if use test ; then
50 python_set_active_version 2
51 python_pkg_setup
52 fi
53 }
54
55 src_prepare() {
56 mv -f "${WORKDIR}"/pkg-config-*/pkg.m4 "${WORKDIR}"/ || die
57
58 if use ia64 ; then
59 # Only apply for < 4.1
60 local major=$(gcc-major-version)
61 local minor=$(gcc-minor-version)
62 if (( major < 4 || ( major == 4 && minor == 0 ) )); then
63 epatch "${FILESDIR}/glib-2.10.3-ia64-atomic-ops.patch"
64 fi
65 fi
66
67 # Don't fail gio tests when ran without userpriv, upstream bug 552912
68 # This is only a temporary workaround, remove as soon as possible
69 # epatch "${FILESDIR}/${PN}-2.18.1-workaround-gio-test-failure-without-userpriv.patch"
70
71 # Fix gmodule issues on fbsd; bug #184301
72 epatch "${FILESDIR}"/${PN}-2.12.12-fbsd.patch
73
74 # Fix test failure when upgrading from 2.22 to 2.24, upstream bug 621368
75 epatch "${FILESDIR}/${PN}-2.24-assert-test-failure.patch"
76
77 # Do not try to remove files on live filesystem, upstream bug #619274
78 sed 's:^\(.*"/desktop-app-info/delete".*\):/*\1*/:' \
79 -i "${S}"/gio/tests/desktop-app-info.c || die "sed failed"
80
81 # need to build tests if USE=doc for bug #387385
82 if ! use test && ! use doc; then
83 # don't waste time building tests
84 sed 's/^\(.*\SUBDIRS .*\=.*\)tests\(.*\)$/\1\2/' -i $(find . -name Makefile.am -o -name Makefile.in) || die
85 else
86 # Disable tests requiring dev-util/desktop-file-utils when not installed, bug #286629
87 if ! has_version dev-util/desktop-file-utils ; then
88 ewarn "Some tests will be skipped due dev-util/desktop-file-utils not being present on your system,"
89 ewarn "think on installing it to get these tests run."
90 sed -i -e "/appinfo\/associations/d" gio/tests/appinfo.c || die
91 sed -i -e "/desktop-app-info\/default/d" gio/tests/desktop-app-info.c || die
92 sed -i -e "/desktop-app-info\/fallback/d" gio/tests/desktop-app-info.c || die
93 sed -i -e "/desktop-app-info\/lastused/d" gio/tests/desktop-app-info.c || die
94 fi
95
96 # Disable tests requiring dbus-python and pygobject; bugs #349236, #377549, #384853
97 if ! has_version dev-python/dbus-python || ! has_version 'dev-python/pygobject:2' ; then
98 ewarn "Some tests will be skipped due to dev-python/dbus-python or dev-python/pygobject:2"
99 ewarn "not being present on your system, think on installing them to get these tests run."
100 sed -i -e "/connection\/filter/d" gio/tests/gdbus-connection.c || die
101 sed -i -e "/connection\/large_message/d" gio/tests/gdbus-connection-slow.c || die
102 sed -i -e "/gdbus\/proxy/d" gio/tests/gdbus-proxy.c || die
103 sed -i -e "/gdbus\/proxy-well-known-name/d" gio/tests/gdbus-proxy-well-known-name.c || die
104 sed -i -e "/gdbus\/introspection-parser/d" gio/tests/gdbus-introspection.c || die
105 sed -i -e "/g_test_add_func/d" gio/tests/gdbus-threading.c || die
106 sed -i -e "/gdbus\/method-calls-in-thread/d" gio/tests/gdbus-threading.c || die
107 # needed to prevent gdbus-threading from asserting
108 ln -sfn $(type -P true) gio/tests/gdbus-testserver.py
109 fi
110 fi
111
112 # gdbus-codegen is a separate package
113 epatch "${FILESDIR}/${PN}-2.30.1-external-gdbus-codegen.patch"
114
115 # Handle the G_HOME environment variable to override the passwd entry, upstream bug #142568
116 epatch "${FILESDIR}/${PN}-2.30.1-homedir-env.patch"
117
118 # Fix hardcoded path to machine-id wrt #390143
119 epatch "${FILESDIR}/${PN}-2.30.2-machine-id.patch"
120
121 # disable pyc compiling
122 echo '#!/bin/sh' > py-compile
123
124 # Needed for the punt-python-check patch, disabling timeout test
125 # Also needed to prevent croscompile failures, see bug #267603
126 # Also needed for the no-gdbus-codegen patch
127 AT_M4DIR="${WORKDIR}" eautoreconf
128
129 [[ ${CHOST} == *-freebsd* ]] && elibtoolize
130
131 epunt_cxx
132 }
133
134 src_configure() {
135 # Avoid circular depend with dev-util/pkgconfig and
136 # native builds (cross-compiles won't need pkg-config
137 # in the target ROOT to work here)
138 if ! tc-is-cross-compiler && ! has_version virtual/pkgconfig; then
139 if has_version sys-apps/dbus; then
140 export DBUS1_CFLAGS="-I/usr/include/dbus-1.0 -I/usr/$(get_libdir)/dbus-1.0/include"
141 export DBUS1_LIBS="-ldbus-1"
142 fi
143 export LIBFFI_CFLAGS="-I$(echo /usr/$(get_libdir)/libffi-*/include)"
144 export LIBFFI_LIBS="-lffi"
145 fi
146
147 local myconf
148
149 # Building with --disable-debug highly unrecommended. It will build glib in
150 # an unusable form as it disables some commonly used API. Please do not
151 # convert this to the use_enable form, as it results in a broken build.
152 # -- compnerd (3/27/06)
153 use debug && myconf="--enable-debug"
154
155 # Always use internal libpcre, bug #254659
156 econf ${myconf} \
157 $(use_enable xattr) \
158 $(use_enable doc man) \
159 $(use_enable doc gtk-doc) \
160 $(use_enable fam) \
161 $(use_enable selinux) \
162 $(use_enable static-libs static) \
163 $(use_enable systemtap dtrace) \
164 $(use_enable systemtap systemtap) \
165 --enable-regex \
166 --with-pcre=internal \
167 --with-threads=posix
168 }
169
170 src_install() {
171 local f
172
173 # install-exec-hook substitutes ${PYTHON} in glib/gtester-report
174 emake DESTDIR="${D}" PYTHON="${EPREFIX}/usr/bin/python2" install
175
176 if ! use utils; then
177 rm "${ED}usr/bin/gtester-report"
178 fi
179
180 # Do not install charset.alias even if generated, leave it to libiconv
181 rm -f "${ED}/usr/lib/charset.alias"
182
183 # Don't install gdb python macros, bug 291328
184 rm -rf "${ED}/usr/share/gdb/" "${ED}/usr/share/glib-2.0/gdb/"
185
186 dodoc AUTHORS ChangeLog* NEWS* README
187
188 insinto /usr/share/bash-completion
189 for f in gdbus gsettings; do
190 newins "${ED}/etc/bash_completion.d/${f}-bash-completion.sh" ${f}
191 done
192 rm -rf "${ED}/etc"
193
194 # Completely useless with or without USE static-libs, people need to use
195 # pkg-config
196 find "${D}" -name '*.la' -exec rm -f {} +
197 }
198
199 src_test() {
200 gnome2_environment_reset
201
202 unset DBUS_SESSION_BUS_ADDRESS
203 export XDG_CONFIG_DIRS=/etc/xdg
204 export XDG_DATA_DIRS=/usr/local/share:/usr/share
205 export G_DBUS_COOKIE_SHA1_KEYRING_DIR="${T}/temp"
206 unset GSETTINGS_BACKEND # bug 352451
207
208 # Related test is a bit nitpicking
209 mkdir "$G_DBUS_COOKIE_SHA1_KEYRING_DIR"
210 chmod 0700 "$G_DBUS_COOKIE_SHA1_KEYRING_DIR"
211
212 # Hardened: gdb needs this, bug #338891
213 if host-is-pax ; then
214 pax-mark -mr "${S}"/tests/.libs/assert-msg-test \
215 || die "Hardened adjustment failed"
216 fi
217
218 # Need X for dbus-launch session X11 initialization
219 Xemake check
220 }
221
222 pkg_preinst() {
223 # Only give the introspection message if:
224 # * The user has gobject-introspection
225 # * Has glib already installed
226 # * Previous version was different from new version
227 if has_version "dev-libs/gobject-introspection" && ! has_version "=${CATEGORY}/${PF}"; then
228 ewarn "You must rebuild gobject-introspection so that the installed"
229 ewarn "typelibs and girs are regenerated for the new APIs in glib"
230 fi
231 }
232
233 pkg_postinst() {
234 # Inform users about possible breakage when updating glib and not dbus-glib, bug #297483
235 if has_version dev-libs/dbus-glib; then
236 ewarn "If you experience a breakage after updating dev-libs/glib try"
237 ewarn "rebuilding dev-libs/dbus-glib"
238 fi
239
240 if has_version '<x11-libs/gtk+-3.0.12:3'; then
241 # To have a clear upgrade path for gtk+-3.0.x users, have to resort to
242 # a warning instead of a blocker
243 ewarn
244 ewarn "Using <gtk+-3.0.12:3 with ${P} results in frequent crashes."
245 ewarn "You should upgrade to a newer version of gtk+:3 immediately."
246 fi
247 }

  ViewVC Help
Powered by ViewVC 1.1.20