logo

blog

My website can't be that messy, right? git clone https://hacktivis.me/git/blog.git
commit: a2c99cfa8a95bf296c2ac0bccfe2433acd832789
parent c98fa580f0bfd2e8f12a7d6e05ec4ab271f0e200
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Thu,  5 Aug 2021 17:42:39 +0200

notes/pure-wayland: EGL_NO_X11 PR, re-split librairies&games, sdl12-compat

Diffstat:

Mnotes/pure-wayland.shtml82++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------------
1 file changed, 52 insertions(+), 30 deletions(-)

diff --git a/notes/pure-wayland.shtml b/notes/pure-wayland.shtml @@ -13,7 +13,7 @@ You can find this kind of similar setup in embedded systems (ie. SailfishOS), as X11 makes no sense outside of keyboard+mouse setups, but I don't expect it until a bunch of years for regular desktops (say when X.Org will have died), I'm doing this right now to avoid having to rush to get rid of X11 with having to push the End-of-Life date way back it's upstream date (that happened with python-2 because it wasn't much prepared until the last year or two).<br/> It's also the kind of setup that I expect soon in security-oriented systems because Wayland addresses a number of design flaws. </p> - <p>Testing is done on Gentoo Linux with <code>USE="-X -XWayland"</code> and <code><kbd>-DEGL_NO_X11</kbd></code> into the <code>C(XX)FLAGS</code>. And launched into the <a href="https://swaywm.org">Sway compositor</a>.</p> + <p>Testing is done on Gentoo Linux with <code>USE="-X -XWayland"</code> and <del><code><kbd>-DEGL_NO_X11</kbd></code> into the <code>C(XX)FLAGS</code></del>(fixed via <a href="https://gitlab.freedesktop.org/glvnd/libglvnd/-/merge_requests/246">patching libglvnd</a>). And launched into the <a href="https://swaywm.org">Sway compositor</a>.</p> <p>Reminder: <dl> <dt>static linking</dt><dd>(<code>LDFLAGS="-static"</code>) some of the library is copied in the executable</dd> @@ -76,33 +76,36 @@ endif</code></pre> </ul> <h2 id="libs">Librairies <a class="hlink" href="#libs">§</a></h2> - <h3>Works</h3> + <h3>Entirely works out of the box</h3> <ul> <li><a href="https://github.com/anholt/libepoxy">libepoxy</a>: Just Works</li> <li><a href="https://www.glfw.org/">GLFW</a>: Yes, Just Works</li> <li><a href="https://github.com/cginternals/glbinding">glbinding</a>: Yes, Just Works</li> <li><a href="http://www.waffle-gl.org/">waffle</a> Yes, use 1.7.0+ for support in modern compositors</li> <li><a href="https://love2d.org/">löve(2d)</a> (0.10.2+, tested with 11.3 + lua5.2): Yes, it's SDL2-based after all.</li> + </ul> + <h3>Needs more testing</h3> + <ul> + <li><a href="https://www.gtk.org/">GTK</a> 4: Seems to work okay (only tried the demo applications)</li> + <li><a href="https://github.com/libsdl-org/sdl12-compat">SDL-1.2 (compat)</a>: Getting there</li> + <li><a href="https://liballeg.org/">allegro-4</a>: Maybe, compiles with OpenGL enabled</li> + </ul> + <h3>Needs workarounds / Incomplete support</h3> + <ul> <li><a href="https://www.libsdl.org/">SDL2</a> (2.0.14): Yes, very close to working entirely out-of-the-box. Some workarounds being:<ul> <li>For 2.0.14 and earlier: Needing to set <code>SDL_VIDEO_GL_DRIVER=libOpenGL.so</code> or patch libSDL2 (<a href="https://github.com/libsdl-org/SDL/issues/4158">SDL#4158</a>).</li> <li>When bundled in binairies: Needing to set <code><a href="https://github.com/libsdl-org/SDL/blob/main/docs/README-dynapi.md">SDL_DYNAMIC_API</a></code> to where your distro's <code>libSDL2.so</code> library is.</li> <li>With <a href="https://github.com/libsdl-org/SDL/pull/4358">libsdl-org/SDL#4358</a> desktop OpenGL works</li> </ul></li> <li><a href="http://mygui.info">MyGUI</a>: Needs a patch for GLVND (<a href="https://github.com/MyGUI/mygui/pull/224">mygui#224</a>)</li> - <li><a href="https://www.gtk.org/">GTK</a> 4: Seems to work okay (only tried the demo applications)</li> <li><a href="https://www.gtk.org/">GTK</a> 3: Almost. <a href="https://gitlab.gnome.org/GNOME/gtk/-/issues/699">Suggestions are broken on multi-monitors</a> as well as the usual glitches.</li> <li><a href="https://www.qt.io/">Qt</a> 5: Almost, menus are misplaced, specially on multi-monitors.</li> - <li><a href="https://github.com/libsdl-org/sdl12-compat">SDL-1.2 (compat)</a>: Getting there</li> - </ul> - <h3>Maybe / Not really</h3> - <ul> <li><a href="http://glew.sourceforge.net/">GLEW: OpenGL Extension Wrangler Library</a>: <a href="https://github.com/nigels-com/glew/issues/172">Not really</a>, consider <a href="https://github.com/anholt/libepoxy#why-not-use-libglew">libepoxy</a> or <a href="https://glbinding.org/">glbinding</a> (drop-in). I managed to get it to compile and work for some software with:<ul> <li>Applying <a href="https://github.com/nigels-com/glew/pull/216/commits/584a266e71c3c3f7ec4a0e4e61c31b67f80a2419">Extend GLEW API to support glewContextInit - GL without implied GLX, … #216</a></li> <li>Running <code><kbd>sed -i 's/-lGL/-lOpenGL/' config/Makefile.linux-egl</kbd></code></li> <li>Passing <code>POPT="${CFLAGS} <kbd>-D__native_client__</kbd>"</code> and <code><kbd>SYSTEM=linux-egl</kbd></code> to make options, for both build and install</li> </ul></li> <li><a href="http://freeglut.sourceforge.net/">FreeGLUT: free OpenGL utility toolkit</a>: No, depends on <code>wl_shell</code> which is absent in wlroots and probably others (See <a href="https://github.com/dcnieho/FreeGLUT/issues/72">FreeGLUT#72</a>), it's activity is very low so consider using other librairies instead</li> - <li><a href="https://liballeg.org/">allegro-4</a>: Maybe, compiles with OpenGL enabled</li> <li><a href="https://liballeg.org/">allegro-5</a>: I managed to get most of it to compile with some patches, couldn't get liballegro_dialog (gtk on non-apple unixes) yet though as it depends on GTK with X11.</li> </ul> <h3>Doesn't Works</h3> @@ -125,7 +128,7 @@ endif</code></pre> </ul> <h2 id="games">Games <a class="hlink" href="#buildsystems">§</a></h2> - <h3>Just Works</h3> + <h3>Entirely works out of the box</h3> <ul> <li><a href="https://github.com/fmang/oshu">oshu</a>: Yes, just Works (SDL2)</li> <li><a href="https://parallelrealities.itch.io/blob-wars-attrition">Blob Wars : Attrition</a>: Yes, Just Works (SDL2)</li> @@ -142,52 +145,66 @@ endif</code></pre> <a href="https://github.com/Stabyourself/notdonkeykong">notdonkeykong</a>, <a href="https://github.com/Stabyourself/orderoftwilight">orderoftwilight</a>, …): Just Works</li> + <li><a href="https://7kfans.com/">seven-kingdoms</a>: Seems to work fine</li> </ul> - <h3>Needed a bit of work</h3> + <h3>Light temporary workaround caused by dependency</h3> <ul> - <li><a href="https://supertux.org/">SuperTux</a>: <del>No, because of GLEW</del> Yes, changed it's build configuration to use <a href="https://glbinding.org/">glbinding</a></li> - <li><a href="http://endless-sky.github.io/">endless-sky</a>: Almost, had to change linking from <code>GL</code> to <code>OpenGL</code> in <code>SConstruct</code>, no proper detection done</li> - - <li><a href="http://www.freeciv.org/">freeciv</a>: Yes(SDL2 and Qt5 clients) and No(GTK+2 client, the default/goto one)</li> - <li><a href="https://supertuxkart.net/">SuperTuxKart</a>: Quite, works in wayland with gles2(because irrlicht tries to dynamically load <code>libGL.so.1</code> otherwise) in current git (<code>9f1ae2b7619f21546cc5cdd4bbeea53492d4b7ac</code>)</li> - <li><a href="https://7kfans.com/">seven-kingdoms</a>: Seems to work fine</li> - <li><a href="https://github.com/FWGS/xash3d-fwgs">Xash3D FWGS</a> + <a href="https://github.com/FWGS/hlsdk-xash3d">HLSDK Xash3D</a> (Half-Life1 engine): Yes, has some glitches but seems unrelated to Wayland. Note: You need to set <code>SDL_VIDEO_GL_DRIVER=libOpenGL.so</code> or <code>BOX86_LIBGL=libOpenGL.so</code></li> <li><a href="https://taisei-project.org/">taisei</a>: Need to set <code>SDL_VIDEO_GL_DRIVER=libOpenGL.so</code> or patch libSDL2 (<a href="https://github.com/libsdl-org/SDL/issues/4158">SDL#4158</a>).</li> - <li><a href="https://neverball.org">neverball</a>: Works with OpenGL ES(<code>make ENABLE_OPENGLES=1</code>), segfaults with OpenGL(which needs <code>sed -i s;-lGL;-lOpenGL; Makefile</code>)</li> - <li><a href="https://gitlab.com/pingus/pingus">pingus</a>: Displays with a small patch(<a href="https://gitlab.com/pingus/pingus/-/merge_requests/191">pingus!191</a>), story mode segfaults but seems unrelated.</li> - <li><a href="https://nc.itch.io/mercury">Excavation Site Mercury</a>: Need to set <code><a href="https://github.com/libsdl-org/SDL/blob/main/docs/README-dynapi.md">SDL_DYNAMIC_API</a></code> to where your distro's <code>libSDL2.so</code> library is</li> - <li><a href="https://www.hempuli.com/baba/">Baba Is You</a> (Humble Bundle): Needs to run <code><a href="https://nixos.org/patchelf.html">patchelf</a> --replace-needed libGL.so.1 libOpenGL.so.0 bin64/Chowdren</code> and set <code><a href="https://github.com/libsdl-org/SDL/blob/main/docs/README-dynapi.md">SDL_DYNAMIC_API</a></code> to where your distro's <code>libSDL2.so</code> library is</li> <li><a href="https://github.com/adoptware/pinball">Emilia Pinball</a>: Either SDL2 with GLES1 support (<a href="https://github.com/gentoo/gentoo/pull/20690">gentoo/gentoo#20690</a>) and passing <code>--enable-gles</code> or applying <a href="https://github.com/libsdl-org/SDL/pull/4358">libsdl-org/SDL#4358</a> to get desktop OpenGL working</li> <li><a href="http://chromium-bsu.sourceforge.net/">Chromium B.S.U</a> (0.9.16.1+): With SDL2 fixed for desktop OpenGL it works</li> <li><a href="https://viewizard.com">astromenace</a> (1.4.1): With SDL2 fixed for desktop OpenGL it works</li> - <li><a href="https://www.bzflag.org/">bzflag</a> (2.4.22): Yes, done <code>sed -i -e 's;X_PRE_LIBS -lX11;X_PRE_LIBS;' -e's;\[opengl32 GL GL2\];[opengl32 GL GL2 OpenGL];' configure.ac</code>; Requires SDL2 fixed for desktop OpenGL</li> - <li><a href="http://armagetronad.org/">armagetronad</a> (trunk at <code>0ba8c6ff0aeda14d86760a1744c6296cbf8632be</code> + light fixes): With SDL2 fixed for desktop OpenGL it works</li> - <li><a href="https://www.teeworlds.com/">teeworlds</a> (0.7.5 + master): Needed a small patch to use GLVND and remove an unused X11 check (<a href="https://github.com/teeworlds/teeworlds/pull/2875">teeworlds#2875</a>)</li> - <li><a href="http://quakespasm.sourceforge.net/">QuakeSpasm</a> (master; Quake1 engine): With <code>USE_SDL2=1 COMMON_LIBS="-lm -lOpenGL"</code> passed to <code>make</code> it just works.</li> <li><a href="https://www.openra.net/">OpenRA</a>: With SDL2 fixed for desktop OpenGL it works</li> <li><a href="https://xmoto.tuxfamily.org">xmoto</a>: With SDL2 fixed for desktop OpenGL it works</li> + </ul> + + <h3 id="games-sdl12compat">Just needs SDL-1.2 compatibility library <a href="#games-sdl12compat">§</a></h3> + <ul> <li><a href="http://www.mhgames.org/oldies/formido/">formido</a>: With sdl12-compat it just works</li> <li><a href="http://heroes.sourceforge.net/">heroes</a>: Works with sdl12-compat, I just get a very small default window but fullscreen works</li> <li><a href="http://freshmeat.sourceforge.net/projects/luola">luola</a>: With sdl12-compat it just works</li> - <li><a href="http://www.libsdl.org/projects/Maelstrom/">Maelstrom</a> (3.0.6-r3): <code>double free or corruption (out)</code></li> <li><a href="http://icculus.org/oes/">orbital-eunuchs-sniper / sniper2d</a>: With sdl12-compat it just works</li> <li><a href="https://linux.tlk.fr/">powermanga</a>: With sdl12-compat it just works</li> - <li><a href="http://www.asahi-net.or.jp/~cs8k-cyu/windows/rr_e.html">rrootage</a>: sdl12-compat and replacing a <code>-lGL</code> to <code>-lOpenGL</code></li> <li><a href="https://cyp.github.com/snipes/">snipes</a>: With sdl12-compat it seems to work???</li> <li><a href="http://www.towbowltactics.com/index_en.html">towbowl-tactics</a>: With sdl12-compat it seems to work???</li> - <li><a href="https://violetland.github.io/">violetland</a>: With sdl12-compat and tweaking the CMakeList.txt for GLVND it just works</li> <li><a href="http://abe.sourceforge.net/">abe</a>: With sdl12-compat it seems to just work</li> <li><a href="http://www.fishies.org.uk/apricots.html">apricots</a>: With sdl12-compat it seems to just work</li> <li><a href="http://makegho.mbnet.fi/c/bchase/">balloonchase</a>: With sdl12-compat it seems to just work</li> <li><a href="http://perso.b2b2c.ca/~sarrazip/dev/batrachians.html">batrachians</a>: With sdl12-compat it seems to just work</li> <li><a href="https://savannah.nongnu.org/projects/clanbomber/">clanbomber</a>: With sdl12-compat <a href="https://github.com/libsdl-org/sdl12-compat/commit/1cc3061c06877a7ee4277187aa59dcca755e5a7f">1cc3061c06877a7ee4277187aa59dcca755e5a7f</a> and later it seems to just work</li> <li><a href="https://github.com/petarov/savagewheels">savagewheels</a>: With sdl12-compat it seems to just work</li> + <li><a href="http://koti.mbnet.fi/makegho/c/betna/">betna</a>: With sdl12-compat it seems to just work</li> + <li><a href="http://www.linux-games.com/bumprace/">bumprace</a>: With sdl12-compat it seems to just work</li> + <li><a href="http://www.losersjuegos.com.ar/juegos/ceferino">ceferino</a>: With sdl12-compat it seems to just work</li> + <li><a href="http://www.newbreedsoftware.com/circus-linux/">circuslinux</a>: With sdl12-compat it seems to just work</li> + </ul> + + <h3>Needs workarounds / Incomplete support</h3> + <ul> + <li><a href="https://supertux.org/">SuperTux</a>: <del>No, because of GLEW</del> Yes, changed it's build configuration to use <a href="https://glbinding.org/">glbinding</a></li> + <li><a href="http://endless-sky.github.io/">endless-sky</a>: Almost, had to change linking from <code>GL</code> to <code>OpenGL</code> in <code>SConstruct</code>, no proper detection done</li> + + <li><a href="http://www.freeciv.org/">freeciv</a>: Yes(SDL2 and Qt5 clients) and No(GTK+2 client, the default/goto one)</li> + <li><a href="https://supertuxkart.net/">SuperTuxKart</a>: Quite, works in wayland with gles2(because irrlicht tries to dynamically load <code>libGL.so.1</code> otherwise) in current git (<code>9f1ae2b7619f21546cc5cdd4bbeea53492d4b7ac</code>)</li> + <li><a href="https://github.com/FWGS/xash3d-fwgs">Xash3D FWGS</a> + <a href="https://github.com/FWGS/hlsdk-xash3d">HLSDK Xash3D</a> (Half-Life1 engine): Yes, has some glitches but seems unrelated to Wayland. Note: You need to set <code>SDL_VIDEO_GL_DRIVER=libOpenGL.so</code> or <code>BOX86_LIBGL=libOpenGL.so</code></li> + <li><a href="https://neverball.org">neverball</a>: Works with OpenGL ES(<code>make ENABLE_OPENGLES=1</code>), segfaults with OpenGL(which needs <code>sed -i s;-lGL;-lOpenGL; Makefile</code>)</li> + <li><a href="https://gitlab.com/pingus/pingus">pingus</a>: Displays with a small patch(<a href="https://gitlab.com/pingus/pingus/-/merge_requests/191">pingus!191</a>), story mode segfaults but seems unrelated.</li> + <li><a href="https://nc.itch.io/mercury">Excavation Site Mercury</a>: Need to set <code><a href="https://github.com/libsdl-org/SDL/blob/main/docs/README-dynapi.md">SDL_DYNAMIC_API</a></code> to where your distro's <code>libSDL2.so</code> library is</li> + <li><a href="https://www.hempuli.com/baba/">Baba Is You</a> (Humble Bundle): Needs to run <code><a href="https://nixos.org/patchelf.html">patchelf</a> --replace-needed libGL.so.1 libOpenGL.so.0 bin64/Chowdren</code> and set <code><a href="https://github.com/libsdl-org/SDL/blob/main/docs/README-dynapi.md">SDL_DYNAMIC_API</a></code> to where your distro's <code>libSDL2.so</code> library is</li> + <li><a href="https://www.bzflag.org/">bzflag</a> (2.4.22): Yes, done <code>sed -i -e 's;X_PRE_LIBS -lX11;X_PRE_LIBS;' -e's;\[opengl32 GL GL2\];[opengl32 GL GL2 OpenGL];' configure.ac</code>; Requires SDL2 fixed for desktop OpenGL</li> + <li><a href="http://armagetronad.org/">armagetronad</a> (trunk at <code>0ba8c6ff0aeda14d86760a1744c6296cbf8632be</code> + light fixes): With SDL2 fixed for desktop OpenGL it works</li> + <li><a href="https://www.teeworlds.com/">teeworlds</a> (0.7.5 + master): Needed a small patch to use GLVND and remove an unused X11 check (<a href="https://github.com/teeworlds/teeworlds/pull/2875">teeworlds#2875</a>)</li> + <li><a href="http://quakespasm.sourceforge.net/">QuakeSpasm</a> (master; Quake1 engine): With <code>USE_SDL2=1 COMMON_LIBS="-lm -lOpenGL"</code> passed to <code>make</code> it just works.</li> + <li><a href="http://www.libsdl.org/projects/Maelstrom/">Maelstrom</a> (3.0.6-r3): <code>double free or corruption (out)</code></li> + <li><a href="http://www.asahi-net.or.jp/~cs8k-cyu/windows/rr_e.html">rrootage</a>: sdl12-compat and replacing a <code>-lGL</code> to <code>-lOpenGL</code></li> + <li><a href="https://violetland.github.io/">violetland</a>: With sdl12-compat and tweaking the CMakeList.txt for GLVND it just works</li> </ul> <h3>Almost</h3> <ul> - <li><a href="http://gltron.sourceforge.net/">gltron</a>: Resizing doubles the keys, quitting can fail</li> + <li><a href="http://blockrage.sourceforge.net/">blockrage</a>: With sdl12-compat it seems to just work but it aborts on exit</li> + <li><a href="http://www.autismuk.freeserve.co.uk/">Cruising on Broadway</a>: With sdl12-compat it seems to just work but it aborts on exit</li> + <li><a href="http://www.cloudsprinter.com/software/conveysdl/">conveysdl</a>: With sdl12-compat it seems to just work but it aborts on exit</li> </ul> <h3>Doesn't works</h3> @@ -206,7 +223,12 @@ endif</code></pre> <li><a href="http://lgames.sourceforge.net/Barrage/">barrage</a>: <code>creating 640x480 bitmap ... Unknown pixel format</code></li> <li><a href="http://www.autismuk.freeserve.co.uk/">deathchase3d</a>: Game seems to be broken, quitting triggers an abort</li> <li><a href="http://linux.softpedia.com/get/GAMES-ENTERTAINMENT/Arcade/Shooting-Star-19754.shtml">shootingstar</a>: Fails to detect SDL_image</li> - <li><a href="https://chazomaticus.github.io/asteroid/">asteroid</a>: No, hard-depends on GTK2+ and libSDL-1</li> + <li><a href="https://chazomaticus.github.io/asteroid/">asteroid</a>: No, hard-depends on GTK2+ (and libSDL-1.2)</li> + <li><a href="https://anakreon.cz/?q=node/1">berusky</a>: No, hard-depends on GTK2+ (and libSDL-1.2)</li> + <li><a href="http://gltron.sourceforge.net/">gltron</a>: Antique auto*hell harcoded for <code>-lGL</code>, breaks on <code>autoreconf-{2.13,2.64,2.69}</code></li> + <!-- =games-arcade/bomns-0.99.2-r1::gentoo fails with -Werror=format-security --> + <li><a href="http://briquolo.free.fr/en/index.html">games-arcade/briquolo</a>: Black screen :(</li> + <li><a href="http://www.cloudsprinter.com/software/conveysdl/">crack-attack</a>: Hardcodes <code>-lGL -lXi -lX11</code></li> </ul> <h2 id="multimedia">Multimedia <a class="hlink" href="#multimedia">§</a></h2>