summary refs log tree commit diff
path: root/pkgs/development/libraries/glfw
diff options
context:
space:
mode:
authorLuflosi <luflosi@luflosi.de>2021-02-02 14:24:19 +0100
committerLuflosi <luflosi@luflosi.de>2021-02-03 12:26:11 +0100
commit682da86024e6102a559bc0cb630dd4155277f353 (patch)
tree43998cf1bf58b253f34e13855a617e0721af426a /pkgs/development/libraries/glfw
parent993bbf7581527a8be13713e34d495127a9fc88d9 (diff)
downloadnixpkgs-682da86024e6102a559bc0cb630dd4155277f353.tar
nixpkgs-682da86024e6102a559bc0cb630dd4155277f353.tar.gz
nixpkgs-682da86024e6102a559bc0cb630dd4155277f353.tar.bz2
nixpkgs-682da86024e6102a559bc0cb630dd4155277f353.tar.lz
nixpkgs-682da86024e6102a559bc0cb630dd4155277f353.tar.xz
nixpkgs-682da86024e6102a559bc0cb630dd4155277f353.tar.zst
nixpkgs-682da86024e6102a559bc0cb630dd4155277f353.zip
glfw: hardwire path to libGL.so.1 the intended way
GLFW provides a better way to specify the path to libGL than to patch the source code.
Diffstat (limited to 'pkgs/development/libraries/glfw')
-rw-r--r--pkgs/development/libraries/glfw/3.x.nix10
1 files changed, 5 insertions, 5 deletions
diff --git a/pkgs/development/libraries/glfw/3.x.nix b/pkgs/development/libraries/glfw/3.x.nix
index 8698b71567e..e2e0ba3bccf 100644
--- a/pkgs/development/libraries/glfw/3.x.nix
+++ b/pkgs/development/libraries/glfw/3.x.nix
@@ -22,11 +22,11 @@ stdenv.mkDerivation rec {
   buildInputs = [ libX11 libXrandr libXinerama libXcursor libXi libXext ]
     ++ lib.optionals stdenv.isDarwin [ Cocoa Kernel ];
 
-  cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
-
-  preConfigure  = lib.optional (!stdenv.isDarwin) ''
-    substituteInPlace src/glx_context.c --replace "libGL.so.1" "${lib.getLib libGL}/lib/libGL.so.1"
-  '';
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+  ] ++ lib.optional (!stdenv.isDarwin) [
+    "-DCMAKE_C_FLAGS=-D_GLFW_GLX_LIBRARY='\"${lib.getLib libGL}/lib/libGL.so.1\"'"
+  ];
 
   meta = with lib; {
     description = "Multi-platform library for creating OpenGL contexts and managing input, including keyboard, mouse, joystick and time";