From ab633cfc15c9a25347cff380aee27e1202ef7397 Mon Sep 17 00:00:00 2001 From: Synth Morxemplum Date: Sat, 14 Dec 2024 18:21:40 +0800 Subject: [PATCH] mcpelauncher-ui-qt: init at 1.1.2-qt6 Co-authored-by: Aleksana QwQ --- .../dont_download_glfw_ui.patch | 24 +++++++ .../by-name/mc/mcpelauncher-ui-qt/package.nix | 62 +++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 pkgs/by-name/mc/mcpelauncher-ui-qt/dont_download_glfw_ui.patch create mode 100644 pkgs/by-name/mc/mcpelauncher-ui-qt/package.nix diff --git a/pkgs/by-name/mc/mcpelauncher-ui-qt/dont_download_glfw_ui.patch b/pkgs/by-name/mc/mcpelauncher-ui-qt/dont_download_glfw_ui.patch new file mode 100644 index 000000000000..3d28d9b46149 --- /dev/null +++ b/pkgs/by-name/mc/mcpelauncher-ui-qt/dont_download_glfw_ui.patch @@ -0,0 +1,24 @@ +diff -urB mcpelauncher-ui/mcpelauncher-ui-qt/ext/glfw.cmake mcpelauncher-ui-b/mcpelauncher-ui-qt/ext/glfw.cmake +--- mcpelauncher-ui/mcpelauncher-ui-qt/ext/glfw.cmake 2024-11-28 21:12:36.794926431 -0700 ++++ mcpelauncher-ui-b/mcpelauncher-ui-qt/ext/glfw.cmake 2024-12-03 15:04:28.466197081 -0700 +@@ -1,19 +1,2 @@ +-include(FetchContent) +- +-set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE) +-set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE) +-set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) +-set(GLFW_INSTALL OFF CACHE BOOL "" FORCE) +-set(GLFW_BUILD_WAYLAND OFF CACHE BOOL "" FORCE) +- +-FetchContent_Declare( +- glfw3_ext +- URL "https://github.com/glfw/glfw/archive/master.zip" +-) +- +-FetchContent_GetProperties(glfw3_ext) +-if(NOT glfw3_ext_POPULATED) +- FetchContent_Populate(glfw3_ext) +- add_subdirectory(${glfw3_ext_SOURCE_DIR} ${glfw3_ext_BINARY_DIR}) +-endif() ++find_package(glfw3 REQUIRED) + add_library(glfw3 ALIAS glfw) diff --git a/pkgs/by-name/mc/mcpelauncher-ui-qt/package.nix b/pkgs/by-name/mc/mcpelauncher-ui-qt/package.nix new file mode 100644 index 000000000000..6867af4464ee --- /dev/null +++ b/pkgs/by-name/mc/mcpelauncher-ui-qt/package.nix @@ -0,0 +1,62 @@ +{ + lib, + stdenv, + mcpelauncher-client, + fetchFromGitHub, + cmake, + pkg-config, + zlib, + libzip, + curl, + protobuf, + qt6, + glfw, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "mcpelauncher-ui-qt"; + inherit (mcpelauncher-client) version; + + src = fetchFromGitHub { + owner = "minecraft-linux"; + repo = "mcpelauncher-ui-manifest"; + tag = "v${finalAttrs.version}"; + fetchSubmodules = true; + hash = "sha256-R9wE1lS7x1IIPgVahXjF5Yg2ca+GsiQuF41pWf2edXY="; + }; + + patches = [ + ./dont_download_glfw_ui.patch + ]; + + nativeBuildInputs = [ + cmake + pkg-config + qt6.wrapQtAppsHook + ]; + + buildInputs = [ + zlib + libzip + curl + protobuf + qt6.qtwebengine + qt6.qtsvg + qt6.qtwayland + glfw + ]; + + # the program refuses to start when QT_STYLE_OVERRIDE is set + # https://github.com/minecraft-linux/mcpelauncher-ui-qt/issues/25 + preFixup = '' + qtWrapperArgs+=( + --prefix PATH : ${lib.makeBinPath [ mcpelauncher-client ]} + --unset QT_STYLE_OVERRIDE + ) + ''; + + meta = mcpelauncher-client.meta // { + description = "Unofficial Minecraft Bedrock Edition launcher with GUI"; + mainProgram = "mcpelauncher-ui-qt"; + }; +})