Recent

Author Topic: Ubuntu 19.10 and libgdk  (Read 2847 times)

sash

  • Sr. Member
  • ****
  • Posts: 289
Re: Ubuntu 19.10 and libgdk
« Reply #15 on: October 30, 2019, 03:17:03 pm »
@Thaddy

Thanks. I know but...

- I'm neither using TrayIcon in my projects.
- Nor having problems with helloworld-type sample project, compiled on my (even with an older LCL) particular machine.
- Seems like this issue is more about distro packaging (19.10 is not LTS after all) than about LCL.
Lazarus 2.0.6 FPC 3.0.4 x86_64-linux-gtk2 -- Ubuntu 19.10 XFCE

dbannon

  • Hero Member
  • *****
  • Posts: 788
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Ubuntu 19.10 and libgdk
« Reply #16 on: October 30, 2019, 11:05:23 pm »
Yep, its about distro packaging, in particular, the trend is to leave GTK2 out.  And most Lazarus Linux apps are dependent on GTK2.....

Right now most disro/desktop combinations do include GTK2 but the big name ones don't and they make up most of the installed base.

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

tk

  • Sr. Member
  • ****
  • Posts: 364
Re: Ubuntu 19.10 and libgdk
« Reply #17 on: November 06, 2019, 10:02:14 pm »
Similar issue for me, I just downloaded virtual Ubuntu 19.10 x64 (https://www.osboxes.org/ubuntu/#ubuntu-19-10-vmware) and I could not run any 64bit app built with Lazarus (double commander, fpcupdeluxe, etc.), from their official distributions.

Always got this error:
Code: [Select]
error while loading shared libraries: libgdk-x11-2.0.so.0: cannot open shared object file: No such file or directory
Then I inspected if the libs are located in the system and they were:
Code: [Select]
apt-file search libgdk-x11-2.0.so.0
libgtk2.0-0: /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0
libgtk2.0-0: /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0.2400.32

But the apps didn't work. So I (re)installed the libs:
Code: [Select]
sudo apt-get install libgtk2.0-0
Apt-get told me that some libs were missing and installed them:
Code: [Select]
The following additional packages will be installed:
  libgail-common libgail18 libgtk2.0-bin libgtk2.0-common
The following NEW packages will be installed:
  libgail-common libgail18 libgtk2.0-0 libgtk2.0-bin libgtk2.0-common

And this helped, all the apps started to work.

Nothing changed when I called apt-file search libgdk-x11-2.0.so.0 again after this.

Do I have to instruct the customers to reinstall the libs or is it just an issue with this Ubuntu release?


dbannon

  • Hero Member
  • *****
  • Posts: 788
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Ubuntu 19.10 and libgdk
« Reply #18 on: November 06, 2019, 11:15:23 pm »
tk, it appears that U19.10 (and a growing number of other distros) are dropping GTK2 from the default install list. Not really surprising I guess.  Installing gtk2 and its dependancies 'should' solve the problem, so, yes, mark your deb or rpms as being dependant on GTK2 (or tell end users they must manually install GTK2).

You could try -

Code: [Select]
find / -name "libgdk-x11*" 2> /dev/null <enter>
to ensure it there but its almost certainly installed as part of GTK2 and if the apps run, that also says its there.

Time we all started looking at GTK3 ....

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

valdir.marcos

  • Hero Member
  • *****
  • Posts: 851
Re: Ubuntu 19.10 and libgdk
« Reply #19 on: November 07, 2019, 01:37:07 am »
tk, it appears that U19.10 (and a growing number of other distros) are dropping GTK2 from the default install list. Not really surprising I guess.
No news here:
Lazarus and GTK2 x GTK3 x GTK4 x GTK5
https://forum.lazarus.freepascal.org/index.php/topic,39668.0.html

Quote
Installing gtk2 and its dependancies 'should' solve the problem, so, yes, mark your deb or rpms as being dependant on GTK2 (or tell end users they must manually install GTK2).

You could try -
Code: [Select]
find / -name "libgdk-x11*" 2> /dev/null <enter>to ensure it there but its almost certainly installed as part of GTK2 and if the apps run, that also says its there.

Time we all started looking at GTK3 ....
Davo
I agree.

sash

  • Sr. Member
  • ****
  • Posts: 289
Re: Ubuntu 19.10 and libgdk
« Reply #20 on: November 07, 2019, 12:24:21 pm »
Time we all started looking at GTK3 ....

Or adopt QT.
Lazarus 2.0.6 FPC 3.0.4 x86_64-linux-gtk2 -- Ubuntu 19.10 XFCE

zeljko

  • Hero Member
  • *****
  • Posts: 1089
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Ubuntu 19.10 and libgdk
« Reply #21 on: November 07, 2019, 12:26:18 pm »
You mean adopt lazarus so default ws is qt/qt5 ? Or adopt what exactly ?

sash

  • Sr. Member
  • ****
  • Posts: 289
Re: Ubuntu 19.10 and libgdk
« Reply #22 on: November 07, 2019, 12:36:49 pm »
You mean adopt lazarus so default ws is qt/qt5
Yes, this.

AFAIK, Lazarus' QT is more stable than GTK3, but not that straightforward to setup and deploy.
Lazarus 2.0.6 FPC 3.0.4 x86_64-linux-gtk2 -- Ubuntu 19.10 XFCE

zeljko

  • Hero Member
  • *****
  • Posts: 1089
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Ubuntu 19.10 and libgdk
« Reply #23 on: November 07, 2019, 01:47:35 pm »
Most distros have libQt4Pas and libQt5Pas, so installing lazarus under such distro isn't a big deal.
Also, for deployment you need exactly nothing if client's installation already have libQt4Pas/libQt5Pas.
It's definitelly not big deal under x11.

dbannon

  • Hero Member
  • *****
  • Posts: 788
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Ubuntu 19.10 and libgdk
« Reply #24 on: November 08, 2019, 12:02:47 am »
Or adopt QT.

Trouble is that 'most' distributions arrive with GTK3 preinstalled. Those that don't, find it pretty easy to install. If you distribute your QT app, you would need end users to install QT as well, that, as has been noted, is often not an easy task.

OK, good thing I checked before posting, it looks like my U1910 text VM does have a basic QT install. Pretty sure I did not do that. Maybe sash has a point ? 

Further research is indicated .....
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

dbannon

  • Hero Member
  • *****
  • Posts: 788
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Ubuntu 19.10 and libgdk
« Reply #25 on: November 08, 2019, 02:11:49 am »
QT5 ?

Hmm, maybe.  I had it working on my U18.04 install earlier this year, so I made a small test app. Just to see if its a practical solution.  It built OK on my Ubuntu18.04 with Lazarus Fixes.  Running it however on a number of systems -

* U18.04 - Failed "undefined symbol: QTextEdit_setPlaceholderText". Maybe some recent updates broke it.
* U19.10 - OK if I first install libQt5Pas - that was easy.  And a much smaller install than GTK2. Promising.
* Fedora 30 Plasma - Ok if I install qt5pas.  Same with gnome but no TrayIcon.   
* Mageia - Install a lib64qt5pas1 but test app failed "undefined symbol: QTextEdit_setPlaceholderText"
* Debian 10.1 - Install libqt5pas1 - works OK.

So, works with no more than installing libqt5pas on 60% of what I consider the "big five". But you need to know the name of the pas library, it varies. Sigh.  But does not work with 40% and thats a big lump to have to chase down if you are supporting a number of end users. GTK2 delivers 100% but on some of those, now required a largish dependencies download.  GTK3 delivers on 100% but is still quite buggy. 

Sorry sash, my vote is still "lets get GTK3 up to scratch" !

EDIT:  No, I made a mistake, the Qt5 libraries are not pre installed on the mainstream Ubuntu, Fedora and probably Mageia. I use Virtual Boxes to test but I have each distro setup with multiple Desktops,  and that includes KDE/Plasma so the Qt5 libraries have come from there. A manual install uses about 49Meg on Ubuntu 19.10, compare that with 321Meg to put GTK2.0 on the same box. Hmm...

Davo
« Last Edit: November 08, 2019, 08:14:14 am by dbannon »
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

zeljko

  • Hero Member
  • *****
  • Posts: 1089
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Ubuntu 19.10 and libgdk
« Reply #26 on: November 08, 2019, 02:28:21 pm »
QT5 ?

Hmm, maybe.  I had it working on my U18.04 install earlier this year, so I made a small test app. Just to see if its a practical solution.  It built OK on my Ubuntu18.04 with Lazarus Fixes.  Running it however on a number of systems -

* U18.04 - Failed "undefined symbol: QTextEdit_setPlaceholderText". Maybe some recent updates broke it.
* U19.10 - OK if I first install libQt5Pas - that was easy.  And a much smaller install than GTK2. Promising.
* Fedora 30 Plasma - Ok if I install qt5pas.  Same with gnome but no TrayIcon.   
* Mageia - Install a lib64qt5pas1 but test app failed "undefined symbol: QTextEdit_setPlaceholderText"
* Debian 10.1 - Install libqt5pas1 - works OK.

So, works with no more than installing libqt5pas on 60% of what I consider the "big five". But you need to know the name of the pas library, it varies. Sigh.  But does not work with 40% and thats a big lump to have to chase down if you are supporting a number of end users. GTK2 delivers 100% but on some of those, now required a largish dependencies download.  GTK3 delivers on 100% but is still quite buggy. 

Sorry sash, my vote is still "lets get GTK3 up to scratch" !

EDIT:  No, I made a mistake, the Qt5 libraries are not pre installed on the mainstream Ubuntu, Fedora and probably Mageia. I use Virtual Boxes to test but I have each distro setup with multiple Desktops,  and that includes KDE/Plasma so the Qt5 libraries have come from there. A manual install uses about 49Meg on Ubuntu 19.10, compare that with 321Meg to put GTK2.0 on the same box. Hmm...

Davo

undefined symbol: QTextEdit_setPlaceholderText comes from old version of Qt5Pas library. Distros should update their packages (current stable version is qt5pas-1.2.7),
or you can build it manually on your linux machine, download trunk lazarus, cd lcl/interfaces/qt5/cbindings , read manual howto compile libqt5pas...it's pretty easy.
KDE distros alread have all Qt5 libraries installed except maybe libQt5Pas.



dbannon

  • Hero Member
  • *****
  • Posts: 788
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Ubuntu 19.10 and libgdk
« Reply #27 on: November 09, 2019, 12:51:17 am »
undefined symbol: QTextEdit_setPlaceholderText comes from old version of Qt5Pas library. Distros should update their packages (current stable version is qt5pas-1.2.7),
or you can build it manually on your linux machine, download trunk lazarus, cd lcl/interfaces/qt5/cbindings , read manual howto compile libqt5pas...it's pretty easy.
KDE distros alread have all Qt5 libraries installed except maybe libQt5Pas.
Agreed its easy, I can do it. But I feel very uncomfortable distributing a binary package that overwrites the end users version of even libqt5pas. And updating a distro's QT5 itself is no easy task if its not packaged for that OS. If, as you say, the distro people would keep up with releases it would work but they don't. My Ubuntu1804 has another 18 months of life ....
But, maybe good news, I found that if you avoid the widgets that have changed, a current app can still use the old QT5 libs including qt5pas. So far I have found that means not using TMemo (sure there are more). My app, tomboy-ng works using the older library OK. Maybe thats a transition strategy.

Zelijko, as the proud maintainer of both GTK3 and QT5, which do you think has a more promising future for Lazarus developers ?

EDIT: Ubuntu quote, on both U18.04 and U19.10 http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html and that mentions a version 2.6 dating back to 2013. Thats clearly   different number system (and maybe code base) to yours ? 

Davo
« Last Edit: November 09, 2019, 01:14:49 am by dbannon »
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

zeljko

  • Hero Member
  • *****
  • Posts: 1089
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Ubuntu 19.10 and libgdk
« Reply #28 on: November 09, 2019, 09:52:35 am »
undefined symbol: QTextEdit_setPlaceholderText comes from old version of Qt5Pas library. Distros should update their packages (current stable version is qt5pas-1.2.7),
or you can build it manually on your linux machine, download trunk lazarus, cd lcl/interfaces/qt5/cbindings , read manual howto compile libqt5pas...it's pretty easy.
KDE distros alread have all Qt5 libraries installed except maybe libQt5Pas.
Agreed its easy, I can do it. But I feel very uncomfortable distributing a binary package that overwrites the end users version of even libqt5pas. And updating a distro's QT5 itself is no easy task if its not packaged for that OS. If, as you say, the distro people would keep up with releases it would work but they don't. My Ubuntu1804 has another 18 months of life ....
But, maybe good news, I found that if you avoid the widgets that have changed, a current app can still use the old QT5 libs including qt5pas. So far I have found that means not using TMemo (sure there are more). My app, tomboy-ng works using the older library OK. Maybe thats a transition strategy.

Zelijko, as the proud maintainer of both GTK3 and QT5, which do you think has a more promising future for Lazarus developers ?

EDIT: Ubuntu quote, on both U18.04 and U19.10 http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html and that mentions a version 2.6 dating back to 2013. Thats clearly   different number system (and maybe code base) to yours ? 

Davo

1. For me personally , I'll probably never use anything but Qt. I'm not interested in gtk2/3/4 since it looks poor against Qt4/Qt5 libs and does not fit my needs for bussiness apps. Note that Qt4 is bit slower than gtk2 , but Qt5 is equal or faster than gtk2 in any aspect.
2. http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html is talking about Qt4 version of bidings. They aren't changed for years and won't be changed.
3. Qt5 bindings are not at the third party site they're located in lcl/interfaces/qt5/cbindings so you can build it at any time.
4.For deploying: Under mac I'm using qtdeploy script which is installed by Qt, under windows just put all dll's inside your app directory, for linux (if OS does not have libQt5Pas or it's outdated), put eg lib/ directory inside your app directory and copy there your libQt5Pas, then under linker options in your project add additional rpath to linker and everything will work w/o problems.


sash

  • Sr. Member
  • ****
  • Posts: 289
Re: Ubuntu 19.10 and libgdk
« Reply #29 on: November 09, 2019, 11:41:40 am »
I'm not interested in gtk2/3/4 since it looks poor against Qt4/Qt5 libs and does not fit my needs for bussiness apps.

Hmm ... my experience gives me just the opposite result: gtk looks far superior and more configurable (on my distro) than qt.
But look and feel is customizable with themes for both gtk an qt.

And IMO, GUI appearance - should be beyond app's responsibility.
Instead (especially "business" ones, unlike let's say games), applications should respect and follow user's picked GUI style.
Lazarus 2.0.6 FPC 3.0.4 x86_64-linux-gtk2 -- Ubuntu 19.10 XFCE