On Mon, Nov 25, 2024 at 08:35:01AM +0100, Antoine Jacoutot wrote:
> On Sat, 2024-11-23 at 14:20 -0700, Kurt Mosiejczuk wrote:
> > CVSROOT: /cvs
> > Module name: ports
> > Changes by: [email protected] 2024/11/23 14:20:10
> >
> > Modified files:
> > graphics/glfw : Makefile distinfo
> >
> > Log message:
> > Update glfw to 3.4
> >
> > This update introduces compilation of multiple backends at once and
> > picking the runtime with environment variables. It defaults to X
> > but now has Wayland support.
> This does not build, it needs xkbcommon.
This patch builds for me. Does this look better to you?
--Kurt
Index: Makefile
===================================================================
RCS file: /cvs/ports/graphics/glfw/Makefile,v
diff -u -p -r1.13 Makefile
--- Makefile 23 Nov 2024 21:20:10 -0000 1.13
+++ Makefile 25 Nov 2024 08:46:54 -0000
@@ -3,6 +3,7 @@ COMMENT = open source, multi-platform li
V = 3.4
DISTNAME = glfw-${V}
CATEGORIES = graphics x11
+REVISION = 0
SHARED_LIBS += glfw 1.2 # 3.4
@@ -12,7 +13,8 @@ MAINTAINER = Kurt Mosiejczuk <kmos@openb
# zlib
PERMIT_PACKAGE = Yes
-WANTLIB = X11 m pthread
+WANTLIB = X11 m pthread wayland-client wayland-cursor \
+ wayland-egl xkbcommon
SITES = https://github.com/glfw/glfw/releases/download/${V}/
EXTRACT_SUFX = .zip
@@ -24,8 +26,10 @@ CONFIGURE_ARGS = -DBUILD_SHARED_LIBS=ON
CFLAGS += -I${X11BASE}/include
-BUILD_DEPENDS = wayland/libinput-openbsd \
- wayland/wayland
+BUILD_DEPENDS = wayland/libinput-openbsd
+LIB_DEPENDS = wayland/wayland \
+ x11/xkbcommon
+
NO_TEST = Yes
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/graphics/glfw/pkg/PLIST,v
diff -u -p -r1.3 PLIST
--- pkg/PLIST 11 Mar 2022 19:22:26 -0000 1.3
+++ pkg/PLIST 25 Nov 2024 08:46:54 -0000
@@ -1,7 +1,6 @@
include/GLFW/
include/GLFW/glfw3.h
include/GLFW/glfw3native.h
-lib/cmake/
lib/cmake/glfw3/
lib/cmake/glfw3/glfw3Config.cmake
lib/cmake/glfw3/glfw3ConfigVersion.cmake
Index: patches/patch-src_wl_init_c
===================================================================
RCS file: patches/patch-src_wl_init_c
diff -N patches/patch-src_wl_init_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_wl_init_c 25 Nov 2024 08:46:59 -0000
@@ -0,0 +1,50 @@
+Don't load versioned .so files
+
+Index: src/wl_init.c
+--- src/wl_init.c.orig
++++ src/wl_init.c
+@@ -511,7 +511,7 @@ GLFWbool _glfwConnectWayland(int platformID, _GLFWplat
+ .createWindowSurface = _glfwCreateWindowSurfaceWayland
+ };
+
+- void* module = _glfwPlatformLoadModule("libwayland-client.so.0");
++ void* module = _glfwPlatformLoadModule("libwayland-client.so");
+ if (!module)
+ {
+ if (platformID == GLFW_PLATFORM_WAYLAND)
+@@ -624,7 +624,7 @@ int _glfwInitWayland(void)
+ return GLFW_FALSE;
+ }
+
+- _glfw.wl.cursor.handle =
_glfwPlatformLoadModule("libwayland-cursor.so.0");
++ _glfw.wl.cursor.handle = _glfwPlatformLoadModule("libwayland-cursor.so");
+ if (!_glfw.wl.cursor.handle)
+ {
+ _glfwInputError(GLFW_PLATFORM_ERROR,
+@@ -641,7 +641,7 @@ int _glfwInitWayland(void)
+ _glfw.wl.cursor.image_get_buffer = (PFN_wl_cursor_image_get_buffer)
+ _glfwPlatformGetModuleSymbol(_glfw.wl.cursor.handle,
"wl_cursor_image_get_buffer");
+
+- _glfw.wl.egl.handle = _glfwPlatformLoadModule("libwayland-egl.so.1");
++ _glfw.wl.egl.handle = _glfwPlatformLoadModule("libwayland-egl.so");
+ if (!_glfw.wl.egl.handle)
+ {
+ _glfwInputError(GLFW_PLATFORM_ERROR,
+@@ -656,7 +656,7 @@ int _glfwInitWayland(void)
+ _glfw.wl.egl.window_resize = (PFN_wl_egl_window_resize)
+ _glfwPlatformGetModuleSymbol(_glfw.wl.egl.handle,
"wl_egl_window_resize");
+
+- _glfw.wl.xkb.handle = _glfwPlatformLoadModule("libxkbcommon.so.0");
++ _glfw.wl.xkb.handle = _glfwPlatformLoadModule("libxkbcommon.so");
+ if (!_glfw.wl.xkb.handle)
+ {
+ _glfwInputError(GLFW_PLATFORM_ERROR,
+@@ -732,7 +732,7 @@ int _glfwInitWayland(void)
+ }
+
+ if (_glfw.hints.init.wl.libdecorMode == GLFW_WAYLAND_PREFER_LIBDECOR)
+- _glfw.wl.libdecor.handle = _glfwPlatformLoadModule("libdecor-0.so.0");
++ _glfw.wl.libdecor.handle = _glfwPlatformLoadModule("libdecor-0.so");
+
+ if (_glfw.wl.libdecor.handle)
+ {