Gentoo Archives: gentoo-portage-dev

From: Pacho Ramos <pacho@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] "official way" for setting per package CFLAGS and FEATURES?
Date: Sat, 27 Aug 2011 18:40:05
Message-Id: 1314470373.15976.2.camel@localhost
In Reply to: Re: [gentoo-portage-dev] "official way" for setting per package CFLAGS and FEATURES? by Zac Medico
1 El sáb, 20-08-2011 a las 07:42 -0700, Zac Medico escribió:
2 > On 07/19/2009 01:20 PM, Zac Medico wrote:
3 > > Pacho Ramos wrote:
4 > >> Hello, I would want to always merge xorg-server, libdrm, and intel
5 > >> driver (that likes to crash a lot) to be always compiled with debugging
6 > >> symbols and FEATURES="${FEATURES} splitdebug"
7 > >>
8 > >> Searching in google seems that there are some available hacks done by
9 > >> some forums users, but they seem to be a bit old and, before trying
10 > >> them, I would want to know if there is an "official" way of doing it.
11 > >>
12 > >> Thanks a lot :-)
13 > >
14 > > I use pre_pkg_setup hooks defined in /etc/portage/env. For example:
15 > >
16 > > cat /etc/portage/env/sys-libs/glibc
17 > >
18 > > pre_pkg_setup() {
19 > > local x
20 > > for x in installsources splitdebug ; do
21 > > if ! has $x $FEATURES ; then
22 > > elog "bashrc is adding $x to FEATURES for $PN"
23 > > FEATURES="$FEATURES $x"
24 > > fi
25 > > done
26 > >
27 > > if ! hasq -ggdb $CFLAGS ; then
28 > > elog "bashrc is adding \"-ggdb\" to CFLAGS for $PN"
29 > > CFLAGS="$CFLAGS -ggdb"
30 > > fi
31 > > }
32 >
33 > Please note that the above approach has been deprecated since
34 > portage-2.1.9.24, due to inclusion of package.env support:
35 >
36 > http://bugs.gentoo.org/show_bug.cgi?id=44796
37 >
38 > In order to accomplish the same thing with package.env, you'd put
39 > something like "sys-libs/glibc debug.conf" in /etc/portage/package.env,
40 > and then you put your FEATURES and CFLAGS variable settings in
41 > /etc/portage/env/debug.conf (same format as make.conf). This is
42 > documented in the portage man page.
43
44 Thanks a lot for the updated information, will migrate to new approach
45 as soon as possible :-)

Attachments

File name MIME type
signature.asc application/pgp-signature