mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-21 11:34:13 +00:00
glfw: Fix MinGW Build
- Adjust build inputs and CMake flags to support cross-compilation of GLFW. Co-authored-by: Weijia Wang <9713184+wegank@users.noreply.github.com>
This commit is contained in:
parent
23ff652157
commit
3ffc6d1fc8
@ -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;
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user