Gentoo Archives: gentoo-dev

From: Antst GD <antst@×××××××.se>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] per-package environment variables.
Date: Tue, 31 Aug 2004 22:45:08
Message-Id: 4134FF5F.4050001@ifm.liu.se
In Reply to: [gentoo-dev] per-package environment variables. by Antst GD
1 I've checked /usr/lib/portage/pym/portage.py
2 With minor changes, this is is extremely easy to add provided syntax to
3 current portage. Just about 5 lines of code. :)
4 I can make a patch, people who interesting can try to use it as a
5 testers :)
6
7
8 Antst GD wrote:
9 > OK, lets develop discussion about option to choose environment variables
10 > per-package (compiler, flags and not only).
11 >
12 > As some of us know, definition of problem already include 90% solution.
13 > So, lets start from user-side.
14 > Want we want to see?
15 > 1) Possibility to change ENV during building some packages.
16 > 2) it should be automatic, no more definition of environment variables
17 > and manual emerging packages. No more spaming /etc/make.conf with some
18 > environment variables which correspond only to one package (RXVT_TERM,
19 > for example)
20 > 3) Solution must be flexible and allow us to have not only
21 > "per-package" variables set, but also define some general sets for
22 > inclusion. For example if we want to build soft1,soft2,ans soft3 with
23 > IFC, we really don't want to have 3 copies of something like:
24 > F77=ifc
25 > FC=ifc
26 > F90=ifc
27 > FFLAGS="-xN -ip"
28 > Moreover, when we will decide to change CPU, we will not need to edit 3
29 > files and change -xN to -xP. We want to do it once. :)
30 >
31 > 4) BTW, in such case it also not bad to have option to include something
32 > like
33 > USE="ifc"
34 > into this environment, and it should be parsed in proper way. I hope
35 > that this is clear. If we want to build something with IFC and set
36 > proper variables, we really don't want to go and edit one more file
37 > (/etc/portage/package.use). And we don't want to edit also two files,
38 > when we will figure out that we like coming gfortran :)
39 >
40 > 5) even more. I'll start not with per-package basic, but with
41 > per-environment basic, as a first iteration.
42 >
43 > So, lets define our problem in more details:
44 > 1) Assume that default configuration of my system is
45 > GCC 3.4.1
46 > CFLAGS="-O2 -pipe" in /etc/make.conf
47 > LINGUAS="ru" in /etc/make.conf
48 > there is no defined ifc and icc USE flags in /etc/make.conf
49 >
50 > 2) I have set of packages, that require something "extra"
51 > lam-mpi : want to compile with ICC, IFC
52 > blas-reference : want to compile with g77 and high optimization
53 > lapack-reference : want to compile with g77 and high optimization
54 > blas-atlas: want to compile with IFC, ICC
55 > lapack-atlas: want to compile with IFC, ICC
56 > xine-lib : want to compile with low-optimization for GCC
57 > open office : want to compile with LANGUAGE="RUSS" and GCC 3.3.4 and
58 > low-optimization
59 > kde-i18n : want to have with LINGUAS="fr" and GCC 3.3.4
60 > rxvt : want to compile with RXVT_TERM=xterm
61 > octave : want to build with high-optimization for GCC
62 >
63 >
64 > so, what I see?
65 > Something like:
66 >
67 > #cat /etc/portage/package.env
68 > lam-mpi: icc ifc
69 > blas-reference: g77high.env
70 > lapack-reference: g77high.env
71 > blas-atlas: ifc.env icc.env
72 > lapack-atlas: ifc.env icc.env
73 > xine-lib: GCC_lowopt.env
74 > openoffice: language_ru.env GCC_334.env GCC_lowopt.env
75 > kde-i18n: linguas_fr.env
76 > rxvt: rxvt.env
77 > octave: GCC_highopt.env
78 >
79 >
80 > #ls /etc/portage/env
81 > ifc.env
82 > ifc.env
83 > GCC_highopt.env
84 > GCC_lowopt.env
85 > rxvt.env
86 > linguas_fr.env
87 > language_ru.env
88 > GCC_334.env
89 > g77high.env
90 >
91 > and
92 > #cat /etc/portage/env/icc.env
93 > CC=icc
94 > CXX=icc
95 > CFLAGS="-O2 -xN -noalign"
96 > CXXFLAGS=$CFLAGS
97 > USE="icc"
98 >
99 > #cat /etc/portage/env/GCC_highopt.env
100 > CFLAGS="-O3 -ffast-math -funroll-all-loops -fmove-all-movables"
101 >
102 > #cat /etc/portage/env/GCC_lowopt.env
103 > CFLAGS="-O1"
104 >
105 > #cat /etc/portage/env/GCC_334.env
106 > CC=/usr/i686-pc-linux-gnu/gcc-bin/3.3/gcc
107 > g77=/usr/i686-pc-linux-gnu/gcc-bin/3.3/g77
108 >
109 > And rest it similar.
110 >
111 > Of course, it could be not so bad, to have option, to include name of
112 > file with ENV, or just env, to not produce tens of files with one
113 > variable, like RXVT_TERM="xterm"... There is seems to be two solutions:
114 > 1) just have second file with definitions, where not filenames, but
115 > defined variables.
116 > 2) change syntax of /etc/portage/package.env in such way, that allow to
117 > include both kind of records, filename and strict definition inline.
118 > something like
119 > openoffice: GCC_334.env GCC_lowopt.env -- LANGUAGE="RUSS"
120 >
121 >
122 > For the moment both solutions looks ugly for me. At least I can't
123 > imaging simple and easy-to-understand syntax for package.env, which will
124 > look nice and will parce without problems.
125 >
126 > What do you think about?
127 >
128
129
130 --
131 Anton Starikov
132
133 --
134 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] per-package environment variables. Ned Ludd <solar@g.o>