diff --git a/pkgs/development/libraries/glfw/3.x-wayland-minecraft.nix b/pkgs/development/libraries/glfw/3.x-wayland-minecraft.nix deleted file mode 100644 index 03baa891b3b4d..0000000000000 --- a/pkgs/development/libraries/glfw/3.x-wayland-minecraft.nix +++ /dev/null @@ -1,64 +0,0 @@ -{ stdenv, lib, fetchFromGitHub, fetchpatch2, cmake, extra-cmake-modules -, libGL, wayland, wayland-protocols, libxkbcommon, libdecor -}: - -stdenv.mkDerivation { - version = "unstable-2023-06-01"; - pname = "glfw-wayland-minecraft"; - - src = fetchFromGitHub { - owner = "glfw"; - repo = "GLFW"; - rev = "3eaf1255b29fdf5c2895856c7be7d7185ef2b241"; - sha256 = "sha256-UnwuE/3q6I4dS5syagpnqrDEVDK9XSVdyOg7KNkdUUA="; - }; - - patches = [ - (fetchpatch2 { - url = "https://raw.githubusercontent.com/Admicos/minecraft-wayland/15f88a515c63a9716cfdf4090fab8e16543f4ebd/0003-Don-t-crash-on-calls-to-focus-or-icon.patch"; - hash = "sha256-NZbKh16h+tWXXnz13QcFBFaeGXMNxZKGQb9xJEahFnE="; - }) - (fetchpatch2 { - url = "https://raw.githubusercontent.com/Admicos/minecraft-wayland/15f88a515c63a9716cfdf4090fab8e16543f4ebd/0005-Add-warning-about-being-an-unofficial-patch.patch"; - hash = "sha256-QMUNlnlCeFz5gIVdbM+YXPsrmiOl9cMwuVRSOvlw+T0="; - }) - ]; - - propagatedBuildInputs = [ libGL ]; - - nativeBuildInputs = [ cmake extra-cmake-modules ]; - - buildInputs = [ wayland wayland-protocols libxkbcommon ]; - - cmakeFlags = [ - "-DBUILD_SHARED_LIBS=ON" - "-DGLFW_BUILD_WAYLAND=ON" - "-DGLFW_BUILD_X11=OFF" - "-DCMAKE_C_FLAGS=-D_GLFW_EGL_LIBRARY='\"${lib.getLib libGL}/lib/libEGL.so.1\"'" - ]; - - postPatch = '' - substituteInPlace src/wl_init.c \ - --replace "libxkbcommon.so.0" "${lib.getLib libxkbcommon}/lib/libxkbcommon.so.0" - - substituteInPlace src/wl_init.c \ - --replace "libdecor-0.so.0" "${lib.getLib libdecor}/lib/libdecor-0.so.0" - - substituteInPlace src/wl_init.c \ - --replace "libwayland-client.so.0" "${lib.getLib wayland}/lib/libwayland-client.so.0" - - substituteInPlace src/wl_init.c \ - --replace "libwayland-cursor.so.0" "${lib.getLib wayland}/lib/libwayland-cursor.so.0" - - substituteInPlace src/wl_init.c \ - --replace "libwayland-egl.so.1" "${lib.getLib wayland}/lib/libwayland-egl.so.1" - ''; - - meta = with lib; { - description = "Multi-platform library for creating OpenGL contexts and managing input, including keyboard, mouse, joystick and time - with patches to support Minecraft on Wayland"; - homepage = "https://www.glfw.org/"; - license = licenses.zlib; - maintainers = with maintainers; [ Scrumplex ]; - platforms = platforms.linux; - }; -} diff --git a/pkgs/development/libraries/glfw/3.x.nix b/pkgs/development/libraries/glfw/3.x.nix index 014e5f7e9f0e5..fc60a40e9026b 100644 --- a/pkgs/development/libraries/glfw/3.x.nix +++ b/pkgs/development/libraries/glfw/3.x.nix @@ -1,23 +1,40 @@ -{ 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 +{ stdenv +, lib +, fetchFromGitHub +, cmake +, libGL +, libXrandr +, libXinerama +, libXcursor +, libX11 +, libXi +, libXext +, Carbon +, Cocoa +, Kernel +, OpenGL +, fixDarwinDylibNames +, extra-cmake-modules +, wayland +, wayland-scanner +, wayland-protocols +, libxkbcommon +, libdecor }: -stdenv.mkDerivation rec { - version = "3.3.10"; +stdenv.mkDerivation (finalAttrs: { + version = "3.4"; pname = "glfw"; src = fetchFromGitHub { owner = "glfw"; repo = "GLFW"; - rev = version; - sha256 = "sha256-kTRXsfQ+9PFurG3ffz0lwnITAYAXtNl3h/3O6FSny5o="; + rev = finalAttrs.version; + 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 ] @@ -25,32 +42,41 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames - ++ lib.optional waylandSupport extra-cmake-modules; + ++ lib.optional stdenv.isLinux extra-cmake-modules; 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-scanner wayland-protocols libdecor 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" + + substituteInPlace src/wl_init.c \ + --replace "libdecor-0.so.0" "${lib.getLib libdecor}/lib/libdecor-0.so.0" + + substituteInPlace src/wl_init.c \ + --replace "libwayland-client.so.0" "${lib.getLib wayland}/lib/libwayland-client.so.0" + + substituteInPlace src/wl_init.c \ + --replace "libwayland-cursor.so.0" "${lib.getLib wayland}/lib/libwayland-cursor.so.0" + + substituteInPlace src/wl_init.c \ + --replace "libwayland-egl.so.1" "${lib.getLib wayland}/lib/libwayland-egl.so.1" ''; meta = with lib; { description = "Multi-platform library for creating OpenGL contexts and managing input, including keyboard, mouse, joystick and time"; homepage = "https://www.glfw.org/"; license = licenses.zlib; - maintainers = with maintainers; [ marcweber twey ]; + maintainers = with maintainers; [ marcweber Scrumplex twey ]; platforms = platforms.unix ++ platforms.windows; }; -} +}) diff --git a/pkgs/development/libraries/glfw/wayland.patch b/pkgs/development/libraries/glfw/wayland.patch deleted file mode 100644 index c0c338f845b39..0000000000000 --- a/pkgs/development/libraries/glfw/wayland.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 46fb81c69e8acdb70907409f98dd01e387408414 Mon Sep 17 00:00:00 2001 -From: Stone Tickle -Date: Fri, 5 Jun 2020 12:51:25 +0900 -Subject: [PATCH] set O_NONBLOCK on repeat timerfd - ---- - src/wl_init.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/wl_init.c b/src/wl_init.c -index 49e7cc52..43569bef 100644 ---- a/src/wl_init.c -+++ b/src/wl_init.c -@@ -1166,7 +1166,7 @@ int _glfwPlatformInit(void) - - _glfw.wl.timerfd = -1; - if (_glfw.wl.seatVersion >= 4) -- _glfw.wl.timerfd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC); -+ _glfw.wl.timerfd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK); - - if (_glfw.wl.pointer && _glfw.wl.shm) - { --- -2.31.1 - diff --git a/pkgs/games/prismlauncher/wrapper.nix b/pkgs/games/prismlauncher/wrapper.nix index dafe7276af881..09b999aef3713 100644 --- a/pkgs/games/prismlauncher/wrapper.nix +++ b/pkgs/games/prismlauncher/wrapper.nix @@ -1,7 +1,6 @@ { lib , stdenv , symlinkJoin -, makeWrapper , wrapQtAppsHook , addOpenGLRunpath @@ -14,7 +13,6 @@ , libpulseaudio , libGL , glfw -, glfw-wayland-minecraft , openal , jdk8 , jdk17 @@ -30,22 +28,11 @@ , textToSpeechSupport ? stdenv.isLinux , controllerSupport ? stdenv.isLinux - # Adds `glfw-wayland-minecraft` to `LD_LIBRARY_PATH` - # when launched on wayland, allowing for the game to be run natively. - # Make sure to enable "Use system installation of GLFW" in instance settings - # for this to take effect - # - # Warning: This build of glfw may be unstable, and the launcher - # itself can take slightly longer to start -, withWaylandGLFW ? false - , jdks ? [ jdk17 jdk8 ] , additionalLibs ? [ ] , additionalPrograms ? [ ] }: -assert lib.assertMsg (withWaylandGLFW -> stdenv.isLinux) "withWaylandGLFW is only available on Linux"; - let prismlauncher' = prismlauncher-unwrapped.override { inherit msaClientID gamemodeSupport; @@ -59,10 +46,7 @@ symlinkJoin { nativeBuildInputs = [ wrapQtAppsHook - ] - # purposefully using a shell wrapper here for variable expansion - # see https://github.com/NixOS/nixpkgs/issues/172583 - ++ lib.optional withWaylandGLFW makeWrapper; + ]; buildInputs = [ qtbase @@ -70,20 +54,6 @@ symlinkJoin { ] ++ lib.optional (lib.versionAtLeast qtbase.version "6" && stdenv.isLinux) qtwayland; - waylandPreExec = '' - if [ -n "$WAYLAND_DISPLAY" ]; then - export LD_LIBRARY_PATH=${lib.getLib glfw-wayland-minecraft}/lib:"$LD_LIBRARY_PATH" - fi - ''; - - postBuild = '' - ${lib.optionalString withWaylandGLFW '' - qtWrapperArgs+=(--run "$waylandPreExec") - ''} - - wrapQtAppsHook - ''; - qtWrapperArgs = let runtimeLibs = [ diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 1d55f600d2f97..6b4762e7c480d 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -354,6 +354,8 @@ mapAliases ({ }; # Added 2021-01-14 gitter = throw "gitter has been removed since the client has been abandoned by upstream with the backend migration to Matrix"; # Added 2023-09-18 + glfw-wayland = throw "glfw-wayland has been removed. Use glfw instead"; + glfw-wayland-minecraft = throw "glfw-wayland-minecraft has been removed. Use glfw instead"; glide = throw "'glide' has been removed as it is unmaintained, please use Go modules instead"; # Added 2023-12-26 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 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7261c85d25bd6..66f997e3841bd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -21347,10 +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 { inherit (darwin.apple_sdk.frameworks) Carbon Cocoa Kernel OpenGL;