Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Per package variables [unsolved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
miscdebris
n00b
n00b


Joined: 30 Mar 2005
Posts: 70

PostPosted: Tue Dec 19, 2006 6:07 pm    Post subject: Per package variables [unsolved] Reply with quote

Is there a way to set variables per package? I've a couple packages (db and pam) that simply do not like FEATURES=distcc, and I would like to disable it for those packages. Is there a way to do so?
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3846
Location: Austro Bavaria

PostPosted: Tue Dec 19, 2006 6:09 pm    Post subject: Reply with quote

yes, there is an way

you could set usefalgs dependend on this file for packages only , here is mine, have a look

Code:
notebook roman # cat /etc/portage/package.use     
#dev-libs/cyrus-sasl -gdbm berkdb
app-text/acroread nsplugin
#>=x11-base/xorg-sever-1.1.1-r1 minimal
sys-libs/ncurses minimal
x11-apps/xinit minimal
net-dns/openldap minimal
app-editors/nano minimal
dev-libs/libcdio minimal
sys-apps/miscfiles minimal
media-video/vcdimager minimal

#11.Dez.2006
app-cdr/cdrdao -gnome
net-misc/openvpn minimal
app-office/openoffice -gstreamer
notebook roman #
Back to top
View user's profile Send private message
sonicbhoc
Veteran
Veteran


Joined: 24 Oct 2005
Posts: 1805
Location: In front of the computer screen

PostPosted: Tue Dec 19, 2006 6:11 pm    Post subject: Reply with quote

He didn't mean use flags, he meant portage variables. And as far as I know, you can't do that yet.
_________________
I'm too lazy to keep this stupid signature up to date, so here's something more interesting:
My friend Hetdegon can draw if you ask me.
Now using PClinuxOS on my laptop and Gentoo on my desktop and new laptop.
Back to top
View user's profile Send private message
miscdebris
n00b
n00b


Joined: 30 Mar 2005
Posts: 70

PostPosted: Tue Dec 19, 2006 6:12 pm    Post subject: Reply with quote

That doesn't work for FEATURES, does it?
Back to top
View user's profile Send private message
miscdebris
n00b
n00b


Joined: 30 Mar 2005
Posts: 70

PostPosted: Tue Dec 19, 2006 6:41 pm    Post subject: Reply with quote

Well, I suppose I COULD hack somethiong together using those handy variables below and a new file or three in /etc/portage and hide it neatly in /etc/portage/bashrc like I did my Dynamic DISTCC_HOSTS and MAKEOPTS generator. I was just hoping to avoid that. I'll wait before I start that.

declare -x FEATURES="autoconfig distlocks metadata-transfer parallel-fetch sandbox sfperms strict userfetch userpriv usersandbox"
declare -x EBUILD="/usr/portage/sys-libs/pam/pam-0.78-r3.ebuild"
declare -x PORTDIR="/usr/portage"
declare -x PORTDIR_OVERLAY="/home/portage/overlay"
_________________
Dynamic DISTCC_HOSTS & MAKEOPTS Generation for Portage


Last edited by miscdebris on Tue Dec 19, 2006 7:29 pm; edited 1 time in total
Back to top
View user's profile Send private message
Rumil
Tux's lil' helper
Tux's lil' helper


Joined: 08 Dec 2003
Posts: 108
Location: Krakow, Poland

PostPosted: Tue Dec 19, 2006 7:04 pm    Post subject: Reply with quote

I don't know if it will work for $FEATURES, but works good enough for $CFLAGS and $LDFLAGS:
make file eg. /etc/portage/env/media-sound/amarok for amarok and put in it your definition of variable: FEATURES="bleble". You could also try FEATURES="${FEATURES} -distcc" but I don't know how portage reacts for setting both distcc and -distcc (it should use the last one, I believe).
Back to top
View user's profile Send private message
swimmer
Veteran
Veteran


Joined: 15 Jul 2002
Posts: 1330
Location: Netherlands

PostPosted: Tue Jan 09, 2007 1:49 pm    Post subject: Reply with quote

This does not work for me :-/

emerge --info
Portage 2.1.1-r2 (default-linux/amd64/2006.1/desktop, gcc-4.1.1, glibc-2.4-r4, 2.6.19-gentoo-r3 x86_64)
=================================================================
System uname: 2.6.19-gentoo-r3 x86_64 AMD Athlon(tm) 64 Processor 3500+
Gentoo Base System version 1.12.6
Last Sync: Tue, 09 Jan 2007 05:00:03 +0000
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: 1.3.7, 2.0.31
dev-lang/python: 2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache: [Not Present]
dev-util/confcache: [Not Present]
sys-apps/sandbox: 1.2.17
sys-devel/autoconf: 2.13, 2.61
sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils: 2.16.1-r3
sys-devel/gcc-config: 1.3.14
sys-devel/libtool: 1.5.22
virtual/os-headers: 2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -pipe -O2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-march=k8 -pipe -O2"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig digest distlocks fixpackages metadata-transfer parallel-fetch sandbox sfperms strict"
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9507
Location: beyond the rim

PostPosted: Wed Jan 10, 2007 1:09 am    Post subject: Reply with quote

Rumil wrote:
I don't know if it will work for $FEATURES, but works good enough for $CFLAGS and $LDFLAGS:
make file eg. /etc/portage/env/media-sound/amarok for amarok and put in it your definition of variable: FEATURES="bleble". You could also try FEATURES="${FEATURES} -distcc" but I don't know how portage reacts for setting both distcc and -distcc (it should use the last one, I believe).

/etc/portage/env works for variables that are only used by the bash side of portage or the build system (like *FLAGS vars that portage itself doesn't care about). It may work for a few values of FEATURES (though for disabling you can't use the usual negation syntax), but generally it won't, same for most other variables usually found in make.conf as they are used before /etc/portage/env is parsed (which btw isn't done by portage itself).
Back to top
View user's profile Send private message
swimmer
Veteran
Veteran


