views:

128

answers:

2

Is there a way to satisfy a certain port dependency with another package (than the specified one) in MacPorts? More specifically, to use the package XYZ-devel instead of just XYZ for a second port that requires XYZ?

Thanks in advance.

+1  A: 

You can use the "port variants" command to display the list of available variants for a given port. Ex:

[michaelsafyan@codemage ~]$ port variants ffmpeg
ffmpeg has the variants:
   darwin_10: Platform variant, selected automatically
   no_gpl: disallow use of GPL code, license will be LGPL
   no_mmx: disable all x86 asm optimizations
   speex: enable Speex decoding via libspeex

You can then use "+variantname" to activate or "-variantname" to deactivate a given variant for the install (for example, one can use "sudo port install ffmpeg +speex" to install ffmpeg with the speex variant). This is the only way (that won't break MacPorts) that you can select between different configurations and dependencies.

Michael Aaron Safyan
+1  A: 

If the -devel port is not offered as a variant, then the only way is to edit the Portfile.

$ sudo port edit $the_port

will open the specified port in an editor. You can change the dependency from the release port to the -devel port there.

Note that:

  1. This may break the port, since it may not work with the -devel version (unlikely, but possible).
  2. Your changes to the Portfile will get reverted anytime you do a port selfupdate. If you don't want to have to "fix" the Portfile each time you update, you may want to set up a local Portfile repository.
mipadi
Thanks for the tip. What I do now is copying the X-devel port to my local repository, and renaming it to X. Additionally, I download the patches to that directory so that it finds them (otherwise it would attempt to download them from the directory of the X-devel port on the server).
Johannes