All right, I've in the process of trying to install a prefixed portage in OS X on a MacBook Pro using the instructions found here (The wiki entry is outdated and does not work) and I thought I would start a thread where anyone could post questions and I can list some problems that I have run into and (hopefully) their solutions.

(1) The first problem I ran into was when I was emerging system, specifically I was emerging dev-python/python-fchksum-1.7.1 and I was running into a problem where it tried to install several packages outside of the prefix. I don't have the specific error (sorry) but it was something like "... is outside of prefix". I discovered that this was due to the ebuild trying to install python-fchksum using the wrong python, specifically:

Code:

# which python
/usr/bin/python

Apparently, when python was installed, no symlink was created from python->python2.4 so I

[EDIT] (2, cont.)
During the rebuild of the system (emerge -e system) I found that the unmasked popt-1.7-r1 was refusing to compile, so I removed the lines added to package.mask and package.keywords above, installed popt-1.10 and ran

Code:

# emerge --resume --skipfirst

to resume emerging system, skipping over the now unnecesary popt-1.7.
[/EDIT]

Hopefully this is helpful for anyone trying to get a prefixed portage in OS X. If anyone sees any mistakes in my post or has any better solutions to my problems, please correct me.

Thanks,
Aaron_________________Those who can make you believe in absurdities can make you commit atrocities. --Voltaire

Last edited by tallest on Wed Oct 18, 2006 11:10 pm; edited 1 time in total

!!! died sourcing /Library/Gentoo/usr/portage/eclass/java-utils-2.eclass in inherit()
!!! If you need support, post the topmost build error, and the call stack if relevant.

I solved the problem by editing /Library/Gentoo/usr/portage/eclass/java-utils-2.eclass and replacing the =~ by != on line 1893.

EDIT: I'm assuming here that the =~ was supposed to be a "not equal" but if I'm wrong, please correct me._________________Those who can make you believe in absurdities can make you commit atrocities. --Voltaire

I don't think it should take that long, I can recompile it in a minute or so. Is portage the only thing you're emerging or did it have dependencies? Is it progressing through those dependencies? Did you set any use flags before emerging portage?_________________Those who can make you believe in absurdities can make you commit atrocities. --Voltaire

I'm on 10.4.7 because 10.4.8 breaks matlab's X support. But I don't think that should make a difference here. Is it still going? What is it doing? What kind of output are you seeing? I really can't help without something more than "it just sits there"._________________Those who can make you believe in absurdities can make you commit atrocities. --Voltaire

What makes you think that it's 10.4.8? What exactly is going wrong? What is being emerged? Is there an error?_________________Those who can make you believe in absurdities can make you commit atrocities. --Voltaire

not really sure whats going on, I started it @ 10:21pm, went to sleep, woke up for work and it was sitting there @ 3:50am, with procs going at 80/80 (this is my macbook)

When I get a chance, I'll try it on my Mac Athlon64 to see if I can get any other answers._________________| AMD X2 +3500 1GB DDR2 GeForce 9400GT 256MB XP | **MacBook 2.0Ghz 120GB 2GB OS X.5.2** - Deceased |

At some point, I broke my prefix and ended up deleting the whole thing and starting from scratch. This didn't fix the problem (I can't remember exactly what wasn't working, but I think it was ar). Anyway, I waited a week or so before I checked back at the portage-prefix documentation, lo and behold it has been updated and the new instructions seem to be much more stable than the old ones.

I still ran into one or two problems:

(1*) [etc-update] Everything went well through the svn checkout of the portage tree. I tried doing an etc-update at that point only to find that etc-update was not in my path. I fixed this by adding /Library/Gentoo/usr/lib/portage/bin to the end of my path. Once this was fixed, I was still running into problems with etc-update:

Code:

wilson@motku ~ $ etc-update
Exiting: Need write access to //etc

So etc-update didn't realize that it needed to use the prefix. After looking at the etc-update script, I fixed the problem by adding a line to /Library/Gentoo/etc/env.d/05portage.envd:

and the problem should be fixed. Unfortunately, this requires you to source /Library/Gentoo/etc/profile each time you log in. I made this unnecessary by renaming /etc/profile and creating a symlink to /Library/Gentoo/etc/profile to replace it (I then copied some of the OS X specific stuff from the old /etc/profile into /Library/Gentoo/etc/profile). This is probably a bad idea, and a better solution is needed. I suppose you could just put "source /Library/Gentoo/etc/profile" at the end of Apple's /etc/proifle instead, but unfortunately Gentoo's profile script will overwrite any changes to PATH in Apple's /etc/profile.

