Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[23.11] prismlauncher: 8.0 -> 8.3 #301756

Merged
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
20 changes: 12 additions & 8 deletions pkgs/games/prismlauncher/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ assert lib.assertMsg (stdenv.isLinux || !gamemodeSupport) "gamemodeSupport is on

stdenv.mkDerivation (finalAttrs: {
pname = "prismlauncher-unwrapped";
version = "8.0";
version = "8.3";

src = fetchFromGitHub {
owner = "PrismLauncher";
repo = "PrismLauncher";
rev = finalAttrs.version;
hash = "sha256-WBajtfj3qAMq8zd2S53CQyHiyqtvffLOHOjmOpdALAA=";
hash = "sha256-1YGzCgNdzscnOVeNlHMFJa0RbMo6C2qQjtBOeDxHakI=";
};

nativeBuildInputs = [ extra-cmake-modules cmake jdk17 ninja canonicalize-jars-hook ];
Expand All @@ -60,7 +60,11 @@ stdenv.mkDerivation (finalAttrs: {
"-DLauncher_BUILD_PLATFORM=nixpkgs"
] ++ lib.optionals (msaClientID != null) [ "-DLauncher_MSA_CLIENT_ID=${msaClientID}" ]
++ lib.optionals (lib.versionOlder qtbase.version "6") [ "-DLauncher_QT_VERSION_MAJOR=5" ]
++ lib.optionals stdenv.isDarwin [ "-DINSTALL_BUNDLE=nodeps" "-DMACOSX_SPARKLE_UPDATE_FEED_URL=''" ];
++ lib.optionals stdenv.isDarwin [
"-DINSTALL_BUNDLE=nodeps"
"-DMACOSX_SPARKLE_UPDATE_FEED_URL=''"
"-DCMAKE_INSTALL_PREFIX=${placeholder "out"}/Applications/"
];

postUnpack = ''
rm -rf source/libraries/libnbtplusplus
Expand All @@ -69,7 +73,7 @@ stdenv.mkDerivation (finalAttrs: {

dontWrapQtApps = true;

meta = with lib; {
meta = {
mainProgram = "prismlauncher";
homepage = "https://prismlauncher.org/";
description = "A free, open source launcher for Minecraft";
Expand All @@ -78,9 +82,9 @@ stdenv.mkDerivation (finalAttrs: {
their own mods, texture packs, saves, etc) and helps you manage them and
their associated options with a simple interface.
'';
platforms = with platforms; linux ++ darwin;
changelog = "https://github.com/PrismLauncher/PrismLauncher/releases/tag/${version}";
license = licenses.gpl3Only;
maintainers = with maintainers; [ minion3665 Scrumplex getchoo ];
platforms = with lib.platforms; linux ++ darwin;
changelog = "https://github.com/PrismLauncher/PrismLauncher/releases/tag/${finalAttrs.version}";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ minion3665 Scrumplex getchoo ];
};
})
63 changes: 48 additions & 15 deletions pkgs/games/prismlauncher/wrapper.nix
Original file line number Diff line number Diff line change
@@ -1,74 +1,107 @@
{ lib
, stdenv
, symlinkJoin
, prismlauncher-unwrapped
, makeWrapper
, wrapQtAppsHook
, addOpenGLRunpath

, prismlauncher-unwrapped

, qtbase # needed for wrapQtAppsHook
, qtsvg
, qtwayland
, xorg
, libpulseaudio
, libGL
, glfw
, glfw-wayland-minecraft
, openal
, jdk8
, jdk17
, jdk21
, gamemode
, flite
, mesa-demos
, pciutils
, udev
, vulkan-loader
, libusb1

, msaClientID ? null
, gamemodeSupport ? stdenv.isLinux
, textToSpeechSupport ? stdenv.isLinux
, controllerSupport ? stdenv.isLinux
, jdks ? [ jdk17 jdk8 ]

# 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 ? [ jdk21 jdk17 jdk8 ]
, additionalLibs ? [ ]
, additionalPrograms ? [ ]
}:

assert lib.assertMsg (withWaylandGLFW -> stdenv.isLinux) "withWaylandGLFW is only available on Linux";

let
prismlauncherFinal = prismlauncher-unwrapped.override {
prismlauncher' = prismlauncher-unwrapped.override {
inherit msaClientID gamemodeSupport;
};
in

symlinkJoin {
name = "prismlauncher-${prismlauncherFinal.version}";
name = "prismlauncher-${prismlauncher'.version}";

paths = [ prismlauncherFinal ];
paths = [ prismlauncher' ];

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 = lib.optionalString withWaylandGLFW ''
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 = (with xorg; [
libX11
libXext
libXcursor
libXrandr
libXxf86vm
])
++ [
runtimeLibs = [
xorg.libX11
xorg.libXext
xorg.libXcursor
xorg.libXrandr
xorg.libXxf86vm

# lwjgl
libpulseaudio
libGL
glfw
openal
stdenv.cc.cc.lib
vulkan-loader # VulkanMod's lwjgl

# oshi
udev
Expand All @@ -93,5 +126,5 @@ symlinkJoin {
"--prefix PATH : ${lib.makeBinPath runtimePrograms}"
];

inherit (prismlauncherFinal) meta;
inherit (prismlauncher') meta;
}
Loading