about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/glfw
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-08-26 09:19:25 +0000
committerAlyssa Ross <hi@alyssa.is>2023-08-26 09:19:25 +0000
commit55abc327b49b4097e48c916e40803caa8cf46e8f (patch)
tree1c0420ab3fb21d9485460b912f1c3eae18781871 /nixpkgs/pkgs/development/libraries/glfw
parent7936cf821dccc1eaade44b852db09d03fae8e5f3 (diff)
parent18324978d632ffc55ef1d928e81630c620f4f447 (diff)
downloadnixlib-55abc327b49b4097e48c916e40803caa8cf46e8f.tar
nixlib-55abc327b49b4097e48c916e40803caa8cf46e8f.tar.gz
nixlib-55abc327b49b4097e48c916e40803caa8cf46e8f.tar.bz2
nixlib-55abc327b49b4097e48c916e40803caa8cf46e8f.tar.lz
nixlib-55abc327b49b4097e48c916e40803caa8cf46e8f.tar.xz
nixlib-55abc327b49b4097e48c916e40803caa8cf46e8f.tar.zst
nixlib-55abc327b49b4097e48c916e40803caa8cf46e8f.zip
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs
Conflicts:
	nixpkgs/pkgs/build-support/go/module.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/glfw')
-rw-r--r--nixpkgs/pkgs/development/libraries/glfw/3.x-wayland-minecraft.nix55
1 files changed, 55 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/glfw/3.x-wayland-minecraft.nix b/nixpkgs/pkgs/development/libraries/glfw/3.x-wayland-minecraft.nix
new file mode 100644
index 000000000000..38821c7d9630
--- /dev/null
+++ b/nixpkgs/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;
+  };
+}