Page MenuHomeFreeBSD

graphics/mesa-demos: Add X11 and WAYLAND options
AcceptedPublic

Authored by manu on Jun 12 2020, 9:37 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 25, 6:40 PM
Unknown Object (File)
Sat, Dec 21, 5:04 AM
Unknown Object (File)
Sat, Dec 14, 4:41 PM
Unknown Object (File)
Nov 21 2024, 8:04 AM
Unknown Object (File)
Nov 14 2024, 9:25 AM
Unknown Object (File)
Nov 9 2024, 11:55 AM
Unknown Object (File)
Nov 8 2024, 12:11 AM
Unknown Object (File)
Sep 22 2024, 11:02 AM
Subscribers

Details

Reviewers
zeising
Group Reviewers
x11
Summary

mesa-demos supports building for x11 or wayland (or both).
Add port options for both and adjust plist.
While here remove some x11 dependencies that aren't needed.

Test Plan

The egl*_wayland programs currently segfault for me (upstream bug).
Not sure yet who's fault it is.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

manu requested review of this revision.Jun 12 2020, 9:37 AM
manu edited the summary of this revision. (Show Details)

freeglut pulls X11 dependencies but upstream has Wayland support since 3.2.0. Maybe turn implit --enable-glut into an option e.g.,

$ make clean all WITHOUT="GLUT X11"
$ pkg info -x libX
libxml2-2.9.10

$ make makeplist | fgrep bin/
bin/eglgears_wayland
bin/eglinfo
bin/eglkms
bin/egltri_wayland
bin/es2gears_wayland
bin/peglgears

$ readelf -d $(make -V STAGEDIR)$(make -V PREFIX)/bin/eglgears_wayland | fgrep NEEDED
 0x0000000000000001 NEEDED               Shared library: [libGLEW-wayland.so.2]
 0x0000000000000001 NEEDED               Shared library: [libGLESv2.so.2]
 0x0000000000000001 NEEDED               Shared library: [libGLU.so.1]
 0x0000000000000001 NEEDED               Shared library: [libOpenGL.so.0]
 0x0000000000000001 NEEDED               Shared library: [libm.so.5]
 0x0000000000000001 NEEDED               Shared library: [libwayland-egl.so.1]
 0x0000000000000001 NEEDED               Shared library: [libwayland-client.so.0]
 0x0000000000000001 NEEDED               Shared library: [libEGL.so.1]
 0x0000000000000001 NEEDED               Shared library: [libc.so.7]
graphics/mesa-demos/Makefile
19

glesv2 is not used when both WAYLAND and X11 are disabled. Maybe try

WAYLAND_USE=	GL=glesv2
X11_USE=	GL=glesv2
22

Sort alphabetically to avoid confusion with make config and make showconfig which are sorted.

30

Why add a newline here?

32

Is it because USE_GL=glew injects -lX11?

$ pkg-config --libs glew
-L/usr/local/lib -lGLEW -lX11 -lGLU -lGL

Maybe try

X11_USE=			gl=glew
X11_VARS_OFF=			SUFFIX=-wayland

WAYLAND_LIB_DEPENDS=		libGLEW${SUFFIX}.so:graphics/glew${SUFFIX}

post-patch-X11-off:
	@${REINPLACE_CMD} '/PKG_CONFIG/s/glew/&-wayland/' ${WRKSRC}/configure
34

Convert to LIB_DEPENDS e.g.,

WAYLAND_LIB_DEPENDS=		libwayland-egl.so:graphics/wayland
zeising added a subscriber: zeising.

Does it make sense to build mesa-demos without both X11 and WAYLAND support? Perhaps they should be made into an "at least one must be selected" option?
Other than that, I have no further comments, just fix what @jbeich pointed out and it's good to go.

This revision is now accepted and ready to land.Jun 14 2020, 4:29 PM

The egl*_wayland programs currently segfault for me

Can you re-try with mesa-demos-8.5.0? See eglut_wayland: switch from wl_shell to xdg_shell

The egl*_wayland programs currently segfault for me

Can you re-try with mesa-demos-8.5.0? See eglut_wayland: switch from wl_shell to xdg_shell

Yup, will revive this patch this weekend and give it a try.

mesa-demos-9.0.0 is available. It builds fine without patches or extra flags to disable features on FreeBSD.

mesa-demos-9.0.0 is available. It builds fine without patches or extra flags to disable features on FreeBSD.

Yeah, I wanted to have a look at that this week.

Ping. If you don't have time for this port consider downscaling x11@ maintainership.