1 |
On Thursday, 14 May 2020 06:13:33 BST Dale wrote: |
2 |
> François-Xavier Carton wrote: |
3 |
> > Hi, |
4 |
> > |
5 |
> > Is there a way of installing packages in a different prefix while still |
6 |
> > using system packages? I've tried setting EPREFIX, however doing that |
7 |
> > will install all dependencies in the prefix, even if there are already |
8 |
> > installed in the system. |
9 |
> > |
10 |
> > I was hoping to install some packages in user directories, but I also |
11 |
> > don't want to duplicate the packages installed globally. For example, |
12 |
> > most packages eventually depend on gcc, which I definitely don't want to |
13 |
> > compile twice. So ideally, only dependencies that are not installed |
14 |
> > globally should be pulled in. |
15 |
> > |
16 |
> > I was not able to find a way of doing that, but I feel like it shouldn't |
17 |
> > be too hard, because EPREFIX almost does what I want. Does someone know |
18 |
> > if it's possible without too much tweaking? |
19 |
> > |
20 |
> > Thanks, |
21 |
> > -François-Xavier |
22 |
> |
23 |
> I'm clueless on EPREFIX but if you want to avoid compiling a package |
24 |
> twice, would the -k option help? If you have portage set to save the |
25 |
> binaries you compiled before, it would install from that instead of |
26 |
> compiling things twice. |
27 |
> |
28 |
> Just thought I'd mention just in case it would help. |
29 |
> |
30 |
> Dale |
31 |
> |
32 |
> :-) :-) |
33 |
|
34 |
The whole concept of EPREFIX is predicated on installing a Gentoo system |
35 |
within a different path/filesystem than the / of the host installation and |
36 |
being able to run it as a non-root user. As I understand it, using libraries |
37 |
from the main system and potentially altering them in the process is not going |
38 |
to work without changing Gentoo's eprefix intended design. |
39 |
|
40 |
It should be possible to change the prefix paths selectively, in particular |
41 |
the LD_LIBRARY_PATH to link binaries from within the prefix to libraries in |
42 |
the host system, but I'm not sure what privileges are needed to install/run |
43 |
such a hybrid linkage and how an update of the host system will break |
44 |
installed packages within the EPREFIX and vice versa. We're talking of a |
45 |
Frankenstein build here with the potential of install operations on one system |
46 |
would be breaking the other, including portage itself. |
47 |
|
48 |
With containerisation of applications there may be easier ways to achieve what |
49 |
François-Xavier is looking for. I am thinking of running sandboxed |
50 |
applications in the likes of flatpack, snap, zero-install, appimage and |
51 |
whatever else may have been devised lately. However, with these systems you |
52 |
end up using what's already been developed and any static libraries their devs |
53 |
considered desirable. If you want a bespoke installation optimised for your |
54 |
hardware and chosen compilation flags, then you are probably looking to |
55 |
develop a containerised application for your own use. |
56 |
|
57 |
Someone more knowledgeable in both Gentoo's EPREFIX project and containerised |
58 |
apps should chime in soon to offer more helpful advice. |