Skip to content
Closed
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
64 changes: 0 additions & 64 deletions pkgs/development/libraries/glfw/3.x-wayland-minecraft.nix

This file was deleted.

62 changes: 44 additions & 18 deletions pkgs/development/libraries/glfw/3.x.nix
Original file line number Diff line number Diff line change
@@ -1,56 +1,82 @@
{ 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 ]
++ lib.optionals stdenv.isLinux [ libGL ];

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;
};
}
})
25 changes: 0 additions & 25 deletions pkgs/development/libraries/glfw/wayland.patch

This file was deleted.

32 changes: 1 addition & 31 deletions pkgs/games/prismlauncher/wrapper.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{ lib
, stdenv
, symlinkJoin
, makeWrapper
, wrapQtAppsHook
, addOpenGLRunpath

Expand All @@ -14,7 +13,6 @@
, libpulseaudio
, libGL
, glfw
, glfw-wayland-minecraft
, openal
, jdk8
, jdk17
Expand All @@ -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;
Expand All @@ -59,31 +46,14 @@ 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
qtsvg
]
++ 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 = [
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 @@ -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
Expand Down
4 changes: 0 additions & 4 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down