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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sat May 5 16:35:21 2012 UTC (12 months, 2 weeks ago) by tetromino
Branch: MAIN
Changes since 1.2: +6 -4 lines
Restore forgotten cross-compile fix from 2.30.x (bug #414761, thanks to Samuli Suominen).

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

  ViewVC Help
Powered by ViewVC 1.1.13