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
Message-Id: 44318867.7070306@eim.ae
1 Hello all,
2
3 I've finally got my system compiled with GCC 4 and latest glibc. In the
4 process, I have to apply a number of custom compiler and linking flags
5 to different packages. I found having to use just /etc/portage/bashrc
6 for this too limiting, but I love the ability to hook other scripts in
7 using this mechanism. To help me with customizing flags on a per-package
8 basis, I created a set of functions (or script) to help me. They need
9 to be sourced into /etc/portage/bashrc.
10
11 I'm not much of a programmer, but I'm hoping that someone else will also
12 find these functions useful, develop them further and perhaps improve on
13 the documentation. Most importantly, I'd appreciate constructive
14 criticism on anything related to my approach here.
15
16 Thanks in advance.
17
18 SM
19
20 The documentation I have thus far, included in file --
21 # ------------------------------------------------------
22 # ----------------- USAGE NOTES --------------------
23 # ------------------------------------------------------
24 # Set of functions that allow for per-package settings
25 # when sourced into /etc/portage/bashrc. This file reads
26 # the file(s), if they exist, in the following sequence -
27 # 1. /etc/portage/package.env
28 # 2. /etc/portage/$HOSTNAME/package.env
29 # These are default filenames and can be changed. These
30 # files have to follow a given format and are sourced by
31 # the function "fix_env $filename"
32 # Default layout of the above files is as follows -
33 # 1. no >=<! operators
34 # 2. Col 1 - category/packagename with version
35 # and release optional
36 # 3. Col 2 - ACTION. One of (A,a)dd, (D,d)elete,
37 # (N,n)ew or (R,r)eplace.
38 # 4. Col 3 - ENV_VARIABLE. Environment variable
39 # 5. Col 4 - VALUES. Values to add, change, replace
40 # or create new variable.
41 #
42 # Additional package specific config files are then sources
43 # in the following sequence -
44 # 1. /etc/portage/env/$CATEGORY/${PN}.conf
45 # 2. /etc/portage/env/$CATEGORY/${PN}-${PV}.conf
46 # 3. /etc/portage/env/$CATEGORY/${PN}-${PV}-${PR}.conf
47 # 4. /etc/portage/env/$CATEGORY/${PN}-${PV}-${PR}.${HOST}.conf
48 # where default $HOST is the name of the host running the
49 # ebuild. The above need to be regular sourceable Bash
50 # script files.
51 #
52 # ------------------------------------------------------

Attachments

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