File: Build.PL

package info (click to toggle)
libimage-imlib2-perl 2.03-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 324 kB
  • sloc: perl: 305; ansic: 112; makefile: 10
file content (41 lines) | stat: -rw-r--r-- 1,142 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use Module::Build;
use strict;
use Cwd;
use ExtUtils::PkgConfig ;

my $pkg = 'imlib2';
my %info = ExtUtils::PkgConfig->find ($pkg) ;
my $version = $info{modversion} ;
my $libs    = $info{libs} ;
my $cflags  = $info{cflags} ;

if (!$version) {
  warn 'You must install the imlib2 library before you can install
Image::Imlib2. You can obtain imlib2 from
http://sourceforge.net/projects/enlightenment/

Alternatively, if you have downloaded and installed imlib2 and this
still will not work, modify the $CONFIG variable inside Build.PL to
point to the imlib2-config program that provides.
';
  exit 1;
} else {
  print "Found imlib2 $version\n";
}

$cflags = "-DX_DISPLAY_MISSING " . $cflags . "-ffile-prefix-map=" . getcwd() . "=." ;

my $build = Module::Build->new(
  c_source     => './lib/Image',
  create_makefile_pl => 'passthrough',
  extra_compiler_flags => $cflags,
  extra_linker_flags => $libs,
  license     => 'perl',
  module_name => 'Image::Imlib2',
  requires    => {
    'Module::Build' => '0.20',
    'Test::More' => '0.01',
  },
  add_to_cleanup => [qw( t/test1.jpg t/test2.jpg t/test3.jpg )],
);
$build->create_build_script;