From 56391a5c5766d58b4df3ccf0a7363454498cae7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Sat, 27 Nov 2021 22:11:44 +0700 Subject: [PATCH 1/2] glfw: 3.3.4 -> 3.3.5 --- pkgs/development/libraries/glfw/3.x.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/glfw/3.x.nix b/pkgs/development/libraries/glfw/3.x.nix index f9089384a8a5..0189f9c141dd 100644 --- a/pkgs/development/libraries/glfw/3.x.nix +++ b/pkgs/development/libraries/glfw/3.x.nix @@ -6,14 +6,14 @@ }: 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; From 95d7a591ea99e30a7baaf41ccc1a883bc9c1370d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Sat, 27 Nov 2021 22:12:34 +0700 Subject: [PATCH 2/2] glfw: patch linkage with X11 --- pkgs/development/libraries/glfw/3.x.nix | 4 +++- pkgs/development/libraries/glfw/x11.patch | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/libraries/glfw/x11.patch diff --git a/pkgs/development/libraries/glfw/3.x.nix b/pkgs/development/libraries/glfw/3.x.nix index 0189f9c141dd..a860eed37a72 100644 --- a/pkgs/development/libraries/glfw/3.x.nix +++ b/pkgs/development/libraries/glfw/3.x.nix @@ -16,7 +16,9 @@ stdenv.mkDerivation rec { 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 ]; diff --git a/pkgs/development/libraries/glfw/x11.patch b/pkgs/development/libraries/glfw/x11.patch new file mode 100644 index 000000000000..5cadf53bfe70 --- /dev/null +++ b/pkgs/development/libraries/glfw/x11.patch @@ -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)