Lucretia wrote:131 views and nothing? I can only assume nobody cares about Ada on Gentoo then?
Actually, I hadn't seen your message. It's not every time I look in the Portage & Programming forum. Since it gets a lot of traffic, new topics can get buried pretty quickly.
In any event, a few months ago I looked at building an Ada package not only on Gentoo (the easy part) but also for portability to other OS's, including Mac OSX. (Man, am I ever glad I don't use that routinely!) I got hung up trying to figure out what I should do for strings. There were three basic strings packages to work through, but I didn't know enough of the language to sort out well what would be the best to use
What I didn't do was look very far into how gnat-gcc gets built, let alone gnat-gpl, which I never tried.
As to your question as to why there is no ada USE flag whereas there is one for cxx, fortran, go, and gcj, I suspect that the reason is that gnat has to be bootstrapped: the source for the Ada compiler is written in Ada. Bootstrapping is a bit tricky. The eclass that supports the gnat ebuilds (/usr/portage/eclass/gnatbuild.eclass) is 24k long, making it longer than the average eclass. (Eclasses are include files for ebuilds.) The gnatboot tarballs required for bootstrapping are more than 20 megabytes long. I see that gnat-gpl uses that same eclass.
In case you hadn't guessed, bootstrapping is how one gets around the chicken-and-egg problem implicit in a self-hosted language. The first stage for building the compiler is to make an interpreter or simple compiler for the language using a compiler for an available language (typically C). This gets you a compiler or interpreter that usually lacks features and is inefficient. The build process then uses this compiler generate something that is fiinally usable--or maybe requires another iteration or two to get to usability. Finally, with the target compiler in place, the build system is now in a position to build the language's standard libraries. I haven't looked through gnatboot, but I'm sure that's what explains its complexity. What I don't know is why the bootstrap-process' intermediate stages would be installed in the final emerge except that they are useful somehow in the production environment.
Another element complicating the ebuilds is that there are separate per-architecture patches. These *might* be unnecessary in later versions of Ada, but I don't know.
You asked about installing gnat-gpl alongside gnat-gcc. That kind of installation ought to work OK when the two packages happen to refrain from installing any file to a path that the other one uses, but this pair of packages can't do that: they both need to expose commands like
gnat and
gnatbind, after all. Gentoo does offer a way out, though. There is an eselect module that lets you change from one gnat provider to another. You
can have gnat-gcc and gnat-gpl installed at the same time. Here is a command I ran on machine with its output shown:
Code: Select all
mike@host ~ $ eselect gnat list
Available gnat compilers:
[1] x86_64-pc-linux-gnu-gnat-gcc-4.3 *
If I had gnat-gpl, that would show up on the list also. The asterisk indicates the active version.
One thing I have not been able to tell so far is where you would find Ada 2012 support. My guess off hand is that gnat-gpl is more likely to have it than gnat-gcc. The announcements at adacore point to gnat-gpl's having v 2012 support even if the editions FAQ does not indicate this. Does gcc also support Ada 2012? When you refer to 4.9, do you mean gcc or gnat-gpl?
Lucretia wrote:Seems there aren't many Ada developers for Gentoo
It seems to me that there aren't a whole lot of Ada developers period, let alone in Gentoo. Gentoo is, itself, on the relative fringe. So yes, you're multiplying two small fractions.

That said, I don't know what might keep Ada developers away from using Gentoo except what would be the deal-killer: iffy compiler support. So let's look for a remedy.
Oftentimes ebuilds will work pretty much unchanged from one version of a package or another, but sometimes not. The gnat-gcc-4.5.4 ebuild is not awfully different from the 4.6.4 ebuild, but the error message you found indicates that there should likely be some larger difference. It's accounting for such changes that can make ebuilds "fun" to maintain.
I haven't tried it out, but maybe something I can do in the next day or so is try setting up a later version of gnat in an overlay and seeing how I come out with the ebuild. I'm not super-experienced in this, but I can try my luck.
What would help to know is where you got your packages. For gnat-gcc, this means knowing what versions of GCC have Ada 2012 support (if any do) and, importantly, if these GCC versions are stable in Gentoo. For gnat-gpl, that means knowing if I can get the source tarballs without signing my life away. I don't know if you've heard of fetch restrictions. That's the unhappy fact of life that some upstreams have chosen to make it so that Portage can't simply download the tarballs: the user must go through manual license-agreement or registration steps before getting the goods.