hmcl: add libxkbcommon and jdk 25, don't use system glfw by default

LWJGL uses its own glfw fork, and Minecraft 26.1 will crash if you use
the system one.

For those who prefer to use Wayland, you can add `-DMC_DEBUG_ENABLED`
and `-DMC_DEBUG_PREFER_WAYLAND` on JVM arguments to enable Wayland
support, and LWJGL requires libxkbcommon to work on Wayland.

For those who still need system glfw, you can enable it in the advanced
settings of HMCL.
This commit is contained in:
ccicnce113424
2026-04-19 12:51:16 +08:00
parent ecdbf7aeb0
commit 38704fd7ae
+13 -3
View File
@@ -10,7 +10,7 @@
copyDesktopItems,
desktopToDarwinBundle,
jdk,
jdk17,
jdk25,
hmclJdk ? jdk.override {
# Required by jar file
enableJavaFX = true;
@@ -21,13 +21,14 @@
},
minecraftJdks ? [
hmclJdk
jdk17
jdk25
],
libxxf86vm,
libxtst,
libxrandr,
libxext,
libxcursor,
libxkbcommon,
libx11,
xrandr,
glib,
@@ -152,6 +153,7 @@ stdenv.mkDerivation (finalAttrs: {
libxxf86vm
libxext
libxcursor
libxkbcommon
libxrandr
libxtst
libpulseaudio
@@ -192,7 +194,6 @@ stdenv.mkDerivation (finalAttrs: {
lib.makeBinPath (minecraftJdks ++ lib.optional stdenv.hostPlatform.isLinux xrandr)
}" \
--run 'cd $HOME' \
${lib.optionalString stdenv.hostPlatform.isLinux ''--prefix JAVA_TOOL_OPTIONS " " "-Dorg.lwjgl.glfw.libname=${lib.getLib glfw3'}/lib/libglfw.so"''} \
''${gappsWrapperArgs[@]}
'';
@@ -212,6 +213,15 @@ stdenv.mkDerivation (finalAttrs: {
Hello Minecraft! Launcher (HMCL) is a free, open-source, and cross-platform Minecraft launcher.
It provides comprehensive support for managing multiple game versions and mod loaders,
including Forge, NeoForge, Fabric, Quilt, LiteLoader, and OptiFine.
Starting with Minecraft 26.1, Wayland support can be enabled
by adding the JDK arguments -DMC_DEBUG_ENABLED and
-DMC_DEBUG_PREFER_WAYLAND. If needed, configure them in
HMCL -> Advanced Settings -> JVM Options -> JVM Arguments.
Users who are still on an older version and want to use Wayland should
enable HMCL -> Advanced Settings -> Workaround -> Use System GLFW.
Otherwise, keep it disabled.
'';
maintainers = with lib.maintainers; [
daru-san