Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: Fail to pp cairo, pango on windows

by Anonymous Monk
on Nov 24, 2009 at 12:10 UTC ( [id://809059]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Fail to pp cairo, pango on windows
in thread Fail to pp cairo, pango on windows

You don't want libcairo.dll.a What you want is to use lisdlls (or dependencywalker) to find which dlls are loaded, which for me turned out to be
-l libglib-2.0-0.dll -l libgobject-2.0-0.dll -l libgthread-2.0-0.d +ll -l libcairo-2.dll -l libfontconfig-1.dll -l libexpat-1.dll -l +freetype6.dll -l libpng12-0.dll -l zlib1.dll -l libpango-1.0-0.dll + -l libgmodule-2.0-0.dll -l libpangocairo-1.0-0.dll -l libpangoft2 +-1.0-0.dll -l libpangowin32-1.0-0.dll -l libatk-1.0-0.dll -l libgd +k-win32-2.0-0.dll -l libgdk_pixbuf-2.0-0.dll -l libgio-2.0-0.dll - +l libgtk-win32-2.0-0.dll -l intl.dll
But that didn't work
with
$ pmvers PAR PAR::Packer PAR: 0.994 PAR::Packer: 1.000
i still encounter the Cairo.dll renaming problem. So after visiting peculiarities.com and rt.cpan.org, I modified buildEXE.pl instead of patching Module::ScanDeps
#!/perl/bin/perl -w use strict; use FindBin; use pp; use Module::ScanDeps; # This subroutine relies on not being called for modules that have alr +eady been visited sub Module::ScanDeps::add_deps { package Module::ScanDeps; my %args = ((@_ and $_[0] =~ /^(?:modules|rv|used_by|warn_missing)$/) ? @_ : (rv => (ref($_[0]) ? shift(@_) : undef), modules => [@_])); my $rv = $args{rv} || {}; my $skip = $args{skip} || {}; my $used_by = $args{used_by}; foreach my $module (@{ $args{modules} }) { my $file = _find_in_inc($module) or _warn_of_missing_module($module, $args{warn_missing}), ne +xt; next if $skip->{$file}; if (exists $rv->{$module}) { _add_info( rv => $rv, module => $module, file => $file, used_by => $used_by, type => undef ); next; } my $type = _gettype($file); _add_info( rv => $rv, module => $module, file => $file, used_by => $used_by, type => $type ); if ($module =~ /(.*?([^\/]*))\.p[mh]$/i) { my ($path, $basename) = ($1, $2); foreach (_glob_in_inc("auto/$path")) { next if $_->{file} =~ m{(Glib)|(Cairo)|(Gtk2)|(GladeXM +L)} and $^O eq 'MSWin32'; next if $_->{file} =~ m{\bauto/$path/.*/}; # weed out + subdirs next if $_->{name} =~ m/(?:^|\/)\.(?:exists|packlist)$ +/; my ($ext,$type); $ext = lc($1) if $_->{name} =~ /(\.[^.]+)$/; if (defined $ext) { next if $ext eq lc(lib_ext()); $type = 'shared' if $ext eq lc(dl_ext()); $type = 'autoload' if ($ext eq '.ix' or $ext eq '. +al'); } $type ||= 'data'; _add_info( rv => $rv, module => "auto/$pat +h/$_->{name}", file => $_->{file}, used_by => $module, type => $type ); } } } # end for modules return $rv; } my $version = '1.0.0'; my $script = "$FindBin::Bin/test.pl"; my @libs = qw( Cairo/Cairo.dll Pango/Pango.dll Glib/Glib.dll Gtk2/Gtk2.dll Gtk2/GladeXML/GladeXML.dll ); @ARGV = (); push (@ARGV, '-z'); push (@ARGV, '9'); #~ push (@ARGV, '--gui'); push (@ARGV, '-N'); push (@ARGV, "ProductVersion=$version"); push (@ARGV, '-N'); push (@ARGV, "FileVersion=$version"); push @ARGV, qw! -l libglib-2.0-0.dll -l libgobject-2.0-0.dll -l libg +thread-2.0-0.dll -l libcairo-2.dll -l libfontconfig-1.dll -l libex +pat-1.dll -l freetype6.dll -l libpng12-0.dll -l zlib1.dll -l libp +ango-1.0-0.dll -l libgmodule-2.0-0.dll -l libpangocairo-1.0-0.dll +-l libpangoft2-1.0-0.dll -l libpangowin32-1.0-0.dll -l libatk-1.0-0 +.dll -l libgdk-win32-2.0-0.dll -l libgdk_pixbuf-2.0-0.dll -l libgi +o-2.0-0.dll -l libgtk-win32-2.0-0.dll -l intl.dll !; for my $file (@libs) { for my $dir (@INC) { my $lib = "$dir/auto/$file"; if (-f $lib) { push (@ARGV, '-l'); push (@ARGV, $lib); last; } } } push (@ARGV, '-o'); push (@ARGV, "$FindBin::Bin/test.exe"); push (@ARGV, "$script"); pp->go();
and resulting test.exe now dies with with
GLib-GObject-CRITICAL **: g_boxed_type_register_static: assertion `g_t +ype_from_name (name) == 0' failed at C:/perl/5.10.1/lib/MSWin32-x86-m +ulti-thread/DynaLoader.pm line 223. GLib-GObject-CRITICAL **: g_boxed_type_register_static: assertion `g_t +ype_from_name (name) == 0' failed at C:/perl/5.10.1/lib/MSWin32-x86-m +ulti-thread/DynaLoader.pm line 223. cannot register alias Gtk2::Pango::Attribute for the unregistered type + (null) at C:/perl/5.10.1/lib/MSWin32-x86-multi-thread/DynaLoader.pm +line 223. Compilation failed in require at script/test.pl line 11. BEGIN failed--compilation aborted at script/test.pl line 11.
It seems like PAR/Gtk2-perl teams could use an infusion of cash :)

You should use the Cava packager, I've tested it just now and it worked.

Replies are listed 'Best First'.
Re^4: Fail to pp cairo, pango on windows
by llancet (Friar) on Nov 27, 2009 at 01:02 UTC
    The Cava also don't work, with same error message...
      Hmm, well it works for me :/

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://809059]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-03-29 08:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found