Install perl package Cairo

Cairo is a dependency for the perl extension Gtk3.

Trying to install the module on Debian:

 #cpanm Cairo
--> Working on Cairo
Fetching http://www.cpan.org/authors/id/X/XA/XAOC/Cairo-1.105.tar.gz ... OK
Configuring Cairo-1.105 ... N/A
! Configure failed for Cairo-1.105. See /root/.cpanm/build.log for details.

Trying with cpan to check:

#cpan
Loading internal null logger. Install Log::Log4perl for logging messages
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v2.10)
Enter 'h' for help.

cpan[1]> install Cairo
Running install for module 'Cairo'
Fetching with LWP:
http://cpan.mirror.vexxhost.com/authors/id/X/XA/XAOC/Cairo-1.105.tar.gz
Fetching with LWP:
http://cpan.mirror.vexxhost.com/authors/id/X/XA/XAOC/CHECKSUMS
Checksum for /root/.cpan/sources/authors/id/X/XA/XAOC/Cairo-1.105.tar.gz ok
Scanning cache /root/.cpan/build for sizes
............................................................................DONE
Configuring X/XA/XAOC/Cairo-1.105.tar.gz with Makefile.PL
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
 at Makefile.PL line 99.
*** can not find package cairo >= 1.0.0
*** check that it is properly installed and available in PKG_CONFIG_PATH
 at Makefile.PL line 99.
No 'Makefile' created  XAOC/Cairo-1.105.tar.gz
  /usr/bin/perl Makefile.PL INSTALLDIRS=site -- NOT OK
Failed during this command:
 XAOC/Cairo-1.105.tar.gz                      : writemakefile NO -- No 'Makefile' created

You need to install the apt package libcairo2-dev:

apt-get install libcairo2-dev

Now try again:

#cpanm Cairo
--> Working on Cairo
Fetching http://www.cpan.org/authors/id/X/XA/XAOC/Cairo-1.105.tar.gz ... OK
Configuring Cairo-1.105 ... OK
Building and testing Cairo-1.105 ... OK
Successfully installed Cairo-1.105
1 distribution installed

Install of Gtk3 failed with:

 at Makefile.PL line 105.
No package 'gobject-introspection-1.0' found
to the PKG_CONFIG_PATH environment variable
Perhaps you should add the directory containing `gobject-introspection-1.0.pc'
Package gobject-introspection-1.0 was not found in the pkg-config search path.

Install:

apt-get install libgirepository1.0-dev

Another dependency for the Gtk3 module is libgtk-3-dev

apt-get install libgtk-3-dev

You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.