User avatar
Alexander Brown
Posts: 97
Joined: Thu Jan 23, 2014 2:36 pm

Wayland on stretch

Sun Aug 20, 2017 10:52 am

Is Gtk3 being compiled without Wayland support?

I've been paying around with stretch this morning it seems the Wayland backend is missing, as are the gdk wayland development headers.

Whilst I can understand splitting them into a separate package it would be good to have them available from the repos, or at least a explanation for there absence.

Currently they have seemingly been removed without warning even though they are still present upstream (both in the Gtk project and Debian)
I am

User avatar
B.Goode
Posts: 8987
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Wayland on stretch

Sun Aug 20, 2017 11:43 am

There are some comments in the response to the RPF blog post about the Raspbian Stretch release that might be related -




Nicolas says: 17th Aug 2017 at 12:44 pm
Hi, thanks for updating Raspbian!

Is Wayland part of the upgrade ?

Reply
Simon Long says: 17th Aug 2017 at 1:01 pm
No, as we have explained before, work on using the desktop with Wayland has been shelved indefinitely.

Reply
Nicolas says: 17th Aug 2017 at 2:29 pm
Hi,
I just read some of your answers i’ve missed on previous blog post, about Wayland.
I understand it’s not a priority, or it might not be relevant for now.
I won’t bother you again with that.

cheers

User avatar
Alexander Brown
Posts: 97
Joined: Thu Jan 23, 2014 2:36 pm

Re: Wayland on stretch

Sun Aug 20, 2017 11:48 am

I had seen that but I took it to mean the Maynard environment (which wasn't supported on Jessie either)
I am

fruitoftheloom
Posts: 21037
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Wayland on stretch

Sun Aug 20, 2017 12:06 pm

Retired disgracefully.....
This at present is my daily "computer" https://www.asus.com/us/Chrome-Devices/Chromebit-CS10/

User avatar
Alexander Brown
Posts: 97
Joined: Thu Jan 23, 2014 2:36 pm

Re: Wayland on stretch

Sun Aug 20, 2017 1:21 pm

Maybe I should have stated this before, the weston implementation of Wayland works as does the XWayland plugin however the Gtk toolkit is being distributed with only the X11 backend whereas previously it was available with Wayland and Broadway
I am

BillStephenson
Posts: 254
Joined: Thu May 17, 2012 1:25 am
Location: SW Missouri Ozarks
Contact: Website

Re: Wayland on stretch

Thu Oct 19, 2017 9:53 pm

Just curious (as I know very little of the tech specifics), will this have any impact on further work on this here?:

The future of Wayland, and sway's role in it

fruitoftheloom
Posts: 21037
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Wayland on stretch

Fri Oct 20, 2017 9:17 am

BillStephenson wrote:
Thu Oct 19, 2017 9:53 pm
Just curious (as I know very little of the tech specifics), will this have any impact on further work on this here?:

The future of Wayland, and sway's role in it

It was stated above that Wayland / Weston has been abandoned at this present time as a replacement for Xorg in Raspbian Operating System.

Wayland is around 10 years old and it will likely be several more years before Debian make the switch ;)
Retired disgracefully.....
This at present is my daily "computer" https://www.asus.com/us/Chrome-Devices/Chromebit-CS10/

User avatar
Alexander Brown
Posts: 97
Joined: Thu Jan 23, 2014 2:36 pm

Re: Wayland on stretch

Fri Oct 20, 2017 9:31 am

Wayland / Weston is available on stretch (And works quite well in fact) however Gtk3 is being configured in a way that means you cannot use Gtk3 applications as native clients, you can only use them through Xwayland (much as with Gtk2 application)

It would be nice if a `gtk-wayland` package was provided for those of use that wish to use it
I am

fruitoftheloom
Posts: 21037
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Wayland on stretch

Fri Oct 20, 2017 10:28 am

Alexander Brown wrote:
Fri Oct 20, 2017 9:31 am
Wayland / Weston is available on stretch (And works quite well in fact) however Gtk3 is being configured in a way that means you cannot use Gtk3 applications as native clients, you can only use them through Xwayland (much as with Gtk2 application)

It would be nice if a `gtk-wayland` package was provided for those of use that wish to use it

