Opened 4 months ago

Last modified 4 months ago

#61943 assigned defect

libsdl2 @2.0.14 +x11: Doesn't work properly without upstream XQuartz.app installed/with only MacPorts' `xorg-server`

Reported by: larb0b (Larkin) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: haspatch Cc:
Port: libsdl2

Description (last modified by larb0b (Larkin))

MacPorts' libsdl2 X11 variant doesn't work with only MacPorts' xorg-server installed. When trying to actually use it, you get:

Failed to create window: Failed loading /opt/X11/lib/libGL.1.dylib: dlopen(/opt/X11/lib/libGL.1.dylib, 10): image not found!

This is because that path is hardcoded within src/video/x11/SDL_x11opengl.c in libsdl2. This could be rectified by changing the path to MacPorts' libGL.1.dylib (installed by the mesa port). mesa should probably also be made a dependency when building the x11 variant of libsdl2.

Attachments (4)

Portfile-libsdl2.diff (352 bytes) - added by larb0b (Larkin) 4 months ago.
Patch adding mesa to the x11 variant's depends_lib
use-macports-gl.patch (413 bytes) - added by larb0b (Larkin) 4 months ago.
Patch changing the default GL dylib from XQuartz' to MacPorts'
Portfile-libsdl2.2.diff (670 bytes) - added by larb0b (Larkin) 4 months ago.
Patch that adds mesa as a dependency when building the X11 variant + finds and replaces /opt/X11 with your prefix in SDL_x11opengl.c
Portfile-libsdl2.3.diff (667 bytes) - added by larb0b (Larkin) 4 months ago.
Same as last attached patch but doesn't use -W in reinplace since we're just working w/ one file

Download all attachments as: .zip

Change History (8)

comment:1 Changed 4 months ago by larb0b (Larkin)

Description: modified (diff)
Summary: libsdl2 @2.0.14 +x11: Doesn't build against MacPorts' GLlibsdl2 @2.0.14 +x11: Doesn't work properly without upstream XQuartz.app installed/with only MacPorts' `xorg-server`

Changed 4 months ago by larb0b (Larkin)

Attachment: Portfile-libsdl2.diff added

Patch adding mesa to the x11 variant's depends_lib

Changed 4 months ago by larb0b (Larkin)

Attachment: use-macports-gl.patch added

Patch changing the default GL dylib from XQuartz' to MacPorts'

comment:2 Changed 4 months ago by larb0b (Larkin)

Keywords: haspatch added

comment:3 Changed 4 months ago by ryandesign (Ryan Schmidt)

Owner: set to jmroot
Status: newassigned

Thanks for reporting the issue. The patch provided is not usable as such because we would need to use whatever ${prefix} is and not assume that it is /opt/local.

Changed 4 months ago by larb0b (Larkin)

Attachment: Portfile-libsdl2.2.diff added

Patch that adds mesa as a dependency when building the X11 variant + finds and replaces /opt/X11 with your prefix in SDL_x11opengl.c

comment:4 Changed 4 months ago by larb0b (Larkin)

I've attached a new patch which addresses that issue. It works fine in my testing.

Changed 4 months ago by larb0b (Larkin)

Attachment: Portfile-libsdl2.3.diff added

Same as last attached patch but doesn't use -W in reinplace since we're just working w/ one file

Note: See TracTickets for help on using tickets.