* [gentoo-portage-dev] "official way" for setting per package CFLAGS and FEATURES?
@ 2009-07-18 18:15 Pacho Ramos
2009-07-19 20:20 ` Zac Medico
0 siblings, 1 reply; 7+ messages in thread
From: Pacho Ramos @ 2009-07-18 18:15 UTC (permalink / raw
To: gentoo-portage-dev
Hello, I would want to always merge xorg-server, libdrm, and intel
driver (that likes to crash a lot) to be always compiled with debugging
symbols and FEATURES="${FEATURES} splitdebug"
Searching in google seems that there are some available hacks done by
some forums users, but they seem to be a bit old and, before trying
them, I would want to know if there is an "official" way of doing it.
Thanks a lot :-)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-portage-dev] "official way" for setting per package CFLAGS and FEATURES?
2009-07-18 18:15 [gentoo-portage-dev] "official way" for setting per package CFLAGS and FEATURES? Pacho Ramos
@ 2009-07-19 20:20 ` Zac Medico
2009-07-20 8:42 ` [gentoo-portage-dev] " Duncan
2011-08-20 14:42 ` [gentoo-portage-dev] " Zac Medico
0 siblings, 2 replies; 7+ messages in thread
From: Zac Medico @ 2009-07-19 20:20 UTC (permalink / raw
To: gentoo-portage-dev
Pacho Ramos wrote:
> Hello, I would want to always merge xorg-server, libdrm, and intel
> driver (that likes to crash a lot) to be always compiled with debugging
> symbols and FEATURES="${FEATURES} splitdebug"
>
> Searching in google seems that there are some available hacks done by
> some forums users, but they seem to be a bit old and, before trying
> them, I would want to know if there is an "official" way of doing it.
>
> Thanks a lot :-)
I use pre_pkg_setup hooks defined in /etc/portage/env. For example:
cat /etc/portage/env/sys-libs/glibc
pre_pkg_setup() {
local x
for x in installsources splitdebug ; do
if ! has $x $FEATURES ; then
elog "bashrc is adding $x to FEATURES for $PN"
FEATURES="$FEATURES $x"
fi
done
if ! hasq -ggdb $CFLAGS ; then
elog "bashrc is adding \"-ggdb\" to CFLAGS for $PN"
CFLAGS="$CFLAGS -ggdb"
fi
}
--
Thanks,
Zac
^ permalink raw reply [flat|nested] 7+ messages in thread
* [gentoo-portage-dev] Re: "official way" for setting per package CFLAGS and FEATURES?
2009-07-19 20:20 ` Zac Medico
@ 2009-07-20 8:42 ` Duncan
2009-07-20 19:12 ` Zac Medico
2011-08-20 14:42 ` [gentoo-portage-dev] " Zac Medico
1 sibling, 1 reply; 7+ messages in thread
From: Duncan @ 2009-07-20 8:42 UTC (permalink / raw
To: gentoo-portage-dev
Zac Medico <zmedico@gentoo.org> posted 4A638016.3040602@gentoo.org,
excerpted below, on Sun, 19 Jul 2009 13:20:38 -0700:
> Pacho Ramos wrote:
>> Hello, I would want to always merge xorg-server, libdrm, and intel
>> driver (that likes to crash a lot) to be always compiled with debugging
>> symbols and FEATURES="${FEATURES} splitdebug"
> I use pre_pkg_setup hooks defined in /etc/portage/env.
Does /etc/portage/env work for the python part of portage yet, or just
the ebuild.sh layer?
Either way should work for the above (and I too use it regularly for
CFLAGS, etc), but if the python components don't see it, it won't work
for dependency checking, fetching, FEATURES used by emerge itself not the
ebuild.sh callout, etc. IIRC that used to be a limitation, but I'm not
sure it still applies.
(Also, as I've seen it explained, the reason it's not better documented
is deliberate, because there's no standard way to include env file
contents in reports such as emerge --info for bug reports and the like.
Without that, many devs are reluctant to have it widely known due to the
bug squashing problems its likely to cause, so it remains a semi-secret,
known mainly by the Gentoo power users, who hopefully know to report its
use when it applies. If you check bugs I've filed, for instance, say for
parallel make aka MAKEOPTS, you'll note that I often mention that I
verified that MAKEOPTS=-j1 works by setting it in the appropriate env
file.)
--
Duncan - List replies preferred. No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master." Richard Stallman
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-portage-dev] Re: "official way" for setting per package CFLAGS and FEATURES?
2009-07-20 8:42 ` [gentoo-portage-dev] " Duncan
@ 2009-07-20 19:12 ` Zac Medico
2009-07-20 22:20 ` Duncan
0 siblings, 1 reply; 7+ messages in thread
From: Zac Medico @ 2009-07-20 19:12 UTC (permalink / raw
To: gentoo-portage-dev
Duncan wrote:
> Zac Medico <zmedico@gentoo.org> posted 4A638016.3040602@gentoo.org,
> excerpted below, on Sun, 19 Jul 2009 13:20:38 -0700:
>
>> Pacho Ramos wrote:
>>> Hello, I would want to always merge xorg-server, libdrm, and intel
>>> driver (that likes to crash a lot) to be always compiled with debugging
>>> symbols and FEATURES="${FEATURES} splitdebug"
>
>> I use pre_pkg_setup hooks defined in /etc/portage/env.
>
> Does /etc/portage/env work for the python part of portage yet, or just
> the ebuild.sh layer?
It only works for ebuild.sh since it's implemented via
$PORTDIR/profiles/base/profile.bashrc. Support for the python part
hasn't been merged yet, but there's a good patch which I've
commented on here:
http://bugs.gentoo.org/show_bug.cgi?id=44796#c64
--
Thanks,
Zac
^ permalink raw reply [flat|nested] 7+ messages in thread
* [gentoo-portage-dev] Re: "official way" for setting per package CFLAGS and FEATURES?
2009-07-20 19:12 ` Zac Medico
@ 2009-07-20 22:20 ` Duncan
0 siblings, 0 replies; 7+ messages in thread
From: Duncan @ 2009-07-20 22:20 UTC (permalink / raw
To: gentoo-portage-dev
Zac Medico <zmedico@gentoo.org> posted 4A64C19B.80304@gentoo.org,
excerpted below, on Mon, 20 Jul 2009 12:12:27 -0700:
> Duncan wrote:
>>
>> Does /etc/portage/env work for the python part of portage yet, or just
>> the ebuild.sh layer?
>
> It only works for ebuild.sh since it's implemented via
> $PORTDIR/profiles/base/profile.bashrc. Support for the python part
> hasn't been merged yet, but there's a good patch which I've commented on
> here:
>
> http://bugs.gentoo.org/show_bug.cgi?id=44796#c64
Thanks. I had known such a thing was possible but didn't realize there
was a patch already available and (apparently) in active discussion and
merge consideration. That's very cool and I'm certainly looking forward
to it. =:^)
It shouldn't have surprised me, tho. Portage is very flexible in regard
to what a bit of hacking can make it do, and there's a lot of folks
actively involved in bending it to their will for all sorts of unusual
and even unique situations. So that a patch exists to bend it in this
particular direction really shouldn't be surprising at all. But that
it's being considered right now for mainline inclusion is nice. =:^)
--
Duncan - List replies preferred. No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master." Richard Stallman
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-portage-dev] "official way" for setting per package CFLAGS and FEATURES?
2009-07-19 20:20 ` Zac Medico
2009-07-20 8:42 ` [gentoo-portage-dev] " Duncan
@ 2011-08-20 14:42 ` Zac Medico
2011-08-27 18:39 ` Pacho Ramos
1 sibling, 1 reply; 7+ messages in thread
From: Zac Medico @ 2011-08-20 14:42 UTC (permalink / raw
To: gentoo-portage-dev
On 07/19/2009 01:20 PM, Zac Medico wrote:
> Pacho Ramos wrote:
>> Hello, I would want to always merge xorg-server, libdrm, and intel
>> driver (that likes to crash a lot) to be always compiled with debugging
>> symbols and FEATURES="${FEATURES} splitdebug"
>>
>> Searching in google seems that there are some available hacks done by
>> some forums users, but they seem to be a bit old and, before trying
>> them, I would want to know if there is an "official" way of doing it.
>>
>> Thanks a lot :-)
>
> I use pre_pkg_setup hooks defined in /etc/portage/env. For example:
>
> cat /etc/portage/env/sys-libs/glibc
>
> pre_pkg_setup() {
> local x
> for x in installsources splitdebug ; do
> if ! has $x $FEATURES ; then
> elog "bashrc is adding $x to FEATURES for $PN"
> FEATURES="$FEATURES $x"
> fi
> done
>
> if ! hasq -ggdb $CFLAGS ; then
> elog "bashrc is adding \"-ggdb\" to CFLAGS for $PN"
> CFLAGS="$CFLAGS -ggdb"
> fi
> }
Please note that the above approach has been deprecated since
portage-2.1.9.24, due to inclusion of package.env support:
http://bugs.gentoo.org/show_bug.cgi?id=44796
In order to accomplish the same thing with package.env, you'd put
something like "sys-libs/glibc debug.conf" in /etc/portage/package.env,
and then you put your FEATURES and CFLAGS variable settings in
/etc/portage/env/debug.conf (same format as make.conf). This is
documented in the portage man page.
--
Thanks,
Zac
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-portage-dev] "official way" for setting per package CFLAGS and FEATURES?
2011-08-20 14:42 ` [gentoo-portage-dev] " Zac Medico
@ 2011-08-27 18:39 ` Pacho Ramos
0 siblings, 0 replies; 7+ messages in thread
From: Pacho Ramos @ 2011-08-27 18:39 UTC (permalink / raw
To: gentoo-portage-dev
[-- Attachment #1: Type: text/plain, Size: 1707 bytes --]
El sáb, 20-08-2011 a las 07:42 -0700, Zac Medico escribió:
> On 07/19/2009 01:20 PM, Zac Medico wrote:
> > Pacho Ramos wrote:
> >> Hello, I would want to always merge xorg-server, libdrm, and intel
> >> driver (that likes to crash a lot) to be always compiled with debugging
> >> symbols and FEATURES="${FEATURES} splitdebug"
> >>
> >> Searching in google seems that there are some available hacks done by
> >> some forums users, but they seem to be a bit old and, before trying
> >> them, I would want to know if there is an "official" way of doing it.
> >>
> >> Thanks a lot :-)
> >
> > I use pre_pkg_setup hooks defined in /etc/portage/env. For example:
> >
> > cat /etc/portage/env/sys-libs/glibc
> >
> > pre_pkg_setup() {
> > local x
> > for x in installsources splitdebug ; do
> > if ! has $x $FEATURES ; then
> > elog "bashrc is adding $x to FEATURES for $PN"
> > FEATURES="$FEATURES $x"
> > fi
> > done
> >
> > if ! hasq -ggdb $CFLAGS ; then
> > elog "bashrc is adding \"-ggdb\" to CFLAGS for $PN"
> > CFLAGS="$CFLAGS -ggdb"
> > fi
> > }
>
> Please note that the above approach has been deprecated since
> portage-2.1.9.24, due to inclusion of package.env support:
>
> http://bugs.gentoo.org/show_bug.cgi?id=44796
>
> In order to accomplish the same thing with package.env, you'd put
> something like "sys-libs/glibc debug.conf" in /etc/portage/package.env,
> and then you put your FEATURES and CFLAGS variable settings in
> /etc/portage/env/debug.conf (same format as make.conf). This is
> documented in the portage man page.
Thanks a lot for the updated information, will migrate to new approach
as soon as possible :-)
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-08-27 18:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-18 18:15 [gentoo-portage-dev] "official way" for setting per package CFLAGS and FEATURES? Pacho Ramos
2009-07-19 20:20 ` Zac Medico
2009-07-20 8:42 ` [gentoo-portage-dev] " Duncan
2009-07-20 19:12 ` Zac Medico
2009-07-20 22:20 ` Duncan
2011-08-20 14:42 ` [gentoo-portage-dev] " Zac Medico
2011-08-27 18:39 ` Pacho Ramos
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox