On 20/10/2015 16:26, Michael Orlitzky wrote: > On 10/20/2015 10:04 AM, Nikos Chantziaras wrote: >> I'm following the documentation here: >> >> https://wiki.gentoo.org/wiki/Handbook:AMD64/Portage/Advanced#Using_.2Fetc.2Fportage.2Fenv >> >> to hook into the postinst phase of an ebuild. > > Deja vu: > > http://comments.gmane.org/gmane.linux.gentoo.devhelp/151 > > https://bugs.gentoo.org/show_bug.cgi?id=388781 > > There's two separate uses for /etc/portage/env -- one of them will get > you the make.conf parser (when you list the file in > /etc/portage/package.env) and the other that will get you the bash > parser (when you put the file at /etc/portage/env/${CATEGORY}/${PN}). > > The whole thing is confusing. If you ever get it working please put a > decent example on the wiki because I remember spending hours trying to > do the same thing.
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.mckin...@gmail.com