Build packages from Source :D
Retired disgracefully.....
This at present is my daily "computer" https://www.asus.com/us/Chrome-Devices/Chromebit-CS10/

User avatar
Alexander Brown
Posts: 97
Joined: Thu Jan 23, 2014 2:36 pm

Re: Wayland on stretch

Fri Oct 20, 2017 10:38 am

Tried that, ended up in a dependency mess
I am

horai
Posts: 43
Joined: Fri Apr 21, 2017 2:45 pm

Re: Wayland on stretch

Sun Apr 01, 2018 8:06 am

Hello, I tried to build GTK with Wayland support from sources, but I ended up with this error:
Installed as many libraries as necessary starting compilation with this command:
./configure --enable-wayland-backend

I have these packages installed:
libegl1-mesa:armhf install
libwayland-egl1-mesa:armhf install


checking Pango flags... -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lcairo
checking for GDK_DEP... no
configure: error: Package requirements (pango pangocairo gdk-pixbuf-2.0 >= 2.30.0 cairo >= 1.14.0 cairo-gobject >= 1.14.0 gio-unix-2.0 >= 2.49.4 wayland-client >= 1.9.91 wayland-protocols >= 1.7 xkbcommon >= 0.2.0 wayland-cursor >= 1.9.91 wayland-egl cairo epoxy >= 1.0) were not met:

No package 'wayland-egl' found


Is it possible to somehow use my package libwayland-egl1-mesa for missing wayland-egl? I have no wayland-egl.pc file and I tried to export environmental variable export LIBS=-lwayland-egl before compilation with no success.

Thank you very much
Best regards
Ivo

horai
Posts: 43
Joined: Fri Apr 21, 2017 2:45 pm

Re: Wayland on stretch

Sun Apr 01, 2018 8:54 am

Hello, I tried to build GTK with Wayland support from sources, but I ended up with this error:
Installed as many libraries as necessary starting compilation with this command:
./configure --enable-wayland-backend

I have these packages installed:
libegl1-mesa:armhf install
libwayland-egl1-mesa:armhf install


checking Pango flags... -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lcairo
checking for GDK_DEP... no
configure: error: Package requirements (pango pangocairo gdk-pixbuf-2.0 >= 2.30.0 cairo >= 1.14.0 cairo-gobject >= 1.14.0 gio-unix-2.0 >= 2.49.4 wayland-client >= 1.9.91 wayland-protocols >= 1.7 xkbcommon >= 0.2.0 wayland-cursor >= 1.9.91 wayland-egl cairo epoxy >= 1.0) were not met:

No package 'wayland-egl' found


Is it possible to somehow use my package libwayland-egl1-mesa for missing wayland-egl? I have no wayland-egl.pc file and I tried to export environmental variable export LIBS=-lwayland-egl before compilation with no success.

Thank you very much
Best regards
Ivo

User avatar
Alexander Brown
Posts: 97
Joined: Thu Jan 23, 2014 2:36 pm

Re: Wayland on stretch

Sun Apr 01, 2018 10:37 am

I think when I tried I ended up recompiling Mesa as well as Gtk, wasn't successful when I tried as I ended running out of disk space (8GB card that had seen some use)

Good luck it would be great to see this done
I am

horai
Posts: 43
Joined: Fri Apr 21, 2017 2:45 pm

Re: Wayland on stretch

Sat Apr 07, 2018 8:34 am

Hello all,

So far, one of these where missing:
libegl1-mesa-dev - free implementation of the EGL API -- development files
libgl1-mesa-dev - free implementation of the OpenGL API -- GLX development files
libgles1-mesa-dev - free implementation of the OpenGL|ES 1.x API -- development files
libgles2-mesa-dev - free implementation of the OpenGL|ES 2.x API -- development files

And the ./configure processes finished successfully. There are heavy dependencies, therefore I decided to build a package according to this:
https://wiki.debian.org/BuildingAPackage. When enabling Wayland support with --enable-wayland-backend in debian/rules file ./configure process and compilation process finishes successfully, but packaging process yields error:
dh_install: missing files, aborting
/usr/share/cdbs/1/rules/debhelper.mk:233: recipe for target 'binary-install/libgtk-3-common' failed
make: *** [binary-install/libgtk-3-common] Error 2