Joined: 15 Jul 2002
Posts: 1330
Location: Netherlands

PostPosted: Wed Jan 10, 2007 2:23 am    Post subject: Reply with quote

Genone wrote:
/etc/portage/env works for variables that are only used by the bash side of portage or the build system (like *FLAGS vars that portage itself doesn't care about). It may work for a few values of FEATURES (though for disabling you can't use the usual negation syntax), but generally it won't, same for most other variables usually found in make.conf as they are used before /etc/portage/env is parsed (which btw isn't done by portage itself).


Thanks for the info Genone - so I better return to /etc/portage/bashrc?

I had something previously working for that with the following:
Code:
# Workaround for creating different environments for specific packages
# For every package you need a separate file in /etc/portage/env.d !!!
# In this file you can specify the specific environment variables like
# FEATURES="-ccache"
#
# Thanks to Neil Bothwick <neil@digimed.co.uk> - 2006
for MY_ENV in ${PN} ${P} ${PF}; do
        if [ -f /etc/portage/env.d/${CATEGORY}/${MY_ENV} ]; then
                source /etc/portage/env.d/${CATEGORY}/${MY_ENV}
                fi
        done

but this does not work anymore and seems similar to /usr/portage/profiles/base/profile.bashrc :-/

Is there anything else I can do?

Greetz
swimmer
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9507
Location: beyond the rim

PostPosted: Wed Jan 10, 2007 4:39 am    Post subject: Reply with quote

swimmer wrote:
Genone wrote:
/etc/portage/env works for variables that are only used by the bash side of portage or the build system (like *FLAGS vars that portage itself doesn't care about). It may work for a few values of FEATURES (though for disabling you can't use the usual negation syntax), but generally it won't, same for most other variables usually found in make.conf as they are used before /etc/portage/env is parsed (which btw isn't done by portage itself).


Thanks for the info Genone - so I better return to /etc/portage/bashrc?

Same restrictions there. Anything with "bash" in the name can't influence the python side of portage.
Back to top
View user's profile Send private message
swimmer
Veteran
Veteran


Joined: 15 Jul 2002
Posts: 1330
Location: Netherlands

PostPosted: Wed Jan 10, 2007 11:00 am    Post subject: Reply with quote

Genone wrote:
Same restrictions there. Anything with "bash" in the name can't influence the python side of portage.

Thanks again for the fast response Genone :)

This brings me back to the question: "Is there anything else I can do?"

Greetz
swimmer
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9507
Location: beyond the rim

PostPosted: Wed Jan 10, 2007 11:10 am    Post subject: Reply with quote

Not really.
Back to top
View user's profile Send private message
swimmer
Veteran
Veteran


Joined: 15 Jul 2002
Posts: 1330
Location: Netherlands

PostPosted: Wed Jan 10, 2007 11:18 am    Post subject: Reply with quote

Ok :?

Thanks for the fast response
swimmer
Back to top
View user's profile Send private message
miscdebris
n00b
n00b


Joined: 30 Mar 2005
Posts: 70

PostPosted: Wed Jan 10, 2007 2:51 pm    Post subject: Reply with quote

Well, I know you can effectively do FEATURES=-distcc simply by setting your $DISTCC_HOSTS to localhost/2 and your MAKEOPTS to -j2 in /etc/portage/bashrc after you read in a file and see if you want to use avoid distcc with it. I have a good start on [/topic]something semi-related here.
_________________
Dynamic DISTCC_HOSTS & MAKEOPTS Generation for Portage
Back to top
View user's profile Send private message
tekknokrat
Apprentice
Apprentice


Joined: 17 Apr 2005
Posts: 278
Location: Magdeburg

PostPosted: Tue Mar 13, 2007 5:27 pm    Post subject: Reply with quote

how do I get which env belongs to python and which belongs to bash part of portage?
_________________
Optimism is solely an absence of information. / Optimismus ist nur ein Mangel an Information.
(Arthur Schopenhauer)
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9507
Location: beyond the rim

PostPosted: Tue Mar 13, 2007 8:01 pm    Post subject: Reply with quote

tekknokrat wrote:
how do I get which env belongs to python and which belongs to bash part of portage?

a) read the code
b) experience
Back to top
View user's profile Send private message
desastre
n00b
n00b


Joined: 22 May 2007
Posts: 32
Location: Duesseldorf

PostPosted: Tue Jun 10, 2008 7:49 am    Post subject: Reply with quote

I noticed that an export of the variable from /etc/portage/env/<cat>/<pkg> helps in some cases, like setting the $F77.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum