Find the answer to your Linux question:
Results 1 to 8 of 8
I keep reading that somehow Gentoo is suppose to build things from source. Is that right? But how? I mean, if I try to build something from source in Debian, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User Agent-X's Avatar
    Join Date
    May 2005
    Location
    Dimension X
    Posts
    261

    Question Could someone explain dependency issues in Gentoo?


    I keep reading that somehow Gentoo is suppose to build things from source. Is that right? But how? I mean, if I try to build something from source in Debian, I often come across a ton of problems. What makes gentoo so different?

    I also keep reading it has some kind of "smart" package that figures out the dependencies. Is that true? How is that so? Does it export the output to a type of program that reads the output and determines what to download?

    It's not fool-proof, right? Is it?

    Because if that's true, then I might as well move to gentoo. I mean, what would be the point of all the other Linux distros, besides them being approved by a community?

  2. #2
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,393
    Gentoo has a set of tools that can automatically fetch a package from the internet, configure it and compile it. The set of tools is called portage and its based on the BSD ports system.You would need to read up on portage if you want more details about how it works because its a rather complex system.

    I don't think Gentoo is ideal for everyone and thats why there is always room for other distros. For example, the process of compiling packages from source can take a very long time and can use up quite a lot of system resources. Distros that ship with prebuilt packages don't have that problem.

  3. #3
    Linux Newbie sdimhoff's Avatar
    Join Date
    Jan 2007
    Posts
    191
    I keep reading that somehow Gentoo is suppose to build things from source. Is that right? But how? I mean, if I try to build something from source in Debian, I often come across a ton of problems. What makes gentoo so different?
    The difference is in the package manager, portage. In a superficial way it works just like apt-get for debian in that when you ask to install a package such as koffice, it will check for the current stable package. Then it calculates all dependencies that are necessary and checks them against the other packages you've already got installed. The big difference that comes into play in the way the packages are installed. Instead of binaries, it reads the system specific information that you've put into /etc/make.conf (or things like /etc/portage/package.use). It sends all of that info to your compiler so that it correctly builds the packages according to YOUR specification as opposed to a package MAINTAINER's specification.

    For the gritty details surrounding portage check this link out:

    Gentoo Linux Documentation -- A Portage Introduction

    I also keep reading it has some kind of "smart" package that figures out the dependencies. Is that true? How is that so? Does it export the output to a type of program that reads the output and determines what to download?
    The smarts are all in the package manager. Here is an output if I "pretend" to install koffice

    Code:
     emerge -pv koffice
    
    These are the packages that would be merged, in order:
    
    Calculating dependencies... done!
    [ebuild  N    ] gnome-extra/libgsf-1.14.7  USE="python -bzip2 -debug -doc -gnome" 573 kB 
    [ebuild  N    ] media-gfx/nvidia-cg-toolkit-1.5.0  6,758 kB 
    [ebuild  N    ] x11-libs/fltk-1.1.7-r2  USE="opengl -debug -noxft" 2,013 kB 
    [ebuild  N    ] media-libs/openexr-1.4.0a  USE="opengl -doc -examples" VIDEO_CARDS="nvidia" 9,447 kB 
    [ebuild  N    ] app-text/wv2-0.2.3  888 kB 
    [ebuild  N    ] app-text/libwpd-0.8.9  USE="-doc" 557 kB 
    [ebuild  N    ] app-office/koffice-1.6.3-r2  USE="arts -debug -doc -mysql -postgres -xinerama" 55,498 kB 
    
    Total: 7 packages (7 new), Size of downloads: 75,730 kB
    If this were a brand new install then the list would be considerably longer. However, portage is very flexible so I can ask it to list all packages that would be needed if I were to rebuild all packages and dependencies.

    Finally, portage is not fool-proof, but the developers make it pretty darn close. In 3 years I've never had an instance where portage mis-calculated the depenedencies and most issues come in when you make further customizations or made an error in your own make.conf file.

    You will find that a lot of gentoo users believe that it is the best (reference any forum flame war on the topic), but as always each distro has it's own reasons for performing tasks in the specific way that they do it.

    Hope this helps and hopefully we get another dedicated gentoo user out of this.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux User Agent-X's Avatar
    Join Date
    May 2005
    Location
    Dimension X
    Posts
    261
    See, I was thinking I would be able to download any kind of source and have it compiled into a program. The way people keep talking, it makes me think that the only things that can install as source are the things that are community maintained. Is that true?

    I mean, I want to be able to go anywhere in the Internet, see some weird, miscellaneous source code, and be able to build it without any dependency issues.

    For example, xbindkeys has source code.

    One time, before Debian had a certain version of xbindkeys in a .deb, I had to download the source. So, I use had to build frmo source. Unfortunately, there were some problems, and it didn't install right. It was because there were various source dependency issues. Does gentoo remove this issue? Or does it only remove it in a ommunity-maintained way?

    Could I download the tar.gz from the website, unpack it, and then use a make command without running across dependency issues? Could I do that to any source code?

    As I said before, it looks like people are saying that programs which can be installed from source come from a gentoo website where people have already figured out the source dependencies. If that's true, I don't see how it's much different than what Debian has.

  6. #5
    Linux Newbie sdimhoff's Avatar
    Join Date
    Jan 2007
    Posts
    191
    As I said before, it looks like people are saying that programs which can be installed from source come from a gentoo website where people have already figured out the source dependencies. If that's true, I don't see how it's much different than what Debian has.
    Ah, now we get to the root of your question. The answer is that, no, you cannot simply download any old source and have portage do the dirty work. This is the reason for package managers. I suspect that if someone were to create a program that could decipher what dependencies there were for any given source code then go on to build it for your system, that program would proliferate through the linux community like wildfire. However, you can do some interesting things with overlays in gentoo.

    Gentoo Linux Documentation -- Gentoo Overlays: Users' Guide

    The difference then with portage comes down to what users want their system to do and how they do it. If you build a package from source then the hopes are that you will have not only a speedier* program, but also build in or leave out things such as jpeg or java support. If you don't build from source, then you save time during install or upgrade processes.

  7. #6
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by Agent-X View Post
    I also keep reading it has some kind of "smart" package that figures out the dependencies. Is that true? How is that so? Does it export the output to a type of program that reads the output and determines what to download?
    It is not smart, it just works the way it must.

    Gentoo uses "ebuilds", which are in many senses based on the BSD ports (hence the name of "portage", which is the Gentoo package manager.

    Those ebuilds are basically bash scripts, that with the help of the portage system, can compile anything you want. There are ebuilds for almost anything you can dream of in portage, which are maintained officially by Gentoo.

    There are also lots of so-called, portage overlays, which are maintained by the community, and have lots of ebuilds for things that are not in portage. Sometimes, there are overlays for things that there are in portage, but with additional functionalities, for cvs builds, etc etc... Whatever you can think of. You can easily make an ebuild for anything that is missing, of kindly ask for it in the gentoo forums, and surelly someone will attende your petition. No guarantee of course.

    Additionally, the ebuilds "listen" to a variable called USE, which holds the USE flags, those are used to decide on build time what functionalities are going to be compiled, and which functionalities are not needed and do not need to be compiled. Those USE flags doesn't only control the build flags, they can also control the dependencies. For example, if you decide to build something with USE="svg" the functionality will be activated (provided that program and the ebuild supports it), and the relevant libs (for example, librsvg) will be added to the dependency tree (and automatically compiled and installed as well).

    It's not fool-proof, right? Is it?
    Does such a thing exist?

    It is solid enough. Any inconsistency should be considered a bug and reported in bugs.gentoo.org. ALL the official ebuilds should work out of the box, with zero tweaking on your side. Just set your use flags and emerge.

  8. #7
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by Agent-X View Post
    See, I was thinking I would be able to download any kind of source and have it compiled into a program. The way people keep talking, it makes me think that the only things that can install as source are the things that are community maintained. Is that true?
    I partly answered that in my other post above.

    You can only compile within portage, the stuff that you have an ebuild for. But I would not worry about this. Gentoo has a much wider offer in packages than most distros out there. And that is only with official ebuilds. If we include 3rd party overlays, then the amount of available stuff is simply overwhelming.

    In addition, to write ebuilds is a child's play (though it can be utterly complicated to the infinite if you want). That means that you can always ask for support, for a new ebuild or do it yourself. It is much easier than building binary packages on any other distro.

    I mean, I want to be able to go anywhere in the Internet, see some weird, miscellaneous source code, and be able to build it without any dependency issues.
    Well, if you want a click'n'go distro then gentoo is not for you. You will need to learn a lot, I will not lie to you.

    For example, xbindkeys has source code.

    One time, before Debian had a certain version of xbindkeys in a .deb, I had to download the source. So, I use had to build frmo source. Unfortunately, there were some problems, and it didn't install right. It was because there were various source dependency issues. Does gentoo remove this issue? Or does it only remove it in a ommunity-maintained way?
    In gentoo this issue doesn't exist. The ebuilds contain all the dep info, including minimal versions for dependencies and such. Of course, Gentoo can't guarantee 3rd party ebuilds. That is impossible. But the community support is far better, since the community in general is more knowledgeable (that doesn't mean that there aren't knoledgeable users in other forums, but the volume of info in the gentoo forums in simply exceptional, not to speak about the official documentation).

    Could I download the tar.gz from the website, unpack it, and then use a make command without running across dependency issues? Could I do that to any source code?
    No. That would imply back magic and some doses of divination, which is not physically doable. The dep info can't appear magically out of thin air.

    As I said before, it looks like people are saying that programs which can be installed from source come from a gentoo website where people have already figured out the source dependencies. If that's true, I don't see how it's much different than what Debian has.
    Gentoo can't be explained in a post. And is certainly not for everyone.

  9. #8
    Linux Newbie sdimhoff's Avatar
    Join Date
    Jan 2007
    Posts
    191
    i92guboj hit the nail on the head. I think you need to take a look at what you are asking and what you actually want.

    No distribution or package manager is able to take just any piece of code that you or someone else writes and compile it with all of the dependencies that could possibly exist. Package managers take the software that people use the most and make sure that all of the dependencies are fulfilled (given what support you want built in). If you want to use some software which is not available in that manner just contact your distro's devs to add it to the package tree as i92guboj suggested.

    If however you don't want to go about it that way and want to build it yourself, then the responsibility lies on the user to fulfill the requirements.

    Sorry about the bad news, but I hope everything is cleared up.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •