Merge pull request #147601 from McSinyx/glfw-3.3.5

glfw: 3.3.4 -> 3.3.5 and fix linkage with X11
This commit is contained in:
Guillaume Girol 2021-12-04 08:57:02 +00:00 committed by GitHub
commit b9bb3464ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 3 deletions

View file

@ -6,17 +6,19 @@
}:
stdenv.mkDerivation rec {
version = "3.3.4";
version = "3.3.5";
pname = "glfw";
src = fetchFromGitHub {
owner = "glfw";
repo = "GLFW";
rev = version;
sha256 = "sha256-BP4wxjgm0x0E68tNz5eudkVUyBnXkQlP7LY3ppZunhw=";
sha256 = "sha256-1KkzYclOLGqiV1/8BsJ3e+pXMQ6a+sjLwZ7mjSuxxbA=";
};
patches = lib.optional waylandSupport ./wayland.patch;
# Fix freezing on Wayland (https://github.com/glfw/glfw/pull/1711)
# and linkage issues on X11 (https://github.com/NixOS/nixpkgs/issues/142583)
patches = if waylandSupport then ./wayland.patch else ./x11.patch;
propagatedBuildInputs = [ libGL ];

View file

@ -0,0 +1,18 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a0be580e..ba143851 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -219,6 +219,13 @@ if (GLFW_BUILD_X11)
if (NOT X11_Xshape_INCLUDE_PATH)
message(FATAL_ERROR "X Shape headers not found; install libxext development package")
endif()
+
+ target_link_libraries(glfw PRIVATE ${X11_Xrandr_LIB}
+ ${X11_Xinerama_LIB}
+ ${X11_Xkb_LIB}
+ ${X11_Xcursor_LIB}
+ ${X11_Xi_LIB}
+ ${X11_Xshape_LIB})
endif()
if (UNIX AND NOT APPLE)