Solution for HTMLViewer with Webkit on 64-bit-Linux

I tried to use the Webkit based HTMLViewer on a 64-bit-Linux (Ubuntu 12.04 LTE) and it didn’t work because Webkit isn’t part of the 32-bit compatibility library package you can install with

 sudo apt-get install ia32-libs

or

 sudo apt-get install ia32-libs-multiarch

Because I could not find a solution on this forum, I will post my solution here. It will work on Ubuntu, but it should also work for other distributions, as long as Xojo works there. First install the 64-bit version of libwebkitgtk-1.0. On Ubuntu, you would use this command:

 sudo apt-get install libwebkitgtk-1.0.0

You can then download the necessary webkit 32-bit libraries from here.

Copy the unpacked folder libwebkit32 to some place on your hard drive, e.g. to /usr/lib/.

Then launch the Xojo IDE in this way:

LD_LIBRARY_PATH=/usr/lib/libwebkit32 /opt/xojo/xojo2014r1/Xojo

or your built app:

LD_LIBRARY_PATH=/usr/lib/libwebkit32 /path/to/the/app

Of course you can also do this in a batch file, so that your users don’t have to use the terminal to launch your app.


If you want to recreate my libwebkit32 package (e.g. because a new security update for webkit has been released or because you don’t trust me), do this:

Download the following packages from Ubuntu (you always have to choose the latest version on the top right and then download the .deb file on the right under “Downloadable files”):
https://launchpad.net/ubuntu/precise/i386/libwebkitgtk-1.0-0
https://launchpad.net/ubuntu/precise/i386/libenchant1c2a
https://launchpad.net/ubuntu/precise/i386/libjavascriptcoregtk-1.0-0
https://launchpad.net/ubuntu/precise/i386/libgeoclue0
https://launchpad.net/ubuntu/precise/i386/libicu48

Copy all the deb files to a folder, then create a subfolder called “fakeroot”. Then install every deb file you downloaded to the fake root directory with this command (if you do not use a Debian based distribution like Ubuntu, you probably have to install dpkg-deb first):

dpkg-deb -x debfilename.deb fakeroot

where debfilename.deb is the name of the downloaded file, of course.
Finally, do this:

cd fakeroot/usr/lib ln -s libwebkitgtk-1.0.so.0 libwebkitgtk-1 cd .. mv lib libwebkit32

Then you can use this libwebkit32 folder under fakeroot/usr just like the one downloaded from above.

I hope this helps!

Thank you for looking into this and providing such a detailed account on how to resolve the issue. Perhaps Xojo could take some of your findings and roll it into a future release.

I’ll test this out early next week. Thanks again.

“It would probably be better to update your program to use GTK+ 3.x and libwebkitgtk-3.0-0 instead, which is included by default on the Ubuntu install. GTK+ 2.x is deprecated and it is not recommended to write new software with it at this time, and is recommended to port applications to GTK+ 3.x” -dobey (Ubuntu)

Instead of trying to change the OS to use old libs, why not update Xojo libs?

Or better, a switch like the “Use GDI+” on Windows? The default would be GTK+ 3, and the switch would be “Use GTK+ 2” (to be removed in a near the future).

That’s a very different problem. Switching to the new lib would certainly be a very good idea – of course, that’s something only the Xojo devs themselves could do – and you would not have to install old libs on your new 32-bit Linux distro, but it wouldn’t help on 64-bit systems. You would still need something like my workaround from above, but for libwebkitgtk-3.0 instead of libwebkitgtk-1.0.
The 64-bit compiler will solve this problem, but we will probably have to wait another year till it’s ready.

There are 2 problems here. One more complex. Yes, I am aware of this.

Making an entire new compiler and solves the 64bit native generation, but does not solve the lib 1.0 compatibility that you need to find and share somewhere and that is not natively supported.

Using the 32 bit compatibility layer on 64bit OS’s can workaround the 64bit compatibility problem for now.

But… the hard to “cure” case is, the Libwebkitgtk-1.0 not being supported in some distributions under this environment, like recent versions of Ubuntu. So, the better mixed approach for the full case, in my view, is:

  1. Update the web kit (Use GTK+3 and give an option to use the old one for old distributions)
  2. Users just install the 32 bit layer for now, as usual, and it’s done.

The final app will run fine on GTK+3 environments 32bit enabled, and you can recompile a GTK+2 version for older ones.

  1. The next final step will be the forthcoming brand new 64bit compiler using the chosen GTK+ (3 or 2).

Xojo devs can do anything, but final users just want to click on it and run. :slight_smile:

Correct.

No, it’s not, because libwebkitgtk-3.0 isn’t supported in the 32-bit compatibility layer, either. You would still have to use a workaround like the one above.

Right, and they have nothing to do with each other. This thread should be about the problem with 64 bit distributions not including libwebkitgtk in their compatibility layer. Let’s discuss the advantages of libwebkitgtk 3 in another thread.

Yes, there is a relation. I did not find I am discussing off topic but ok. This subject needs deeper analysis but I’ll not make it. :slight_smile: