Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Unsupported Software
  • Search

Gentoo Prefix on Debian

This forum covers all Gentoo-related software not officially supported by Gentoo. Ebuilds/software posted here might harm the health and stability of your system(s), and are not supported by Gentoo developers. Bugs/errors caused by ebuilds from overlays.gentoo.org are covered by this forum, too.
Post Reply
Advanced search
4 posts • Page 1 of 1
Author
Message
ZekeMorrin
n00b
n00b
User avatar
Posts: 29
Joined: Sun Oct 15, 2023 2:18 pm
Contact:
Contact ZekeMorrin
Website

Gentoo Prefix on Debian

  • Quote

Post by ZekeMorrin » Fri Apr 12, 2024 11:53 am

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!
Top
LiamOS
n00b
n00b
User avatar
Posts: 67
Joined: Wed Jun 06, 2012 2:42 pm
Location: Ireland

  • Quote

Post by LiamOS » Mon Apr 15, 2024 9:41 am

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"
Top
ZekeMorrin
n00b
n00b
User avatar
Posts: 29
Joined: Sun Oct 15, 2023 2:18 pm
Contact:
Contact ZekeMorrin
Website

  • Quote

Post by ZekeMorrin » Mon Apr 15, 2024 12:20 pm

Thanks for the heads up LiamOS, so using the portage-installed programs inside prefix is the safest way, good to know!
Top
Hu
Administrator
Administrator
Posts: 24383
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Mon Apr 15, 2024 2:51 pm

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: Select all

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.
Top
Post Reply

4 posts • Page 1 of 1

Return to “Unsupported Software”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy