Gentoo Archives: gentoo-user

From: Michael Haubenwallner <haubi@g.o>
To: fx.carton@×××××.fr
Cc: gentoo-user@l.g.o
Subject: [gentoo-user] Re: Building packages in different prefix without rebuilding system packages
Date: Fri, 15 May 2020 10:52:29
Message-Id: 2233d614-f301-69fa-ef69-48febf7439d6@gentoo.org
In Reply to: [gentoo-user] Building packages in different prefix without rebuilding system packages by "François-Xavier Carton"
1 Hi François-Xavier,
2
3 On 5/14/20 7:02 AM, François-Xavier Carton wrote:
4 > Hi,
5 >
6 > Is there a way of installing packages in a different prefix while still
7 > using system packages? I've tried setting EPREFIX, however doing that
8 > will install all dependencies in the prefix, even if there are already
9 > installed in the system.
10 >
11 > I was hoping to install some packages in user directories, but I also
12 > don't want to duplicate the packages installed globally. For example,
13 > most packages eventually depend on gcc, which I definitely don't want to
14 > compile twice. So ideally, only dependencies that are not installed
15 > globally should be pulled in.
16 >
17 > I was not able to find a way of doing that, but I feel like it shouldn't
18 > be too hard, because EPREFIX almost does what I want. Does someone know
19 > if it's possible without too much tweaking?
20
21 What you're after is known as "Prefix/Stack", where you have some "base"
22 Prefix, which's portage does manage packages in another - stacked - Prefix.
23
24 While this does work already with "Prefix/Guest" as base Prefix, there is no
25 technical reason to not work with "Prefix/Standalone" or even "Gentoo Linux"
26 as the base Prefix. The only problem maybe is that "Prefix/Guest" does use
27 a portage version with additional patches.
28
29 But still, you can get an idea about how this works, using "Prefix/Guest":
30
31 $ docker run -t -i gentooprefix/prefix-guest-64bit-fedora -c /bin/bash
32
33 At the docker prompt:
34
35 Enter the Guest Prefix preinstalled to /tmp/gentoo:
36 $ /tmp/gentoo/startprefix
37
38 Set up your stacked Prefix:
39 $ prefix-stack-setup --eprefix=$HOME/stack --profile=/tmp/gentoo/etc/portage/make.profile
40 Note that "~/stack" will not work here, bash refuses to resolve '~' after '='.
41
42 Leave the Guest Prefix:
43 $ exit
44
45 Enter your just created stacked Prefix:
46 $ ~/stack/startprefix
47
48 Emerge your package, for example:
49 $ emerge sys-libs/zlib
50
51 Have fun!
52
53 HTH,
54 /haubi/

Replies

Subject Author
Re: [gentoo-user] Re: Building packages in different prefix without rebuilding system packages "François-Xavier Carton" <fx.carton@×××××.fr>