Just to add, GTK applications under Debian Stretch / Wayland work, so apparently there is Wayland support enabled during compilation process. I compared debian/rules files (package management file) of Debian and Raspbian distros and they differ only slightly, nevertheless I kept the Raspbian file untouched only enabled Wayland backend, however the beforementioned error raised.

Compilation of gtk sources from gtk webpage works, it compiles with Wayland support successfully, but after libraries installation, I cannot still run my application, because of this error:

Unable to init server: Could not connect: Connection refused

(myapplication): Gtk-WARNING **: cannot open display: :0

Therefore I decided to build package from official Raspbian sources with Wayland support, I want to make sure the libgtk package is replaced with modified version, I still think libraries compiled from sources and installed via make install should work, I thought there is not need to recompile my program on the platform linking those libraries with Wayland support. I thought my application just links whatever libraries are available and opens any graphical server which is available, either Wayland or X11 etc.
Anyway, I guess building a package is a more convenient way how to make sure dependencies are resolved.

If anyone is willing to help me, I would be very grateful, I can also provide ssh access, I just want to see the vast performance benefit of Wayland compared to X11 especially on Raspberry Zero.

User avatar
Alexander Brown
Posts: 97
Joined: Thu Jan 23, 2014 2:36 pm

Re: Wayland on stretch

Sat Apr 07, 2018 8:38 am

I suspect `make install` will have put Gtk in `/usr/local/` instead of `/usr/`
I am

horai
Posts: 43
Joined: Fri Apr 21, 2017 2:45 pm

Re: Wayland on stretch

Sat Apr 07, 2018 11:27 am

Then it would yield missing libraries, installation is fine, the application seems to find libraries, maybe I really have to recompile the software and link the newly build libraries

User avatar
Alexander Brown
Posts: 97
Joined: Thu Jan 23, 2014 2:36 pm

Re: Wayland on stretch

Sat Apr 07, 2018 12:34 pm

No because if make install put Gtk in /usr/local it won't have overridden the system version of Gtk so applications will continue to run and be built against the system version in /usr

Try running one of the demos (e.g. /usr/local/bin/gtk3-widget-factory ) and see if that works
I am

horai
Posts: 43
Joined: Fri Apr 21, 2017 2:45 pm

Re: Wayland on stretch

Sat Apr 07, 2018 2:43 pm

Ok ok, thank you, I'll give it a one more try as soon as I recompile the library once more.
Actually, I tried to remove the system libraries via sudo apt-get remove libgtk-3-0, I don't want to purge it since it removes many other libraries I need, therefore I assumed it should use the newly build libraries.
I will also recompile my software with newly build libraries since I just copied the software from my other Raspberry where I compiled it, but that unit has only GTK with X11 libraries, I assumed it has no impact on it, once compiled against any libraries then when running, if there is X11 backend present, it will run on X11, if there is Wayland backend, it will run on Wayland, anyway, maybe it does not work this way and it must be compiled and linked with libraries which have Wayland support.
Anyway while building a package from sources from repository I experience a lot of problems, I would like to know how guys from Raspbian create that package as the library with the same source code version is available as a package, I even tried to recompile the package without touching the rules file and it fails, probably I am doing something wrong.

User avatar
Alexander Brown
Posts: 97
Joined: Thu Jan 23, 2014 2:36 pm

Re: Wayland on stretch

Sat Apr 07, 2018 3:45 pm

If you keep Gtk installed though apt and rebuild Gtk with a prefix of /usr (--prefix=/usr to ./configure) then make install will overwrite the relevent files and everything should use the right version whether compiled directly on the pi, compiled on another pi running stretch and copied across or installed though apt
I am

horai
Posts: 43
Joined: Fri Apr 21, 2017 2:45 pm

Re: Wayland on stretch

Sat Apr 07, 2018 6:05 pm

