views:

167

answers:

3

I am trying to install the Perl module Font::FreeType on a CentOS linux box using cpan. I run sudo cpan and inside the cpan shell I run install Font::FreeType. However make fails as follows:

Writing Makefile for Font::FreeType
cp lib/Font/FreeType.pm blib/lib/Font/FreeType.pm
cp lib/Font/FreeType/Face.pm blib/lib/Font/FreeType/Face.pm
cp lib/Font/FreeType/Glyph.pm blib/lib/Font/FreeType/Glyph.pm
/usr/bin/perl /usr/lib/perl5/site_perl/5.8.8/ExtUtils/xsubpp  -typemap /usr/lib/perl5/5.8.8/ExtUtils/typemap -typemap typemap  FreeType.xs > FreeType.xsc && mv FreeType.xsc FreeType.c
gcc -c  -I/usr/include/freetype2 -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables   -DVERSION=\"0.03\" -DXS_VERSION=\"0.03\" -fPIC "-I/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE"   FreeType.c
FreeType.c: In function ‘XS_Font__FreeType_new’:
FreeType.c:425: warning: unused variable ‘class’
FreeType.xs: In function ‘XS_Font__FreeType__Face_has_reliable_glyph_names’:
FreeType.xs:528: warning: implicit declaration of function ‘FT_Has_PS_Glyph_Names’
FreeType.xs: In function ‘XS_Font__FreeType__Glyph_char_code’:
FreeType.xs:808: error: invalid lvalue in assignment

I have googled but can't seem to find any advice on how to solve this issue. I have a feeling something may be corupted with cpane, because when I went to check my version, I was surprised:

# sudo cpan --version
/usr/bin/cpan version [unknown] calling Getopt::Std::getopts (version 1.05 [paranoid]),
running under Perl version 5.8.8.
A: 

It looks like you don't have the freetype development package installed. On the command line try:

yum install freetype-devel

Let that install and then rerun the install for your perl module. (you man need to do clean Font::Freetype first)

Cfreak
Hmmm, just tried that, got `Package freetype-devel-2.2.1-21.el5_3.i386 already installed and latest version`
Josh
A: 

You can always reinstall cpan either by using itself (sudo cpan CPAN), or by manually downloading the CPAN distribution and following the build instructions.

However, generally when you get C-ish compile errors from a CPAN installation, that suggests you might be missing an underlying library. Font::FreeType uses the FreeType2 library; did you install that first? (Is it in /usr/lib/?)

Ether
Yeah, the library is in /usr/lib/...`lrwxrwxrwx 1 root root 21 Jan 20 12:46 /usr/lib/libfreetype.so -> libfreetype.so.6.3.10` -- What's weird is the error is "invalid lvalue in assignment", that sounds to me like an error in the FreeType code, am I incorrect?
Josh
@Josh: yes, or some sort of incompatibility between the FreeType library, the version of the XS layer you downloaded, and Perl itself. This probably warrants contacting the Font::FreeType author directly (or filing a bug report via rt.cpan.org against the module).
Ether
@Ether: Thanks!
Josh
+1  A: 

See http://rt.cpan.org/Public/Dist/Display.html?Name=Font-FreeType, the RT queue has patches you can apply to make the module build correctly.

Ether and Cfreak were guessing wrong, it's simply a bug due to bitrot in Font::FreeType.

daxim
That was exactly what I was googling for and couldn't find for some reason. Thanks!!
Josh