public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Olivier Fisette <ribosome@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] per-package environment variables.
Date: Tue, 31 Aug 2004 23:05:37 -0400	[thread overview]
Message-ID: <200408312305.54733.ribosome@gentoo.org> (raw)
In-Reply-To: <200408311928.19670.vapier@gentoo.org>

[-- Attachment #1: Type: text/plain, Size: 2370 bytes --]

Hello all,

I see two problems with the implementations that were suggested up to now for 
per-package environment variables.

1) They do not allow any flexibility with regard to package versions, as 
opposed to other Portage configuration files ("package.mask", "package.use", 
etc.). The file "/etc/portage/packages.env/app-shells/bash" would be sourced 
for all versions of "app-shells/bash", for instance. This may be problematic 
for SLOTable packages, and prevents a user from defining or modifying a 
variable for a particular version of a package (to work around a bug, for 
example, such as "pymol-0.95" will segfault when raytracing if compiled with 
"-fgcse").

2) Having a hierarchy of files and directories miroring the Portage tree, with 
symlinks and such, looks a bit complicated more complicated than is needed. 
I'd rather have to deal with only one or a few files.

My initial suggestion was not flexible enough, since it required to declare 
the variables repeatedly for each package. Here is another idea:

A file named "/etc/portage/package.env" could contain entries such as:

app-office/openoffice lang_ru
>=app-sci/emboss-2.8.0 icc
=app-sci/pymol-0.95* gcc_low_opt

The keywords "lang_ru", "ifc" and "gcc_low_opt" would match files with these 
names, contained in "/etc/portage/env.d". These bash scripts would be sourced 
to provide per-package env vars. "/etc/portage/env.d/icc" would contain 
something along these lines:

CC=icc
CXX=icc
CFLAGS="-O2 -xN -noalign"
CXXFLAGS=$CFLAGS
USE="icc"

If we wanted to make things even easier to configure, we could have something 
like the following in "/etc/portage/package.env":

=app-sci/pymol-0.95* [ CC="gcc" CFLAGS="-O1" ]

... were a keyword is replaced by a delimited short bash script that would be 
sourced to provide per package env vars. This would avoid having to create 
files in "/etc/portage/env.d" which target only one package.

I don't think this approach is elegant or powerful. A better mechanism would 
allow to filter and replace flags (like flag-o-matic), to choose compilers 
and have them merged as dependencies when needed, etc. However, per-package 
env vars would be enough in 99 % of the cases, and would extend farther than 
just compilers and compiler flags.

-- 
Olivier Fisette (ribosome)
Gentoo Linux Developer

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2004-09-01  3:06 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-31 22:26 [gentoo-dev] per-package environment variables Antst GD
2004-08-31 22:34 ` Mike Frysinger
2004-08-31 22:44 ` Antst GD
2004-09-08 18:19   ` Ned Ludd
2004-08-31 23:28 ` Mike Frysinger
2004-09-01  0:00   ` Anton Starikov
2004-09-01  0:13   ` Anton Starikov
2004-09-01  3:05   ` Olivier Fisette [this message]
2004-09-01 11:08     ` Anton Starikov
2004-09-01 15:53       ` Robin H. Johnson
2004-09-01 19:56       ` Olivier Fisette
2004-09-01 22:39         ` Anton Starikov
2004-09-02 22:49         ` Anton Starikov
2004-09-02 23:30           ` Olivier Fisette
2004-09-03  1:36             ` Anton Starikov
2004-09-03  1:35               ` Robin H. Johnson
2004-09-03  2:05               ` Olivier Fisette
2004-09-03  2:53                 ` Anton Starikov
2004-09-01  0:26 ` Nicholas Jones
2004-09-01  0:51   ` Anton Starikov
2004-09-01 14:02 ` aye
2004-09-01 14:22   ` Anton Starikov
2004-09-01 15:59   ` Robin H. Johnson
2004-09-01 18:42     ` aye
2004-09-01 18:46       ` Robin H. Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200408312305.54733.ribosome@gentoo.org \
    --to=ribosome@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox