View previous topic :: View next topic |
Author |
Message |
ZekeMorrin n00b


Joined: 15 Oct 2023 Posts: 23
|
Posted: Fri Apr 12, 2024 11:53 am Post subject: Gentoo Prefix on Debian |
|
|
Hello dear Gentoo community I have a question regarding using Gentoo prefix on other Linux environments;
I'm currently using Gentoo prefix on Debian Testing, I just want to know that if adding $PREFIX/usr/bin to my PATH is a very bad idea and horribly break stuff?
Because I really prefer using the programs installed through portage in my Debian environment without entering my $PREFIX/usr/bin folder manually unless it's breaking stuff.
Also, is it possible to add not the entire #PREFIX/usr/bin but single programs like lets say $PREFIX/usr/bin/npm and $PREFIX/usr/bin/node and such?
Second option would be more convenient if it's possible, and if so how can I do it?
Thanks! |
|
Back to top |
|
 |
LiamOS n00b


Joined: 06 Jun 2012 Posts: 67 Location: Ireland
|
Posted: Mon Apr 15, 2024 9:41 am Post subject: |
|
|
Doing this will probably work some of the time in some cases, but in general I think it's likely to either not work properly or make the terminal unusable.
Your host system probably has a different glibc among other things, so running gentoo binaries against that will likely fail. If you edit the LD_LIBRARY_PATH to include the correct libraries then your host executables will be unhappy. _________________ CFLAGS=" -O999999" |
|
Back to top |
|
 |
ZekeMorrin n00b


Joined: 15 Oct 2023 Posts: 23
|
Posted: Mon Apr 15, 2024 12:20 pm Post subject: |
|
|
Thanks for the heads up LiamOS, so using the portage-installed programs inside prefix is the safest way, good to know! |
|
Back to top |
|
 |
Hu Administrator

Joined: 06 Mar 2007 Posts: 23280
|
Posted: Mon Apr 15, 2024 2:51 pm Post subject: |
|
|
The programs ought to work the same whether you cd into $PREFIX/usr/bin and use ./program versus if you invoke them by full path. Either way, the important thing is that they use the Gentoo libraries, not the Debian ones. That should be independent of how you invoke them, and of your $PATH.
If you want to use only select programs, you have two options. First, you could set up a directory such as ~/gentoo/bin, put that on your $PATH, and populate it with symlinks to the programs in $PREFIX/usr/bin. Second, you could define shell functions named npm(), node(), etc. that are implemented as: Code: | npm() {
"$GENTOO_PREFIX/usr/bin/$FUNCNAME" "$@"
} | The latter approach has the effect that a program which runs a bare npm will not find this function (because functions cannot be found via $PATH lookup), and will instead delegate to Debian. That may or may not be desirable, depending on whether you want your scripts to find Gentoo programs when available (use choice 1) or not (use choice 2). You could even mix and match, defining some Gentoo programs via the special $PATH symlinks and others as shell functions. This might be useful if some of the Gentoo programs have notably different behaviors from their corresponding Debian versions, and so you need scripts that you share with other Debian users to continue using the Debian versions of such tools. |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|