(2*) This one is less of a problem and hopefully more of a solution to some difficulty with prefixed portage. After reading the rest of the prefixed portage documentation here (silly me for not RTFM) I found that there is a nice script in /Library/Gentoo/usr/portage/scripts called eapify that modifies ebuilds so that they work with prefixed portage. This is an example showing how I'm trying to add gcc-4.2 to portage:

It's starting to seem like I'm just talking to myself here, but I thought I would report that I successfully compiled gcc-4.2_alpha20061031 using prefixed portage. (gmp required me to put CHOST=none-apple-darwin in make.conf instead of CHOST=i686-apple-darwin8 due to a problem with Apple's assembly syntax)

Overall, I am very pleased with prefixed portage and it seems to be a decent replacement for darwinports or fink (if you can get all the packages you want to compile) but it's definitely not for the faint of heart and I would imagine that you're going to run into one or two problems following the prefixed-portage documentation. That's why I created this thread and I hope I can encourage more people to try it out.

NOTE: If you are going to try it out, I'd recommend doing everything as your normal user, and not as root (unless you have security reasons for needing the Gentoo prefix to be owned by root), this should make it impossible for you to screw up your OS X install. If anything goes wrong, just >rm -rf /Library/Gentoo and everything should be back to normal. On this note, I'd also recommend trying to change as little as possible in any of OS X's personal files (i.e. in /etc/) as it can be kind of picky about this stuff and it will probably get overwritten sooner or later._________________Those who can make you believe in absurdities can make you commit atrocities. --Voltaire

into /Library/Gentoo/etc/portage/package.keywords instead, that way you unmask things in the x86 or ~x86 branches one at a time and if there is a ~x86-macos version of the package, it is used first.

[edit]you will probably need to add other packages (app-editors/vim-core, etc.) into package.keywords as well.

As far as packages outside of the current tree go, it's not that hard to put them into the tree (see my example for gcc-4.2), but some of them require a bit of fiddling (i.e getting the proper etc files into Mac OS X's /etc, I usually back up the old mac etc files then soft link to the ones in /Library/Gentoo/etc/ but this will doubtlessly cause problems eventually if I'm not careful). To get bash-completion working I had to edit quite a few of the config files in /Library/Gentoo/etc so that they used the proper prefix (I'm sure that this could be done in the ebuild using sed or something, and I probably should do this and try to get it submitted to the tree)[/edit]_________________Those who can make you believe in absurdities can make you commit atrocities. --Voltaire

That GCC 4.2 compiles is GREAT. REALLY GREAT! And I can easily update the documentation! I need the feedback!

(ultimate frustration that I just find out now more people are trying it out)

You probably aren't mailing lists persons, but I strongly encourage you to subscribe to gentoo-alt@lists.gentoo.org as all "prefix" related discussions take place there, with messages posted about special OSX support and stuff.

You are not alone, others are using it on their Macs too (like me), and I can use all the feedback I can get!

I hope you didn't give up on it yet._________________Gentoo on a different level

And you can subscribe yourself to the list (also with Mail.app) by following the directions for the gentoo-alt mailing list found here:
http://www.gentoo.org/main/en/lists.xml_________________Gentoo on a different level

So I've started the Install of prefix agian, but it seems that my shit is messed again, now I'm down to emerge -e system, but its telling me that there
emerge: there are no ebuilds to satisfy ">=sys-devel/libperl-5.8.8-r1".

feel like you don't have an up-to-date tree and/or bootstrap script. Are you sure you started from scratch (clean directory) and with the latest (fresh download) bootstrap script?_________________Gentoo on a different level

Well I gave the prefixed portage a spin on my hackintosh (10.4.8 with a 10.4.4 kernel) and it appears to be broken, with perl detection no longer working which prevents wget and portage from being bootstrapped:

This is perl, v5.8.6 built for darwin-thread-multi-2level
(with 3 registered patches, see perl -V for more detail)

So I'm a bit stumped. This is my 10th attempt in a month to get portage working and it keeps going downhill (used to block on emerge -e system). I see the documentation is evolving so I hope there's a way to eventually get this working. I'm not too interested in fink and others.

true, and this error doesn't appear to be my original one. I didn't post after redoing the whole lot, nor did I read it all over. So where's a fresh attempt :

I did the full tree, wget (failed, sed, python, portage procedure and portage *does* bork on perl:

Code:

checking for python... /Library/Gentoo/tmp/usr/bin/python
checking /Library/Gentoo/tmp/usr/bin/python version >= 2.3.1... ok
checking for perl... /usr/bin/perl
checking for perl version greater than or equal to 5.6.0... no
checking for perl5.8.6... (cached) /usr/bin/perl
checking for perl version greater than or equal to 5.6.0... no
configure: error: cannot find a perl version >= 5.6.0

so it is a perl version detection thing if you go the whole way. Sorry for the previous stuff