I just pull gio repo and played with examples, on Debian 10, login with Wayland but not X11, it seems that, example/glfw still need "xorg-dev " under wayland, here is the print:
fino@OP7071DE:/work/gioui/gio/example/glfw$ go run main.go go: downloading github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 go: downloading github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 go: downloading github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72
In file included from ./glfw/src/internal.h:187, from ./glfw/src/context.c:30, from /email@example.com/c_glfw.go:4: ./glfw/src/x11_platform.h:36:10: fatal error: X11/Xcursor/Xcursor.h: No such file or directory #include <X11/Xcursor/Xcursor.h> ^~~~~~~~~~~~~~~~~~~ compilation terminated.
issue fixed by: sudo apt install xorg-dev
BR / Fino Meng (孟祥夫) Intel – IOTG Developer Enabling
Thank you for the report.
The compilation error doesn't seem to be a bug in Gio, but rather in GLFW. Note that
glfwis not required for regular Gio programs; rather, the
glfwexample is specifically for demonstrating integration of Gio with external frameworks.
Gio programs does have a similar problem (both X11 and Wayland libraries are linked in at build time), which can be worked around with
-tags=nox11. Note that neither Wayland nor X11 is a runtime dependency; an appropriate backend is selected at runtime.
In other words: what is the expected behaviour?
Not big deal just a little bit confuse for new comers.
Maybe put a build.sh in the dir for convenience?
I don't know; I just feel people today don't read document before trying😊
BR / Fino (孟祥夫)
Intel – IOTG Developer Enabling
What would the
apt-get installline is not portable across distributions. FWIW, the requirements are documented at https://gioui.org/doc/install, but I agree that few people (not including me!) read instructions.