2011-01-03

FreeBSD - Port p5-Encode-Detect error

While patching one of the FreeBSD box, a perl module port, converters/p5-Encode-Detect-1.01, failed to compile. This is the abstract of the error message :







===>  Extracting for p5-Encode-Detect-1.01
=> SHA256 Checksum OK for Encode-Detect-1.01.tar.gz.
===>   p5-Encode-Detect-1.01 depends on file: /usr/local/bin/perl5.8.9 - found
===>  Patching for p5-Encode-Detect-1.01
===>   p5-Encode-Detect-1.01 depends on file: /usr/local/bin/perl5.8.9 - found
===>   p5-Encode-Detect-1.01 depends on file: /usr/local/lib/perl5/site_perl/5.8.9/ExtUtils/CBuilder.pm - found
===>   p5-Encode-Detect-1.01 depends on file: /usr/local/lib/perl5/site_perl/5.8.9/Module/Build.pm - found
===>   p5-Encode-Detect-1.01 depends on file: /usr/local/bin/perl5.8.9 - found
===>  Configuring for p5-Encode-Detect-1.01
Warning: ExtUtils::CBuilder not installed or no compiler detected
Proceeding with configuration, but compilation may fail during Build

Creating new 'MYMETA.yml' with configuration results
Creating new 'Build' script for 'Encode-Detect' version '1.01'
===>  Building for p5-Encode-Detect-1.01
Building Encode-Detect
Error: no compiler detected to compile 'src/LangBulgarianModel.cpp'.  Aborting
*** Error code 2

Stop in /usr/ports/converters/p5-Encode-Detect.

It seems like the port devel/p5-ExtUtils-CBuilder didn't quite compile it's option and installed properly. Reinstalling devel/p5-ExtUtils-CBuilder didn't help. Re-compile all of the dependency of converters/p5-Encode-Detect & devel/p5-ExtUtils-CBuilder also didn't work as well.

The error message does strongly suggest that there's problem with devel/p5-ExtUtils-CBuilder. It's time to get my hands dirty, by manually compiling the port devel/p5-ExtUtils-CBuilder :
  1. Go into the port devel/p5-ExtUtils-CBuilder :
    cd /usr/port/devel/p5-ExtUtils-CBuilder
  2. Clean up the files previously compiled :
    make clean
  3. Unpack the program into the ports directory :
    make extract
  4. Enter the working directory :
    cd work
  5. Prepare the make file for this perl module :
    perl Makefile.PL
  6. Compile this perl module using ports :
    make

At the end of this compile, there's a error messages :
Warning: prerequisite IPC::Cmd 0 not found.
Ah ha, another perl module is needed but this port didn't make it as a dependency.


Searching through the ports and found this needed perl module, devel/p5-IPC-Cmd :
make quicksearch name=ipc-cmd

Install the devel/p5-IPC-Cmd port, to fulfill the dependency :
portupgrade -Nv devel/p5-IPC-Cmd

After finishing installing the devel/p5-IPC-Cmd port, proceed to install devel/p5-ExtUtils-CBuilder :
portupgrade -vr devel/p5-ExtUtils-CBuilder

Since all compile fine, continue the patching :
portupgrade -var

Voilla !!!

1 comment:

Andrej Zverev said...

In fact, FreeBSD uses the Perl 5.10 by default and there no testing with obsolete perl. Correct solution will be to upgrade your Perl.
%corelist IPC::Cmd

IPC::Cmd was first released with perl 5.009005