summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2023-07-17 11:45:48 +0200
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2023-09-06 06:37:49 +0000
commit2073d72443db0c6d13e86be71a6587b8c57e4221 (patch)
tree0d3c90538876fc7d13cedf839d22d18ef0472d04
parentMerge #252113: mariadb*: patch-level updates (diff)
downloadnixpkgs-origin/backport-243950-to-release-23.05.tar.gz
glfw-wayland-minecraft: init at unstable-2023-06-01origin/backport-243950-to-release-23.05
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net> (cherry picked from commit c59dad9a74e37d27be4b028e3ef008be5b5a8ca1)
-rw-r--r--pkgs/development/libraries/glfw/3.x-wayland-minecraft.nix55
-rw-r--r--pkgs/top-level/all-packages.nix1
2 files changed, 56 insertions, 0 deletions
diff --git a/pkgs/development/libraries/glfw/3.x-wayland-minecraft.nix b/pkgs/development/libraries/glfw/3.x-wayland-minecraft.nix
new file mode 100644
index 000000000000..38821c7d9630
--- /dev/null
+++ b/pkgs/development/libraries/glfw/3.x-wayland-minecraft.nix
@@ -0,0 +1,55 @@
+{ stdenv, lib, fetchFromGitHub, fetchpatch2, cmake, extra-cmake-modules
+, libGL, wayland, wayland-protocols, libxkbcommon, libdecor
+}:
+
+stdenv.mkDerivation {
+ version = "unstable-2023-06-01";
+ pname = "glfw-wayland-minecraft";
+
+ src = fetchFromGitHub {
+ owner = "glfw";
+ repo = "GLFW";
+ rev = "3eaf1255b29fdf5c2895856c7be7d7185ef2b241";
+ sha256 = "sha256-UnwuE/3q6I4dS5syagpnqrDEVDK9XSVdyOg7KNkdUUA=";
+ };
+
+ patches = [
+ (fetchpatch2 {
+ url = "https://raw.githubusercontent.com/Admicos/minecraft-wayland/15f88a515c63a9716cfdf4090fab8e16543f4ebd/0003-Don-t-crash-on-calls-to-focus-or-icon.patch";
+ hash = "sha256-NZbKh16h+tWXXnz13QcFBFaeGXMNxZKGQb9xJEahFnE=";
+ })
+ (fetchpatch2 {
+ url = "https://raw.githubusercontent.com/Admicos/minecraft-wayland/15f88a515c63a9716cfdf4090fab8e16543f4ebd/0005-Add-warning-about-being-an-unofficial-patch.patch";
+ hash = "sha256-QMUNlnlCeFz5gIVdbM+YXPsrmiOl9cMwuVRSOvlw+T0=";
+ })
+ ];
+
+ propagatedBuildInputs = [ libGL ];
+
+ nativeBuildInputs = [ cmake extra-cmake-modules ];
+
+ buildInputs = [ wayland wayland-protocols libxkbcommon ];
+
+ cmakeFlags = [
+ "-DBUILD_SHARED_LIBS=ON"
+ "-DGLFW_BUILD_WAYLAND=ON"
+ "-DGLFW_BUILD_X11=OFF"
+ "-DCMAKE_C_FLAGS=-D_GLFW_EGL_LIBRARY='\"${lib.getLib libGL}/lib/libEGL.so.1\"'"
+ ];
+
+ postPatch = ''
+ substituteInPlace src/wl_init.c \
+ --replace "libxkbcommon.so.0" "${lib.getLib libxkbcommon}/lib/libxkbcommon.so.0"
+
+ substituteInPlace src/wl_init.c \
+ --replace "libdecor-0.so.0" "${lib.getLib libdecor}/lib/libdecor-0.so.0"
+ '';
+
+ meta = with lib; {
+ description = "Multi-platform library for creating OpenGL contexts and managing input, including keyboard, mouse, joystick and time - with patches to support Minecraft on Wayland";
+ homepage = "https://www.glfw.org/";
+ license = licenses.zlib;
+ maintainers = with maintainers; [ Scrumplex ];
+ platforms = platforms.linux;
+ };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index d91354a6156e..3d062b69c3ca 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -20649,6 +20649,7 @@ with pkgs;
glfw-wayland = glfw.override {
waylandSupport = true;
};
+ glfw-wayland-minecraft = callPackage ../development/libraries/glfw/3.x-wayland-minecraft.nix {};
glfw2 = callPackage ../development/libraries/glfw/2.x.nix { };
glfw3 = callPackage ../development/libraries/glfw/3.x.nix {
inherit (darwin.apple_sdk.frameworks) Cocoa Kernel;