Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Macport skip dependency

Tags:

macports

Is it possible to install a port also if a dependency fails to build?

I mean, I have to install texlive and it requires a lot of dependency and one on those (py26-libxml2) fails to build. Is there a way to skip it?

I know that it is no safe, but I need it and I don't want to install tex with MacTex.

Thanks, Luca

like image 324
Maverik Avatar asked Aug 18 '11 07:08

Maverik


2 Answers

Note before starting: removing the dependency may break the build, so be prepared to do troubleshooting. There's no guarantee of success of course. Google may help with build errors, but that will only go so far. Perhaps you should try to figure out why py26-libxml2 is failing first.

Editing dependencies

Looks like you can edit the dependency list. The catch is that you already have to know what depends on py26-libxml2. You could use

port rdeps texlive

to see a basic tree, but each port will only appear once unless you use --full, which takes forever for texlive.

Once you've located the dependent, you can change its dependencies locally via the downloaded Portfile.

sudo port edit PORTNAME

You should then remove the dependency from depends_lib or depends_lib-append. I don't know much about the format so...

You should back up this file before editing. Its location is found via

port file PORTNAME

After editing, you can run rdeps again to see if any other dependency uses the one you want to omit.

like image 50
Kelvin Avatar answered Dec 11 '22 08:12

Kelvin


Sometimes you can install a port variant without the unwanted dependency.

For example, let's say we're looking to install libsdl2_image without the whole x11.

port deps libsdl2_image and further port deps ... reveal that it's libgif that depends on x11 and has a +x11 (and -x11, which is more important!) variant.

sudo port install giflib -x11 didn't immediately help, but yielded:

Error: Please use the same variants again, or run 'port clean giflib' first to remove the existing partially completed build.

Next,

sudo port clean giflib
sudo port install giflib -x11

did it: now sudo port install libsdl2_image doesn't install x11.

And last but not the least:

From: Ryan Schmidt:

If there's a wrong dependency in a port (or any other error in a port), we want the error reported to the maintainer and/or a bug created in the issue tracker so that it can be fixed.

like image 28
Victor Sergienko Avatar answered Dec 11 '22 07:12

Victor Sergienko