~kota/nilsu-pkg-void

e732ad83304599c9868dcee5e221441937e76d3a — Henry Naguski a month ago cb25646
New package: glfw-wayland-minecraft-3.4.0
A srcpkgs/glfw-wayland-minecraft/patches/0003-Don-t-crash-on-calls-to-focus-or-icon.patch => srcpkgs/glfw-wayland-minecraft/patches/0003-Don-t-crash-on-calls-to-focus-or-icon.patch +33 -0
@@ 0,0 1,33 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ecmel=20Berk=20Canl=C4=B1er?= <me@ecmelberk.com>
Date: Tue, 28 Dec 2021 19:41:19 +0300
Subject: Don't crash on calls to focus or icon

---
 src/wl_window.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/wl_window.c b/src/wl_window.c
index 656743a9..c36b11cd 100644
--- a/src/wl_window.c
+++ b/src/wl_window.c
@@ -885,8 +885,7 @@ void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title)
 void _glfwPlatformSetWindowIcon(_GLFWwindow* window,
                                 int count, const GLFWimage* images)
 {
-    _glfwInputError(GLFW_FEATURE_UNAVAILABLE,
-                    "Wayland: The platform does not support setting the window icon");
+    fprintf(stderr, "!!! Ignoring Error: Wayland: The platform does not support setting the window icon\n");
 }
 
 void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos)
@@ -1042,8 +1041,7 @@ void _glfwPlatformRequestWindowAttention(_GLFWwindow* window)
 
 void _glfwPlatformFocusWindow(_GLFWwindow* window)
 {
-    _glfwInputError(GLFW_FEATURE_UNAVAILABLE,
-                    "Wayland: The platform does not support setting the input focus");
+    fprintf(stderr, "!!! Ignoring Error: Wayland: The platform does not support setting the input focus\n");
 }
 
 void _glfwPlatformSetWindowMonitor(_GLFWwindow* window,

A srcpkgs/glfw-wayland-minecraft/patches/0004-wayland-fix-broken-opengl-screenshots-on-mutter.patch => srcpkgs/glfw-wayland-minecraft/patches/0004-wayland-fix-broken-opengl-screenshots-on-mutter.patch +28 -0
@@ 0,0 1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: ninja- <ninja-@users.noreply.github.com>
Date: Tue, 30 Jun 2020 19:41:52 +0200
Subject: wayland: fix broken opengl screenshots on mutter

---
 src/egl_context.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/egl_context.c b/src/egl_context.c
index 975c67be..b5cbeaff 100644
--- a/src/egl_context.c
+++ b/src/egl_context.c
@@ -175,6 +175,14 @@ static GLFWbool chooseEGLConfig(const _GLFWctxconfig* ctxconfig,
         u->samples = getEGLConfigAttrib(n, EGL_SAMPLES);
         u->doublebuffer = desired->doublebuffer;
 
+#if defined(_GLFW_WAYLAND)
+        // Avoid using transparent buffer on Wayland if transparency is not requested.
+        // Otherwise mutter will fail to properly screenshot OpenGL content.
+        if (u->alphaBits > 0 && !desired->transparent) {
+            continue;
+        }
+#endif // _GLFW_WAYLAND
+
         u->handle = (uintptr_t) n;
         usableCount++;
     }

A srcpkgs/glfw-wayland-minecraft/patches/0005-Add-warning-about-being-an-unofficial-patch.patch => srcpkgs/glfw-wayland-minecraft/patches/0005-Add-warning-about-being-an-unofficial-patch.patch +28 -0
@@ 0,0 1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ecmel=20Berk=20Canl=C4=B1er?= <me@ecmelberk.com>
Date: Tue, 28 Dec 2021 19:25:30 +0300
Subject: Add warning about being an unofficial patch

This is just to help mod developers and other people who don't need to
care about this patchset to ignore any issues that are not their fault.
---
 src/init.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/init.c b/src/init.c
index 25a6b4f3..c0ba6d31 100644
--- a/src/init.c
+++ b/src/init.c
@@ -261,6 +261,12 @@ GLFWAPI int glfwInit(void)
     _glfw.timer.offset = _glfwPlatformGetTimerValue();
 
     glfwDefaultWindowHints();
+
+    fprintf(stderr, "!!! Patched GLFW from https://github.com/Admicos/minecraft-wayland\n"
+         "!!! If any issues with the window, or some issues with rendering, occur, "
+         "first try with the built-in GLFW, and if that solves the issue, report there first.\n"
+         "!!! Use outside Minecraft is untested, and things might break.\n");
+
     return GLFW_TRUE;
 }
 

