Gentoo Archives: gentoo-amd64

From: Samir Mishra <sqmishra@×××.ae>
To: gentoo-amd64@l.g.o
Subject: [gentoo-amd64] Emerge Compilation Customization - /etc/portage/bashrc
Date: Mon, 03 Apr 2006 20:44:11
Hello all,

I've finally got my system compiled with GCC 4 and latest glibc. In the 
process, I have to apply a number of custom compiler and linking flags 
to different packages. I found having to use just /etc/portage/bashrc 
for this too limiting, but I love the ability to hook other scripts in 
using this mechanism. To help me with customizing flags on a per-package 
basis, I created a set of functions (or script) to  help me. They need 
to be sourced into /etc/portage/bashrc.

I'm not much of a programmer, but I'm hoping that someone else will also 
find these functions useful, develop them further and perhaps improve on 
the documentation. Most importantly, I'd appreciate constructive 
criticism on anything related to my approach here.

Thanks in advance.


The documentation I have thus far, included in file --
# ------------------------------------------------------
# -----------------   USAGE NOTES   --------------------
# ------------------------------------------------------
# Set of functions that allow for per-package settings
# when sourced into /etc/portage/bashrc. This file reads
# the file(s), if they exist, in the following sequence -
#   1. /etc/portage/package.env
#   2. /etc/portage/$HOSTNAME/package.env
# These are default filenames and can be changed. These
# files have to follow a given format and are sourced by
# the function "fix_env $filename"
# Default layout of the above files is as follows -
#   1. no >=<! operators
#   2. Col 1 - category/packagename with version
#      and release optional
#   3. Col 2 - ACTION. One of (A,a)dd, (D,d)elete,
#      (N,n)ew or (R,r)eplace.
#   4. Col 3 - ENV_VARIABLE. Environment variable
#   5. Col 4 - VALUES. Values to add, change, replace
#      or create new variable.
# Additional package specific config files are then sources
# in the following sequence -
#   1. /etc/portage/env/$CATEGORY/${PN}.conf
#   2. /etc/portage/env/$CATEGORY/${PN}-${PV}.conf
#   3. /etc/portage/env/$CATEGORY/${PN}-${PV}-${PR}.conf
#   4. /etc/portage/env/$CATEGORY/${PN}-${PV}-${PR}.${HOST}.conf
# where default $HOST is the name of the host running the
# ebuild. The above need to be regular sourceable Bash
# script files.
# ------------------------------------------------------


File name MIME type
dummy.env text/plain
bashrc text/plain text/plain text/plain