I had to go down this road too recently. The portage man pages mention
the two ways and recommend the completely non-obvious one that melted my
brain. It works like this:
$ cat /etc/portage/package.env
=app-emulation/virtualbox-5.0.6 vbox-makeopts
=app-emulation/virtualbox-5.0.6-r1 vbox-makeopts
$ cat /etc/portage/env/vbox-makeopts
MAKEOPTS="-j2 -l4"
All the atoms listed in package.env (2 virtual box ebuilds in this case)
will apply the environment settings in a file called vbox-makeopts. I
had to do this because virtualbox-5 has a weird parallel build bug - it
often fails with j=1 or j>2 but never with j=2. Odd.
The other method is very obvious but somehow not recommended:
$ ls -l /etc/portage/env/mail-client
-rw-r--r-- 1 root root 92 Sep 25 17:00 thunderbird-38.2.0
-rw-r--r-- 1 root root 92 Oct 1 14:52 thunderbird-38.3.0
$ cat /etc/portage/env/mail-client/thunderbird-38.2.0
LDFLAGS="${LDFLAGS}
-Wl,-rpath,/usr/lib/thunderbird,-rpath,/usr/lib/thunderbird/components"
The dir and version structure of env/<pkg>-<version> is compared to
what is being merged (IIRC $P, $PN, $PV all work) and the env in the
file is applied.
--
Alan McKinnon
alan.m...@gmail.com