A srcpkgs/glfw-wayland-minecraft/patches/0007-Platform-Prefer-Wayland-over-X11.patch => srcpkgs/glfw-wayland-minecraft/patches/0007-Platform-Prefer-Wayland-over-X11.patch +44 -0
@@ 0,0 1,44 @@
From 352b3bb37d79ddc9b4a7afd9ca8ad26723f17821 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20H=C3=BClsmann?= <fh@cbix.de>
Date: Sun, 30 Jan 2022 00:36:32 +0100
Subject: [PATCH] Platform: Prefer Wayland over X11

When GLFW_ANY_PLATFORM is used (which is the default) native
Wayland would previously never be chosen if XWayland is also available.
---
 README.md      | 1 +
 src/platform.c | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 4a3fb85c5a..9ba2994200 100644
--- a/README.md
+++ b/README.md
@@ -268,6 +268,7 @@ information on what to include when reporting a bug.
  - [Wayland] Added dynamic loading of all Wayland libraries
  - [Wayland] Added support for key names via xkbcommon
  - [Wayland] Removed support for `wl_shell` (#1443)
+ - [Wayland] Prefer Wayland over X11 if both are available (#2035)
  - [Wayland] Bugfix: The `GLFW_HAND_CURSOR` shape used the wrong image (#1432)
  - [Wayland] Bugfix: `CLOCK_MONOTONIC` was not correctly enabled
  - [Wayland] Bugfix: Repeated keys could be reported with `NULL` window (#1704)
diff --git a/src/platform.c b/src/platform.c
index d0bbd06df5..61d06787fb 100644
--- a/src/platform.c
+++ b/src/platform.c
@@ -45,12 +45,12 @@ static const struct
 #if defined(_GLFW_COCOA)
     { GLFW_PLATFORM_COCOA, _glfwConnectCocoa },
 #endif
-#if defined(_GLFW_X11)
-    { GLFW_PLATFORM_X11, _glfwConnectX11 },
-#endif
 #if defined(_GLFW_WAYLAND)
     { GLFW_PLATFORM_WAYLAND, _glfwConnectWayland },
 #endif
+#if defined(_GLFW_X11)
+    { GLFW_PLATFORM_X11, _glfwConnectX11 },
+#endif
 };
 
 GLFWbool _glfwSelectPlatform(int desiredID, _GLFWplatform* platform)

A srcpkgs/glfw-wayland-minecraft/template => srcpkgs/glfw-wayland-minecraft/template +27 -0
@@ 0,0 1,27 @@
# Template file for 'glfw-wayland-minecraft'
pkgname=glfw-wayland-minecraft
version=3.4.0
_git_commit=62e175ef9fae75335575964c845a302447c012c7
revision=1
wrksrc=glfw-${_git_commit}
build_style=cmake
configure_args="-DBUILD_SHARED_LIBS=ON -DGLFW_USE_WAYLAND=ON"
hostmakedepends="extra-cmake-modules pkg-config wayland-devel"
makedepends="MesaLib-devel glu-devel wayland-devel wayland-protocols
 libxkbcommon-devel libXrandr-devel libXinerama-devel libXcursor-devel
 libXi-devel"
short_desc="GLFW with patches for playing minecraft on wayland"
maintainer="Henry Naguski <henry@nilsu.org>"
license="Zlib"
homepage="https://github.com/Admicos/minecraft-wayland"
changelog="https://www.glfw.org/changelog.html"
distfiles="https://github.com/glfw/glfw/archive/${_git_commit}.tar.gz"
checksum=988f96c57ade99885709b3b17c09f2286591941368606537a2f4beee25618bfe
provides="glfw-${version}_${revision}"
replaces="glfw>=0 glfw-wayland>=0"

do_install() {
	vmkdir usr/lib
	install -m755 ${wrksrc}/build/src/libglfw.so.${version%.*} ${DESTDIR}/usr/lib/
	ln -s libglfw.so.${version%.*} ${DESTDIR}/usr/lib/libglfw.so.3
}