#
# $Header: /home/scott/lib/cvsroot/Gtk2-Html2/Makefile.PL,v 1.2 2004/04/01 16:20:44 scott Exp $
#
use strict;
use 5.008;
use ExtUtils::MakeMaker;
use Cwd;
use File::Spec;
# minimum required version of dependencies we need to build
our %build_reqs = (
'perl-ExtUtils-Depends' => '0.200',
'perl-ExtUtils-PkgConfig' => '0.1',
'perl-Glib' => '1.04',
'perl-Gtk2' => '1.00',
'gtkhtml2' => '2.4.0',
);
# Writing a fake Makefile ensures that CPAN will pick up the correct
# dependencies and install them.
unless (eval "use ExtUtils::Depends '$build_reqs{'perl-ExtUtils-Depends'}';"
. "use ExtUtils::PkgConfig;"
# just seeing if Glib is available isn't enough, make sure
# it's recent enough, too
. "use Glib '$build_reqs{'perl-Glib'}';"
. "use Glib::MakeHelper;"
. "use Gtk2 '$build_reqs{'perl-Gtk2'}';"
. "use Gtk2::CodeGen;"
. "1") {
warn "$@\n";
WriteMakefile(
PREREQ_FATAL => 1,
PREREQ_PM => {
Glib:: => $build_reqs{'perl-Glib'},
Gtk2:: => $build_reqs{'perl-Gtk2'},
ExtUtils::Depends:: => $build_reqs{'perl-ExtUtils-Depends'},
ExtUtils::PkgConfig:: => $build_reqs{'perl-ExtUtils-PkgConfig'},
},
);
exit 1; # not reached
}
my %pkgcfg = ExtUtils::PkgConfig->find ('libgtkhtml-2.0 >= '
. $build_reqs{gtkhtml2});
mkdir 'build', 0777;
#
# autogeneration
#
Gtk2::CodeGen->parse_maps ('gtkhtml2perl');
Gtk2::CodeGen->write_boot (ignore => '^Gtk2::Html2$');
our @xs_files = ;
our %pm_files = ('Html2.pm' => '$(INST_LIBDIR)/Html2.pm',);
our %pod_files = Glib::MakeHelper->do_pod_files (@xs_files);
# now we're ready to start creating the makefile.
# we need to use ExtUtils::Depends to get relevant information out of
# the Glib extension, and to save config information for other modules which
# will chain from this one.
my $gtkhtml2 = ExtUtils::Depends->new ('Gtk2::Html2', 'Gtk2');
$gtkhtml2->set_inc ($pkgcfg{cflags});
$gtkhtml2->set_libs ($pkgcfg{libs});
$gtkhtml2->add_xs (@xs_files);
$gtkhtml2->add_pm ('Html2.pm' => '$(INST_LIBDIR)/Html2.pm');
my $cwd = cwd();
$gtkhtml2->add_typemaps (map {File::Spec->catfile($cwd,$_)} 'build/gtkhtml2perl.typemap');
$gtkhtml2->install (qw(gtkhtml2perl.h build/gtkhtml2perl-autogen.h));
$gtkhtml2->save_config ('build/IFiles.pm');
WriteMakefile(
NAME => 'Gtk2::Html2',
VERSION_FROM => 'Html2.pm', # finds $VERSION
ABSTRACT => 'Perl bindings for the 2.x series of the GtkHtml2 widget',
XSPROTOARG => '-noprototypes',
MAN3PODS => \%pod_files,
$gtkhtml2->get_makefile_vars,
);
sub MY::postamble {
return Glib::MakeHelper->postamble_clean ()
. Glib::MakeHelper->postamble_docs_full (
DEPENDS => $gtkhtml2,
COPYRIGHT => "Copyright (C) 2003-2004 by the Gtk2-Perl Team.\n\nThis software is licensed under the LGPL; see L for a full notice.",
)
. Glib::MakeHelper->postamble_rpms (
'GTK_HTML2' => $build_reqs{'gtkhtml2'},
'PERL_EXTUTILS_DEPENDS' =>
$build_reqs{'perl-ExtUtils-Depends'},
'PERL_EXTUTILS_PKGCONFIG' =>
$build_reqs{'perl-ExtUtils-PkgConfig'},
'PERL_GLIB' => $build_reqs{'perl-Glib'},
'PERL_GTK' => $build_reqs{'perl-Gtk2'},
);
}