Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid installing unnecessary dependencies with MacPorts?

I've tried to get postgresql 8.4 via MacPorts (on Snow Leopard) but it seems that the dependencies are endless - including getting older version of stuff that is already available in Snow Leopard, kitchen-sink and who knows if eventually I end up with windows 7 ...

Is there a way to get only those dependancies absolutely necessary to run stuff from command line in Mac?

Especially I'm trying to avoid installing old version of python, Xorg packages and so on.

Any ideas? So far it seems that it is better to avoid MacPorts altogether.

like image 555
stefanB Avatar asked Oct 02 '09 12:10

stefanB


2 Answers

Looking at the port file for postgresql84, the +python variant for it actually means python2.5. Most of the dependencies you find annoying are probably being brought in by the python tkinter module dependency on Tk which by default builds an X11 version of Tk rather than the +quartz variant. You can change that by specifying that variant and reinstalling. The easy way to deal with variants is to add the options you normally want to use as defaults to those in /opt/local/etc/macports/variants.conf.

Unfortunately, at the moment, the tk +quartz variant build is broken on Snow Leopard. So, if you are not planning to use tkinter (or IDLE) with the MacPorts python2.5, you can force the removal after the fact of the unwanted modules:

port installed
port -f uninstall tk Xft2 xorg-libX11 ...

You might want to first do a dry-run by adding the -y option to see exactly what the effects of the uninstall will be.

Note, the python26 port has a handy +no_tkinter variant which could be useful once the portgresql ports are upgraded to python2.6.

like image 53
Ned Deily Avatar answered Sep 27 '22 22:09

Ned Deily


It's potentially a bit of grunt work (and definitely violates Occam's razor for this particular scenario)... but if you're positive you know which dependencies you don't want/need, they can always be passed as hyphen-delimited args after the port call:

port install sweetPort -depYouDontWant -depYouDontNeed ...

I know it's been a while since the OP, but I hope this helps... somebody.

like image 28
Eric Humphrey Avatar answered Sep 27 '22 22:09

Eric Humphrey