diff --git a/pkgs/development/libraries/glfw/3.x.nix b/pkgs/development/libraries/glfw/3.x.nix index 15c5e7d9ca58..4e01ca5c2b6e 100644 --- a/pkgs/development/libraries/glfw/3.x.nix +++ b/pkgs/development/libraries/glfw/3.x.nix @@ -19,21 +19,22 @@ stdenv.mkDerivation rec { # Fix linkage issues on X11 (https://github.com/NixOS/nixpkgs/issues/142583) patches = lib.optional (!waylandSupport) ./x11.patch; - propagatedBuildInputs = [ (if stdenv.isDarwin then OpenGL else libGL) ]; + propagatedBuildInputs = + lib.optionals stdenv.isDarwin [ OpenGL ] + ++ lib.optionals stdenv.isLinux [ libGL ]; nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames ++ lib.optional waylandSupport extra-cmake-modules; buildInputs = - if waylandSupport - then [ wayland wayland-protocols libxkbcommon ] - else [ libX11 libXrandr libXinerama libXcursor libXi libXext ] - ++ lib.optionals stdenv.isDarwin [ Carbon Cocoa Kernel ]; + lib.optionals stdenv.isDarwin [ Carbon Cocoa Kernel ] + ++ lib.optionals (stdenv.isLinux && waylandSupport) [ wayland wayland-protocols libxkbcommon ] + ++ lib.optionals (stdenv.isLinux && !waylandSupport) [ libX11 libXrandr libXinerama libXcursor libXi libXext ]; cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" - ] ++ lib.optionals (!stdenv.isDarwin) [ + ] ++ lib.optionals (!stdenv.isDarwin && !stdenv.hostPlatform.isWindows) [ "-DCMAKE_C_FLAGS=-D_GLFW_GLX_LIBRARY='\"${lib.getLib libGL}/lib/libGL.so.1\"'" ] ++ lib.optionals waylandSupport [ "-DGLFW_USE_WAYLAND=ON" @@ -50,6 +51,6 @@ stdenv.mkDerivation rec { homepage = "https://www.glfw.org/"; license = licenses.zlib; maintainers = with maintainers; [ marcweber twey ]; - platforms = platforms.unix; + platforms = platforms.unix ++ platforms.windows; }; }