Re: [gentoo-user] Re: Building packages in different prefix without rebuilding system packages

2020-05-15 Thread François-Xavier Carton
On Fri, May 15, 2020 at 12:53:16PM +0200, Michael Haubenwallner wrote:
> Hi François-Xavier,
> 
> What you're after is known as "Prefix/Stack", where you have some "base"
> Prefix, which's portage does manage packages in another - stacked - Prefix.
> 
> While this does work already with "Prefix/Guest" as base Prefix, there is no
> technical reason to not work with "Prefix/Standalone" or even "Gentoo Linux"
> as the base Prefix.  The only problem maybe is that "Prefix/Guest" does use
> a portage version with additional patches.
> 
> But still, you can get an idea about how this works, using "Prefix/Guest":
> 
>  $ docker run -t -i gentooprefix/prefix-guest-64bit-fedora -c /bin/bash
> 
> At the docker prompt:
> 
> Enter the Guest Prefix preinstalled to /tmp/gentoo:
>  $ /tmp/gentoo/startprefix
> 
> Set up your stacked Prefix:
>  $ prefix-stack-setup --eprefix=$HOME/stack 
> --profile=/tmp/gentoo/etc/portage/make.profile
> Note that "~/stack" will not work here, bash refuses to resolve '~' after '='.
> 
> Leave the Guest Prefix:
>  $ exit
> 
> Enter your just created stacked Prefix:
>  $ ~/stack/startprefix
> 
> Emerge your package, for example:
>  $ emerge sys-libs/zlib
> 
> Have fun!
> 
> HTH,
> /haubi/
> 

Thanks, this looks great! I'll play with it and see how it works :)



[gentoo-user] Re: Building packages in different prefix without rebuilding system packages

2020-05-15 Thread Michael Haubenwallner
Hi François-Xavier,

On 5/14/20 7:02 AM, François-Xavier Carton wrote:
> Hi,
> 
> Is there a way of installing packages in a different prefix while still
> using system packages? I've tried setting EPREFIX, however doing that
> will install all dependencies in the prefix, even if there are already
> installed in the system.
> 
> I was hoping to install some packages in user directories, but I also
> don't want to duplicate the packages installed globally. For example,
> most packages eventually depend on gcc, which I definitely don't want to
> compile twice. So ideally, only dependencies that are not installed
> globally should be pulled in.
> 
> I was not able to find a way of doing that, but I feel like it shouldn't
> be too hard, because EPREFIX almost does what I want. Does someone know
> if it's possible without too much tweaking?

What you're after is known as "Prefix/Stack", where you have some "base"
Prefix, which's portage does manage packages in another - stacked - Prefix.

While this does work already with "Prefix/Guest" as base Prefix, there is no
technical reason to not work with "Prefix/Standalone" or even "Gentoo Linux"
as the base Prefix.  The only problem maybe is that "Prefix/Guest" does use
a portage version with additional patches.

But still, you can get an idea about how this works, using "Prefix/Guest":

 $ docker run -t -i gentooprefix/prefix-guest-64bit-fedora -c /bin/bash

At the docker prompt:

Enter the Guest Prefix preinstalled to /tmp/gentoo:
 $ /tmp/gentoo/startprefix

Set up your stacked Prefix:
 $ prefix-stack-setup --eprefix=$HOME/stack 
--profile=/tmp/gentoo/etc/portage/make.profile
Note that "~/stack" will not work here, bash refuses to resolve '~' after '='.

Leave the Guest Prefix:
 $ exit

Enter your just created stacked Prefix:
 $ ~/stack/startprefix

Emerge your package, for example:
 $ emerge sys-libs/zlib

Have fun!

HTH,
/haubi/