glfw-wayland-minecraft

This commit is contained in:
Nathan McCarty 2023-02-08 22:28:04 -05:00
parent 1095ae3b12
commit 6a0d199b34
Signed by: thatonelutenist
GPG Key ID: D70DA3DD4D1E9F96
7 changed files with 51 additions and 27 deletions

View File

@ -4,33 +4,8 @@ in with lib; {
config = mkIf np.games {
environment.systemPackages = let
# https://github.com/Admicos/minecraft-wayland
glfw-patched = pkgs.glfw-wayland.overrideAttrs (attrs: {
src = pkgs.fetchzip {
version = "3.4.0";
url =
"https://github.com/glfw/glfw/archive/62e175ef9fae75335575964c845a302447c012c7.tar.gz";
sha256 = "sha256-GiY4d7xadR0vN5uCQyWaOpoo2o6uMGl1fCcX4uDGnks=";
};
buildInputs = with pkgs;
with pkgs.xorg; [
wayland
wayland-protocols
libxkbcommon
libX11
libXrandr
libXinerama
libXcursor
libXi
libXext
];
patches = [
../../../patches/minecraft/0003-Don-t-crash-on-calls-to-focus-or-icon.patch
../../../patches/minecraft/0004-wayland-fix-broken-opengl-screenshots-on-mutter.patch
../../../patches/minecraft/0005-Add-warning-about-being-an-unofficial-patch.patch
# ../../../patches/minecraft/0006-Don-t-crash-getting-scancode-name.patch
../../../patches/minecraft/0007-Platform-Prefer-Wayland-over-X11.patch
];
});
glfw-patched =
pkgs.callPackage ../../../packages/glfw-minecraft-wayland { };
stable-packages = with pkgs; [
# Dwarf fortress
(dwarf-fortress-packages.dwarf-fortress-full.override {

View File

@ -0,0 +1,49 @@
{ stdenv, lib, fetchzip, cmake, libGL, libXrandr, libXinerama, libXcursor
, libX11, libXi, libXext, extra-cmake-modules, wayland, wayland-protocols
, libxkbcommon }:
stdenv.mkDerivation rec {
version = "3.4.0+1.19";
pname = "glfw";
src = fetchzip {
url =
"https://github.com/glfw/glfw/archive/62e175ef9fae75335575964c845a302447c012c7.tar.gz";
sha256 = "sha256-GiY4d7xadR0vN5uCQyWaOpoo2o6uMGl1fCcX4uDGnks=";
};
patches = [
./0003-Don-t-crash-on-calls-to-focus-or-icon.patch
./0004-wayland-fix-broken-opengl-screenshots-on-mutter.patch
./0005-Add-warning-about-being-an-unofficial-patch.patch
./0007-Platform-Prefer-Wayland-over-X11.patch
];
propagatedBuildInputs =
[ libGL libX11 libXrandr libXinerama libXcursor libXi libXext ];
nativeBuildInputs = [ cmake extra-cmake-modules ];
buildInputs = [ wayland wayland-protocols libxkbcommon ];
cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
"-DGLFW_USE_WAYLAND=ON"
"-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"
'';
meta = with lib; {
description =
"Multi-platform library for creating OpenGL contexts and managing input, including keyboard, mouse, joystick and time";
homepage = "https://www.glfw.org/";
license = licenses.zlib;
maintainers = with maintainers; [ marcweber twey ];
platforms = platforms.unix;
};
}