syphilis has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

(I've marked the question "OT" in the anticipation that the loading of 'glib-networking' is handled entirely within the Gtk+ package, and Gtk2-WebKit simply takes whatever Gtk+ delivers.)

For a demo of the Gtk2-WebKit browser, I have:
use strict; use warnings; use Gtk2 -init; use Gtk2::WebKit; my $url = 'https://en.wikipedia.org/wiki/Mary_Poppins_(film)'; my $window = Gtk2::Window->new; $window->set_default_size(320,160); $window->signal_connect(destroy => sub { Gtk2->main_quit }); my $sw = Gtk2::ScrolledWindow->new; my $view = Gtk2::WebKit::WebView->new; $sw->add($view); $window->add($sw); $view->open($url); $window->show_all; Gtk2->main;
UPDATE: URL in the script was changed - to keep Karl happy ;-)

So long as the 'glib-networking' module has been loaded, that script works fine, and the webpage displays normally in the Gtk2 browser window (once the window has been maximised, of course). However, if 'glib-networking' is not loaded, the browser window simply displays:
TLS/SSL support not available; install glib-networking
which is a message that emanates from the Gtk+ libsoup-2.4.1.dll.

The 'glib-networking' module itself is lib/gio/modules/libgiognutls.dll, with some additional resources in the 'share' directory.
If I hide libgiognutls.dll then I get the libsoup error message. But I'm damned if I can work out what detects and pulls in libgiognutls.dll.

My Gtk+ installation is provided by MSYS2 - and it was built using a mingw-w64 port of gcc-5.4.0.
I've built perl-5.24.0 using the same compiler - and this means that the perl-gtk2 modules (including Gtk2-WebKit) build fairly trivially for that particular build of perl.
For that particular perl, everything works quite well (including the loading of 'glib-networking' and the above demo).

However, for perls built with a different version of gcc, it's not so trivial and I do some hacking.
Of course, in that hacking the 'glib-networking' package fails to load and I'm left with a browser that can't handle TLS/SSL.
I'd like to fix that but I don't give myself much of a chance of doing that if I don't understand the conditions that need to be met ... and hence my question.

I've searched my entire Gtk+ installation looking for a match for the string "giognutls" and there's only one match - in libgiognutls.dll itself.
If the dll is getting loaded, I would have expected at least one match elsewhere.
Searching the Glib, Gtk2 and Gtk2-WebKit sources for the same string results in zero hits.



Cheers,
Rob

Replies are listed 'Best First'.
Re: [OT] Win32: How does Gtk2-WebKit load glib-networking ?
by beech (Parson) on Jun 02, 2017 at 05:53 UTC
      These pages are interesting

      Indeed they are - and thank you very much for digging them up.
      Setting $ENV{GIO_MODULE_DIR} to the location of libgiognutls.dll is enough to get that dll to load when the demo is run. At least, an attempt is made to load it.
      There's a bit more to work through, but this is precisely the start that I was seeking.

      I'll post (in this thread) the full solution when I get there ... perhaps preceded by some additional questions if the need arises.

      Thanks again.

      Cheers,
      Rob
        I'll post (in this thread) the full solution when I get there

        It turns out to be fairly straightforward.
        Setting $ENV{GIO_MODULE_DIR} or $ENV{GIO_EXTRA_MODULES} to the location of libgiognutls.dll is all that's needed to make that dll locatable, and it doesn't seem to matter if one changes the name of that dll.
        Apart from that, I just need to ensure that all of the dlls that libgiognutls.dll needs to pull in can be found. This can be achieved by (eg) making sure that they're all in $ENV{PATH}.

        Cheers,
        Rob
Re: [OT] Win32: How does Gtk2-WebKit load glib-networking ?
by karlgoethebier (Abbot) on Jun 02, 2017 at 12:27 UTC

    Can't you link to something less depressing, like my $url = q(https://en.wikipedia.org/wiki/Crocodile_Dundee); or whatever - instead of this asshole Manson that is responsible for the killing of Sharon_Tate and four others?

    «The Crux of the Biscuit is the Apostrophe»

    Furthermore I consider that Donald Trump must be impeached as soon as possible