about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/glfw
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/glfw')
-rw-r--r--nixpkgs/pkgs/development/libraries/glfw/2.x.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/glfw/3.x.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/glfw/x11.patch18
3 files changed, 26 insertions, 5 deletions
diff --git a/nixpkgs/pkgs/development/libraries/glfw/2.x.nix b/nixpkgs/pkgs/development/libraries/glfw/2.x.nix
index d05fa6e5f772..75a7c97db2bd 100644
--- a/nixpkgs/pkgs/development/libraries/glfw/2.x.nix
+++ b/nixpkgs/pkgs/development/libraries/glfw/2.x.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl, libGLU, libGL, libX11, libXext }:
 
 stdenv.mkDerivation rec {
-  name = "glfw-2.7.9";
+  pname = "glfw";
+  version = "2.7.9";
 
   src = fetchurl {
-    url = "mirror://sourceforge/glfw/${name}.tar.bz2";
+    url = "mirror://sourceforge/glfw/glfw-${version}.tar.bz2";
     sha256 = "17c2msdcb7pn3p8f83805h1c216bmdqnbn9hgzr1j8wnwjcpxx6i";
   };
 
diff --git a/nixpkgs/pkgs/development/libraries/glfw/3.x.nix b/nixpkgs/pkgs/development/libraries/glfw/3.x.nix
index f9089384a8a5..53409ec7f732 100644
--- a/nixpkgs/pkgs/development/libraries/glfw/3.x.nix
+++ b/nixpkgs/pkgs/development/libraries/glfw/3.x.nix
@@ -6,17 +6,19 @@
 }:
 
 stdenv.mkDerivation rec {
-  version = "3.3.4";
+  version = "3.3.6";
   pname = "glfw";
 
   src = fetchFromGitHub {
     owner = "glfw";
     repo = "GLFW";
     rev = version;
-    sha256 = "sha256-BP4wxjgm0x0E68tNz5eudkVUyBnXkQlP7LY3ppZunhw=";
+    sha256 = "sha256-mYcnucIRudLLySShKSDzsQfuoM2/0guKpeLSGuAWEkQ=";
   };
 
-  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/nixpkgs/pkgs/development/libraries/glfw/x11.patch b/nixpkgs/pkgs/development/libraries/glfw/x11.patch
new file mode 100644
index 000000000000..5cadf53bfe70
--- /dev/null
+++ b/nixpkgs/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)