You are perfectly right, it installs libraries to /usr/local/lib, but I need to install it to /usr/lib/arm-linux-gnueabihf/
The reason why Iwas in a need to create a package is the fact that my application requires clutter-gtk and clutter-gst, but when uninstalling the libgtk-3-0, both required packages are removed with libgtk-3-0.
But with your piece of information, I could leave the repository libgtk-3-0 package installed just rewrite it's corresponding libraries with the newly compiled libraries and theoretically there will be no need to create and deb package.
Clutter should be fine since according to Wayland documentation:
The Clutter toolkit uses GDK as a backend by default in recent versions and as long as GDK supports Wayland, so will Clutter.
All the dependency hell will stay fine due to the fact system will think it has libgtk-3-0 package installed, I hope replacing (rewriting) gtk will be sufficient for full functionality of my sofware as these are the compiled libraries:
./gdk/.libs/libgdk-3.so - will replace GDK for GTK and clutter with Wayland compatible one
./libgail-util/.libs/libgailutil-3.so - haven't a clue
./gtk/.libs/libgtk-3.so - will replace GTK with Wayland compatible one
All in all, it is a bit messy, but I will give it a try, if only I could create the GTK package from official sources, things could be much much easier (unfortunately also only theoretically) or better to say safer to install

If you have any comments, please feel free to correct me.
Last edited by horai on Sat Apr 07, 2018 6:21 pm, edited 1 time in total.

User avatar
Alexander Brown
Posts: 97
Joined: Thu Jan 23, 2014 2:36 pm

Re: Wayland on stretch

Sat Apr 07, 2018 6:14 pm

Sounds like you get the general idea

If your interested gail related to accessibility (screen readers)
I am

horai
Posts: 43
Joined: Fri Apr 21, 2017 2:45 pm

Re: Wayland on stretch

Tue Apr 10, 2018 7:18 am

Hello,

thank you very much, I tried the --prefix switch, however it always adds /lib directory therefore I shrinked ${prefix}/lib to ${prefix} only. But it makes problems therefore instead of --prefix I set the switch --libdir the desired directory, compiles fine but make install again yields problems with installation especially:/usr/lib/arm-linux-gnueabihf/gtk-3.0/3.0.0/immodules/im-broadway.so
Some undefined references within these files.
I am going to change the symlinks to the libraries to those different directories and will let you know about the result.

horai
Posts: 43
Joined: Fri Apr 21, 2017 2:45 pm

Re: Wayland on stretch

Wed Apr 11, 2018 6:58 am

Hello,

recreating symlinks works, seems like GTK applications finally work under Wayland, but I am using clutter with GTK and it seems like clutter also requests Wayland support which is not prepared moreover clutter requests COGL Wayland support which is also not present due to the fact I am unable to build any of the packages I am forced to build it from sources and alter it in the same way like GTK, unfortunately COGL compilation has many parameters set up in rules file which I will bypass while compiling from source with ./configure therefore I am giving it up.

User avatar
Alexander Brown
Posts: 97
Joined: Thu Jan 23, 2014 2:36 pm

Re: Wayland on stretch

Wed Apr 11, 2018 7:51 am

That's a shame but dependency hell is not a place you want to be
I am

horai
Posts: 43
Joined: Fri Apr 21, 2017 2:45 pm

Re: Wayland on stretch

Wed Apr 11, 2018 6:19 pm

Ok, I tried it once more, I compiled COGL with Wayland support first. Then I recompiled clutter with Wayland support. I also recompiled glue layer clutter-gtk which does not have any switch in ./configure to mangle with Wayland.

All the libs within directories with recompiled libraries (Wayland support) I let make install to install to default directory, mostly /usr/local/lib, (probably --prefix or --libdir would be more appropriate, but I'll give it a try later, probably my problems with defining prefix or libdir were caused by something else and could be resolved by command autoconf)
I removed all symlinks related to old libraries within /usr/lib/arm-linux-gnueabihf/ and copied newly created symlinks to newly recompiled libraries from /usr/local/lib to /usr/lib/arm-linux-gnueabihf/

I also entered command:
make clean
After each reconfiguration via ./configure (it is recommended on some web pages)

exported this:
export XDG_RUNTIME_DIR=/var/run/root/10000
export GTK_BACKEND=wayland
export CLUTTER_BACKEND=wayland
export GTK_BACKEND=wayland

I proceeded much much further, but now I got stuck with this:

(multistreamviewer:18355): Clutter-Gtk-ERROR **: *** Unsupported backend.

This is glue layer initialization within my code and it is related to the glue layer clutter-gtk

Return to “Raspbian”