Question regarding lib dependencies, esp gettext

Ryan Schmidt ryandesign at macports.org
Wed Feb 27 11:16:02 PST 2008


On Feb 27, 2008, at 12:42, David Bruce wrote:

> I recently contributed a port for tuxmath.  It uses gettext and  
> iconv for
> i18n, as well as SDL and friends.  The currently listed  
> dependencies are as
> follows:
>
> depends_lib         port:libsdl \
>                           port:libsdl_image \
>                           port:libsdl_mixer \
>                           port:libsdl_ttf \
>                           port:gettext
>
> I'm wondering if I need to list gettext - it is not needed for "./ 
> configure;
> make; make install" for my package.  Gettext is needed to run a  
> "make dist"
> on tuxmath, but that isn't part of the MacPorts install process, so  
> I don't
> think gettext is needed as either a "depends_lib" or "depends_build".
>
> At runtime, tuxmath does need both gettext and iconv, but they seem  
> to be
> included with Leopard itself.  However, I can't say for sure if  
> they were
> present before I installed XCode.
>
> I take it that Portfiles do not need to list standard system  
> libraries as
> dependencies - do gettext and iconv fall into this category?  If  
> so, I plan
> to just eliminate gettext from my list of dependencies.

It is MacPorts policy to use its own software, not system software,  
wherever possible. See the FAQ:

http://trac.macosforge.org/projects/macports/wiki/ 
FAQ#WhyisMacPortsusingitsownlibraries

I just installed tuxmath 1.6.1_1 and it does indeed link with gettext  
and libiconv as libraries:

$ otool -L /opt/local/bin/tuxmath
/opt/local/bin/tuxmath:
         /opt/local/lib/libintl.8.dylib (compatibility version 9.0.0,  
current version 9.2.0)
         /opt/local/lib/libiconv.2.dylib (compatibility version  
7.0.0, current version 7.0.0)
         /usr/lib/libSystem.B.dylib (compatibility version 1.0.0,  
current version 88.3.9)
         /System/Library/Frameworks/CoreFoundation.framework/Versions/ 
A/CoreFoundation (compatibility version 150.0.0, current version  
368.32.0)
         /opt/local/lib/libSDL-1.2.0.dylib (compatibility version  
12.0.0, current version 12.2.0)
         /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa  
(compatibility version 1.0.0, current version 11.0.0)
         /opt/local/lib/libSDL_image-1.2.0.dylib (compatibility  
version 2.0.0, current version 2.5.0)
         /opt/local/lib/libSDL_mixer-1.2.0.dylib (compatibility  
version 3.0.0, current version 3.6.0)
         /opt/local/lib/libSDL_ttf-2.0.0.dylib (compatibility version  
7.0.0, current version 7.3.0)
$

(You see libiconv.2.dylib, and gettext is libintl.8.dylib.)

Therefore both port:libiconv and port:gettext should be listed as  
library dependencies of tuxmath. (Though gettext itself depends on  
libiconv, so you only need to list libiconv as a dependency of  
tuxmath if tuxmath uses libiconv independently of gettext. I'm not  
sure how to determine whether this is the case, other than asking the  
tuxmath developers or delving into the tuxmath source code.)



More information about the macports-dev mailing list