chore(nix): sync with nixpkgs
Signed-off-by: seth <getchoo@tuta.io> (cherry picked from commit a5c554cf6ee32afa41c5a2af1ea8e8feb0087a49)
This commit is contained in:
parent
dde5fc47d3
commit
5f06517b62
@ -9,20 +9,21 @@
|
|||||||
ghc_filesystem,
|
ghc_filesystem,
|
||||||
jdk17,
|
jdk17,
|
||||||
kdePackages,
|
kdePackages,
|
||||||
|
libnbtplusplus,
|
||||||
ninja,
|
ninja,
|
||||||
nix-filter,
|
nix-filter,
|
||||||
self,
|
self,
|
||||||
stripJavaArchivesHook,
|
stripJavaArchivesHook,
|
||||||
tomlplusplus,
|
tomlplusplus,
|
||||||
zlib,
|
|
||||||
msaClientID ? null,
|
|
||||||
gamemodeSupport ? stdenv.isLinux,
|
|
||||||
version,
|
version,
|
||||||
libnbtplusplus,
|
zlib,
|
||||||
|
|
||||||
|
msaClientID ? null,
|
||||||
|
gamemodeSupport ? stdenv.hostPlatform.isLinux,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert lib.assertMsg (
|
assert lib.assertMsg (
|
||||||
gamemodeSupport -> stdenv.isLinux
|
gamemodeSupport -> stdenv.hostPlatform.isLinux
|
||||||
) "gamemodeSupport is only available on Linux.";
|
) "gamemodeSupport is only available on Linux.";
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
@ -66,20 +67,23 @@ stdenv.mkDerivation {
|
|||||||
tomlplusplus
|
tomlplusplus
|
||||||
zlib
|
zlib
|
||||||
]
|
]
|
||||||
++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Cocoa ]
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.Cocoa ]
|
||||||
++ lib.optional gamemodeSupport gamemode;
|
++ lib.optional gamemodeSupport gamemode;
|
||||||
|
|
||||||
hardeningEnable = lib.optionals stdenv.isLinux [ "pie" ];
|
hardeningEnable = lib.optionals stdenv.hostPlatform.isLinux [ "pie" ];
|
||||||
|
|
||||||
cmakeFlags =
|
cmakeFlags =
|
||||||
[ (lib.cmakeFeature "Launcher_BUILD_PLATFORM" "nixpkgs") ]
|
[
|
||||||
|
# downstream branding
|
||||||
|
(lib.cmakeFeature "Launcher_BUILD_PLATFORM" "nixpkgs")
|
||||||
|
]
|
||||||
++ lib.optionals (msaClientID != null) [
|
++ lib.optionals (msaClientID != null) [
|
||||||
(lib.cmakeFeature "Launcher_MSA_CLIENT_ID" (toString msaClientID))
|
(lib.cmakeFeature "Launcher_MSA_CLIENT_ID" (toString msaClientID))
|
||||||
]
|
]
|
||||||
++ lib.optionals (lib.versionOlder kdePackages.qtbase.version "6") [
|
++ lib.optionals (lib.versionOlder kdePackages.qtbase.version "6") [
|
||||||
(lib.cmakeFeature "Launcher_QT_VERSION_MAJOR" "5")
|
(lib.cmakeFeature "Launcher_QT_VERSION_MAJOR" "5")
|
||||||
]
|
]
|
||||||
++ lib.optionals stdenv.isDarwin [
|
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||||
# we wrap our binary manually
|
# we wrap our binary manually
|
||||||
(lib.cmakeFeature "INSTALL_BUNDLE" "nodeps")
|
(lib.cmakeFeature "INSTALL_BUNDLE" "nodeps")
|
||||||
# disable built-in updater
|
# disable built-in updater
|
||||||
|
115
nix/wrapper.nix
115
nix/wrapper.nix
@ -1,73 +1,65 @@
|
|||||||
{
|
{
|
||||||
lib,
|
addDriverRunpath,
|
||||||
stdenv,
|
alsa-lib,
|
||||||
symlinkJoin,
|
|
||||||
prismlauncher-unwrapped,
|
|
||||||
addOpenGLRunpath,
|
|
||||||
flite,
|
flite,
|
||||||
gamemode,
|
gamemode,
|
||||||
glfw,
|
glfw3-minecraft,
|
||||||
glfw-wayland-minecraft,
|
|
||||||
glxinfo,
|
|
||||||
jdk8,
|
|
||||||
jdk17,
|
jdk17,
|
||||||
jdk21,
|
jdk21,
|
||||||
|
jdk8,
|
||||||
kdePackages,
|
kdePackages,
|
||||||
|
lib,
|
||||||
libGL,
|
libGL,
|
||||||
|
libX11,
|
||||||
|
libXcursor,
|
||||||
|
libXext,
|
||||||
|
libXrandr,
|
||||||
|
libXxf86vm,
|
||||||
|
libjack2,
|
||||||
libpulseaudio,
|
libpulseaudio,
|
||||||
libusb1,
|
libusb1,
|
||||||
makeWrapper,
|
mesa-demos,
|
||||||
openal,
|
openal,
|
||||||
pciutils,
|
pciutils,
|
||||||
|
pipewire,
|
||||||
|
prismlauncher-unwrapped,
|
||||||
|
stdenv,
|
||||||
|
symlinkJoin,
|
||||||
udev,
|
udev,
|
||||||
vulkan-loader,
|
vulkan-loader,
|
||||||
xorg,
|
xrandr,
|
||||||
|
|
||||||
additionalLibs ? [ ],
|
additionalLibs ? [ ],
|
||||||
additionalPrograms ? [ ],
|
additionalPrograms ? [ ],
|
||||||
controllerSupport ? stdenv.isLinux,
|
controllerSupport ? stdenv.hostPlatform.isLinux,
|
||||||
gamemodeSupport ? stdenv.isLinux,
|
gamemodeSupport ? stdenv.hostPlatform.isLinux,
|
||||||
jdks ? [
|
jdks ? [
|
||||||
jdk21
|
jdk21
|
||||||
jdk17
|
jdk17
|
||||||
jdk8
|
jdk8
|
||||||
],
|
],
|
||||||
msaClientID ? null,
|
msaClientID ? null,
|
||||||
textToSpeechSupport ? stdenv.isLinux,
|
textToSpeechSupport ? stdenv.hostPlatform.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,
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert lib.assertMsg (
|
assert lib.assertMsg (
|
||||||
controllerSupport -> stdenv.isLinux
|
controllerSupport -> stdenv.hostPlatform.isLinux
|
||||||
) "controllerSupport only has an effect on Linux.";
|
) "controllerSupport only has an effect on Linux.";
|
||||||
|
|
||||||
assert lib.assertMsg (
|
assert lib.assertMsg (
|
||||||
textToSpeechSupport -> stdenv.isLinux
|
textToSpeechSupport -> stdenv.hostPlatform.isLinux
|
||||||
) "textToSpeechSupport only has an effect on Linux.";
|
) "textToSpeechSupport only has an effect on Linux.";
|
||||||
|
|
||||||
assert lib.assertMsg (
|
|
||||||
withWaylandGLFW -> stdenv.isLinux
|
|
||||||
) "withWaylandGLFW is only available on Linux.";
|
|
||||||
|
|
||||||
let
|
let
|
||||||
prismlauncher' = prismlauncher-unwrapped.override { inherit msaClientID gamemodeSupport; };
|
prismlauncher' = prismlauncher-unwrapped.override { inherit msaClientID gamemodeSupport; };
|
||||||
in
|
in
|
||||||
|
|
||||||
symlinkJoin {
|
symlinkJoin {
|
||||||
name = "prismlauncher-${prismlauncher'.version}";
|
name = "prismlauncher-${prismlauncher'.version}";
|
||||||
|
|
||||||
paths = [ prismlauncher' ];
|
paths = [ prismlauncher' ];
|
||||||
|
|
||||||
nativeBuildInputs =
|
nativeBuildInputs = [ kdePackages.wrapQtAppsHook ];
|
||||||
[ kdePackages.wrapQtAppsHook ]
|
|
||||||
# purposefully using a shell wrapper here for variable expansion
|
|
||||||
# see https://github.com/NixOS/nixpkgs/issues/172583
|
|
||||||
++ lib.optional withWaylandGLFW makeWrapper;
|
|
||||||
|
|
||||||
buildInputs =
|
buildInputs =
|
||||||
[
|
[
|
||||||
@ -75,45 +67,39 @@ symlinkJoin {
|
|||||||
kdePackages.qtsvg
|
kdePackages.qtsvg
|
||||||
]
|
]
|
||||||
++ lib.optional (
|
++ lib.optional (
|
||||||
lib.versionAtLeast kdePackages.qtbase.version "6" && stdenv.isLinux
|
lib.versionAtLeast kdePackages.qtbase.version "6" && stdenv.hostPlatform.isLinux
|
||||||
) kdePackages.qtwayland;
|
) kdePackages.qtwayland;
|
||||||
|
|
||||||
env = {
|
postBuild = ''
|
||||||
waylandPreExec = lib.optionalString withWaylandGLFW ''
|
wrapQtAppsHook
|
||||||
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 =
|
qtWrapperArgs =
|
||||||
let
|
let
|
||||||
runtimeLibs =
|
runtimeLibs =
|
||||||
[
|
[
|
||||||
# lwjgl
|
|
||||||
glfw
|
|
||||||
libpulseaudio
|
|
||||||
libGL
|
|
||||||
openal
|
|
||||||
stdenv.cc.cc.lib
|
stdenv.cc.cc.lib
|
||||||
|
## native versions
|
||||||
|
glfw3-minecraft
|
||||||
|
openal
|
||||||
|
|
||||||
vulkan-loader # VulkanMod's lwjgl
|
## openal
|
||||||
|
alsa-lib
|
||||||
|
libjack2
|
||||||
|
libpulseaudio
|
||||||
|
pipewire
|
||||||
|
|
||||||
|
## glfw
|
||||||
|
libGL
|
||||||
|
libX11
|
||||||
|
libXcursor
|
||||||
|
libXext
|
||||||
|
libXrandr
|
||||||
|
libXxf86vm
|
||||||
|
|
||||||
udev # oshi
|
udev # oshi
|
||||||
|
|
||||||
xorg.libX11
|
vulkan-loader # VulkanMod's lwjgl
|
||||||
xorg.libXext
|
|
||||||
xorg.libXcursor
|
|
||||||
xorg.libXrandr
|
|
||||||
xorg.libXxf86vm
|
|
||||||
]
|
]
|
||||||
++ lib.optional textToSpeechSupport flite
|
++ lib.optional textToSpeechSupport flite
|
||||||
++ lib.optional gamemodeSupport gamemode.lib
|
++ lib.optional gamemodeSupport gamemode.lib
|
||||||
@ -121,14 +107,15 @@ symlinkJoin {
|
|||||||
++ additionalLibs;
|
++ additionalLibs;
|
||||||
|
|
||||||
runtimePrograms = [
|
runtimePrograms = [
|
||||||
glxinfo
|
mesa-demos
|
||||||
pciutils # need lspci
|
pciutils # need lspci
|
||||||
xorg.xrandr # needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128
|
xrandr # needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128
|
||||||
] ++ additionalPrograms;
|
] ++ additionalPrograms;
|
||||||
|
|
||||||
in
|
in
|
||||||
[ "--prefix PRISMLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks}" ]
|
[ "--prefix PRISMLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks}" ]
|
||||||
++ lib.optionals stdenv.isLinux [
|
++ lib.optionals stdenv.hostPlatform.isLinux [
|
||||||
"--set LD_LIBRARY_PATH ${addOpenGLRunpath.driverLink}/lib:${lib.makeLibraryPath runtimeLibs}"
|
"--set LD_LIBRARY_PATH ${addDriverRunpath.driverLink}/lib:${lib.makeLibraryPath runtimeLibs}"
|
||||||
"--prefix PATH : ${lib.makeBinPath runtimePrograms}"
|
"--prefix PATH : ${lib.makeBinPath runtimePrograms}"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user