Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions pkgs/development/libraries/glfw/3.x.nix
Original file line number Diff line number Diff line change
@@ -1,47 +1,54 @@
{ stdenv, lib, fetchFromGitHub, cmake
, libGL, libXrandr, libXinerama, libXcursor, libX11, libXi, libXext
, Carbon, Cocoa, Kernel, OpenGL, fixDarwinDylibNames
, waylandSupport ? false, extra-cmake-modules, wayland
, wayland-protocols, libxkbcommon
, extra-cmake-modules, wayland
, wayland-scanner, wayland-protocols, libxkbcommon
}:

stdenv.mkDerivation rec {
version = "3.3.10";
version = "3.4";
pname = "glfw";

src = fetchFromGitHub {
owner = "glfw";
repo = "GLFW";
rev = version;
sha256 = "sha256-kTRXsfQ+9PFurG3ffz0lwnITAYAXtNl3h/3O6FSny5o=";
sha256 = "sha256-FcnQPDeNHgov1Z07gjFze0VMz2diOrpbKZCsI96ngz0=";
};

# Fix linkage issues on X11 (https://github.com/NixOS/nixpkgs/issues/142583)
patches = lib.optional (!waylandSupport) ./x11.patch;
patches = ./x11.patch;

propagatedBuildInputs =
lib.optionals stdenv.isDarwin [ OpenGL ]
++ lib.optionals stdenv.isLinux [ libGL ];

nativeBuildInputs = [ cmake ]
nativeBuildInputs = [ cmake extra-cmake-modules ]
++ lib.optional stdenv.isDarwin fixDarwinDylibNames
++ lib.optional waylandSupport extra-cmake-modules;
++ lib.optionals stdenv.isLinux [ wayland-scanner ];

buildInputs =
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 ];
++ lib.optionals stdenv.isLinux [
wayland
wayland-protocols
libxkbcommon
libX11
libXrandr
libXinerama
libXcursor
libXi
libXext
];

cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
] ++ 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"
"-DCMAKE_C_FLAGS=-D_GLFW_EGL_LIBRARY='\"${lib.getLib libGL}/lib/libEGL.so.1\"'"
];

postPatch = lib.optionalString waylandSupport ''
postPatch = lib.optionalString stdenv.isLinux ''
substituteInPlace src/wl_init.c \
--replace "libxkbcommon.so.0" "${lib.getLib libxkbcommon}/lib/libxkbcommon.so.0"
'';
Expand Down
2 changes: 2 additions & 0 deletions pkgs/top-level/aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ mapAliases ({

gitter = throw "gitter has been removed since the client has been abandoned by upstream with the backend migration to Matrix"; # Added 2023-09-18
glide = throw "'glide' has been removed as it is unmaintained, please use Go modules instead"; # Added 2023-12-26
glfw-wayland = glfw; # Added 2024-04-19
gmailieer = lieer; # Added 2020-04-19
gmic-qt-krita = throw "gmic-qt-krita was removed as it's no longer supported upstream."; # Converted to throw 2023-02-02
gnatboot11 = gnat-bootstrap11;
Expand Down Expand Up @@ -1167,6 +1168,7 @@ mapAliases ({
virtmanager-qt = throw "'virtmanager-qt' has been renamed to/replaced by 'virt-manager-qt'"; # Converted to throw 2023-09-10
vivaldi-widevine = throw "'vivaldi-widevine' has been renamed to/replaced by 'widevine-cdm'"; # Added 2023-02-25
vkBasalt = vkbasalt; # Added 2022-11-22
vkdt-wayland = vkdt; # Added 2024-04-19
vsmtp = throw "'vsmtp' has been removed, upstream gone"; # Added 2023-12-18
vte_290 = throw "'vte_290' has been renamed to/replaced by 'vte'"; # Added 2023-01-05
varnish72 = throw "varnish 7.2 is EOL. Either use the LTS or upgrade."; # Added 2023-10-09
Expand Down
5 changes: 0 additions & 5 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21347,9 +21347,6 @@ with pkgs;
};

glfw = glfw3;
glfw-wayland = glfw.override {
waylandSupport = true;
};
glfw-wayland-minecraft = callPackage ../development/libraries/glfw/3.x-wayland-minecraft.nix {};
glfw2 = callPackage ../development/libraries/glfw/2.x.nix { };
glfw3 = callPackage ../development/libraries/glfw/3.x.nix {
Expand Down Expand Up @@ -25214,8 +25211,6 @@ with pkgs;

vkdt = callPackage ../applications/graphics/vkdt { };

vkdt-wayland = callPackage ../applications/graphics/vkdt { glfw = glfw-wayland; };

vlock = callPackage ../misc/screensavers/vlock { };

virtualpg = callPackage ../development/libraries/virtualpg { };
Expand Down