Re: Getting Gtk3 to work with PAR

[email protected] (Zakariyya Mughal)
Newsgroups perl.par
Message-ID <20160614215110.GB19832@quadra>
Thanks for the valuable information everyone!

I was able to put together a simple version of my Gtk3 application using
Shawn's patch to `Heavy.pm`.

Some things are still broken because Gtk3 relies on other non-DLL files
(such as icons, typelibs, and GSchema files which need to be placed in
particular directories). I think I have hit upon a workable approach
where I can use strace to get the list of files that my application
actually uses.

As for adding all the required non-DynaLoader DLLs, I believe it might
be possible to create something that can automatically package the
appropriate DLLs by taking the objdump or strace idea and creating a
Perl version of Dependency Walker <http://www.dependencywalker.com/>.

I will keep trying to get this all working in a way so that it is
reproducible. My end goal is to have continuous delivery with nightly
builds so that there are not any manual steps.

Just thought I would ask: has anyone tried to distribute their Perl
application using WiX <http://wixtoolset.org/> to create an MSI
installer?

Regards,
- Zaki Mughal

On 2016-06-14 at 14:47:49 +0000, RAPPAZ Francois wrote:
> Hi there, 
> 
> To pack my Gtk2 applications, I set up the following on my Windows box:
> 
> - pp -B --lib c:\strawberry\perl\vendor\lib 
> -l "C:\strawberry\perl\site\lib\auto\Cairo\Cairo.dll" 
> -l "C:\strawberry\perl\site\lib\auto\Pango\Pango.dll" 
> -l "C:\strawberry\perl\site\lib\auto\Glib\Glib.dll" 
> -l "C:\strawberry\perl\site\lib\auto\Gtk2\Gtk2.dll" 
> -o foo.par foo.pl
> 
> - unzip the par files
> 
> - removed the lib/auto/Gtk2, lib/auto/Cairo lib/auto/Pango from the par unzipped directory
> 
> - zipped all the directory tree back into foo.par
> 
> - pp -o foo.exe foo.par
> 
> I usually run this using a batch file and it works at the end.
> 
> François
> 
> > -----Original Message-----
> > From: Zakariyya Mughal [mailto:[email protected]]
> > Sent: lundi, 13. juin 2016 23:32
> > To: Roderich Schupp
> > Cc: [email protected]
> > Subject: Re: Getting Gtk3 to work with PAR
> > 
> > On 2016-06-13 at 23:09:06 +0200, Roderich Schupp wrote:
> > > On Mon, Jun 13, 2016 at 9:54 PM, Zakariyya Mughal
> > > <[email protected]>
> > > wrote:
> > >
> > > > I notice that there is a similar issue
> > > > <https://rt.cpan.org/Public/Bug/Display.html?id=55390> that was
> > > > opened in 2010 for a Gtk2 program.
> > > >
> > > >
> > > More relevant might be the thread on the par mailing list starting at
> > > http://www.mail-archive.com/par%40perl.org/msg05011.html
> > >
> > >
> > > > But when I run the test.exe, I get the following output:
> > > >
> > > >     $ ./test.exe
> > > >     Can't load
> > > > 'C:\msys64\tmp\par-7a616b69\cache-
> > b75d584224b1a1061779c0bb91d380c83ae4a68e\79d2d23b.dll'
> > > > for module Cairo::GObject: load_file:The specified module could not
> > > > be found at C:/msys64/mingw64/lib/perl5/core_perl/DynaLoader.pm
> > line 193.
> > > >      at C:/msys64/mingw64/lib/perl5/site_perl/PAR/Heavy.pm line
> > 120.
> > > >     Compilation failed in require at Gtk3.pm line 47.
> > > >
> > >
> > > Please run
> > >
> > > objdump -ax
> > > C:\msys64\tmp\par-7a616b69\cache-
> > b75d584224b1a1061779c0bb91d380c83ae4a
> > > 68e\79d2d23b.dll
> > > | grep "DLL Name"
> > >
> > > and post its output.
> > 
> >     $ objdump.exe -ax "C:\msys64\tmp\par-7a616b69\cache-
> > b75d584224b1a1061779c0bb91d380c83ae4a68e\79d2d23b.dll"  | grep "DLL
> > Name"
> >             DLL Name: KERNEL32.dll
> >             DLL Name: msvcrt.dll
> >             DLL Name: libcairo-gobject-2.dll
> >             DLL Name: libcairo-2.dll
> >             DLL Name: libglib-2.0-0.dll
> >             DLL Name: perl522.dll
> >             DLL Name: Cairo.dll
> >             DLL Name: Glib.dll
> > 
> > I see that the same problem from the mailing list thread is still
> > present where the DLL references other DLLs that may have already been
> > loaded.
> > 
> > Just as extra information, the debug output of Dynaloader is as
> > follows:
> > 
> >     $ export PERL_DL_DEBUG=1; ./test.exe
> >     DynaLoader.pm loaded (CODE(0x6c2728) .,
> > C:\msys64\mingw64\lib\perl5\core_perl C:\msys64\tmp\par-7a616b69\cache-
> > b75d584224b1a1061779c0bb91d380c83ae4a68e)
> >     dl_findfile()
> >     dl_findfile found:
> >     DynaLoader::bootstrap for IO (auto/IO/IO.dll)
> >     DynaLoader::bootstrap for Fcntl (auto/Fcntl/Fcntl.dll)
> >     DynaLoader::bootstrap for Cwd (auto/Cwd/Cwd.dll)
> >     DynaLoader::bootstrap for Compress::Raw::Zlib
> > (auto/Compress/Raw/Zlib/Zlib.dll)
> >     DynaLoader::bootstrap for List::Util (auto/List/Util/Util.dll)
> >     DynaLoader::bootstrap for Encode (auto/Encode/Encode.dll)
> >     DynaLoader::bootstrap for Data::Dumper
> > (auto/Data/Dumper/Dumper.dll)
> >     DynaLoader::bootstrap for Win32 (auto/Win32/Win32.dll)
> >     DynaLoader::bootstrap for File::Glob (auto/File/Glob/Glob.dll)
> >     DynaLoader::bootstrap for PerlIO::scalar
> > (auto/PerlIO/scalar/scalar.dll)
> >     DynaLoader::bootstrap for Tie::Hash::NamedCapture
> > (auto/Tie/Hash/NamedCapture/NamedCapture.dll)
> >     DynaLoader::bootstrap for attributes
> > (auto/attributes/attributes.dll)
> >     DynaLoader::bootstrap for Cairo (auto/Cairo/Cairo.dll)
> >     DynaLoader::bootstrap for Glib (auto/Glib/Glib.dll)
> >     DynaLoader::bootstrap for Cairo::GObject
> > (auto/Cairo/GObject/GObject.dll)
> >     Can't load 'C:\msys64\tmp\par-7a616b69\cache-
> > b75d584224b1a1061779c0bb91d380c83ae4a68e\79d2d23b.dll' for module
> > Cairo::GObject: load_file:The specified module could not be found at
> > C:/msys64/mingw64/lib/perl5/core_perl/DynaLoader.pm line 193.
> >     # ---snip ---
> > 
> > If the problem is that a DLL is being loaded twice (with a different
> > name), then why not keep a package variable to cache this and skip the
> > step if it has already been loaded?
> > 
> > Regards,
> > - Zaki Mughal
> > 
> > >
> > > Cheers, Roderich
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.