2023-05-04 17:18:52 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, symlinkJoin
|
|
|
|
, prismlauncher-unwrapped
|
|
|
|
, wrapQtAppsHook
|
2023-09-29 23:04:34 +02:00
|
|
|
, addOpenGLRunpath
|
2023-05-04 17:18:52 +02:00
|
|
|
, qtbase # needed for wrapQtAppsHook
|
|
|
|
, qtsvg
|
|
|
|
, qtwayland
|
|
|
|
, xorg
|
|
|
|
, libpulseaudio
|
|
|
|
, libGL
|
|
|
|
, glfw
|
|
|
|
, openal
|
|
|
|
, jdk8
|
|
|
|
, jdk17
|
|
|
|
, gamemode
|
2023-06-19 22:23:29 +02:00
|
|
|
, flite
|
2023-06-19 22:25:32 +02:00
|
|
|
, mesa-demos
|
2023-11-14 17:50:28 +01:00
|
|
|
, pciutils
|
2023-08-30 21:56:24 +02:00
|
|
|
, udev
|
2023-09-19 19:28:13 +02:00
|
|
|
, libusb1
|
2023-05-15 10:34:03 +02:00
|
|
|
|
|
|
|
, msaClientID ? null
|
2023-07-21 02:21:57 +02:00
|
|
|
, gamemodeSupport ? stdenv.isLinux
|
2023-06-19 22:23:29 +02:00
|
|
|
, textToSpeechSupport ? stdenv.isLinux
|
2023-09-19 19:28:13 +02:00
|
|
|
, controllerSupport ? stdenv.isLinux
|
2023-05-15 10:34:03 +02:00
|
|
|
, jdks ? [ jdk17 jdk8 ]
|
2023-05-04 17:18:52 +02:00
|
|
|
, additionalLibs ? [ ]
|
2023-06-19 22:23:41 +02:00
|
|
|
, additionalPrograms ? [ ]
|
2023-05-04 17:18:52 +02:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
prismlauncherFinal = prismlauncher-unwrapped.override {
|
2023-05-15 10:34:03 +02:00
|
|
|
inherit msaClientID gamemodeSupport;
|
2023-05-04 17:18:52 +02:00
|
|
|
};
|
|
|
|
in
|
|
|
|
symlinkJoin {
|
|
|
|
name = "prismlauncher-${prismlauncherFinal.version}";
|
|
|
|
|
|
|
|
paths = [ prismlauncherFinal ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
wrapQtAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
qtbase
|
|
|
|
qtsvg
|
|
|
|
]
|
2023-07-21 02:21:57 +02:00
|
|
|
++ lib.optional (lib.versionAtLeast qtbase.version "6" && stdenv.isLinux) qtwayland;
|
2023-05-04 17:18:52 +02:00
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
wrapQtAppsHook
|
|
|
|
'';
|
|
|
|
|
|
|
|
qtWrapperArgs =
|
|
|
|
let
|
2023-08-09 20:32:50 +02:00
|
|
|
runtimeLibs = (with xorg; [
|
2023-05-04 17:18:52 +02:00
|
|
|
libX11
|
|
|
|
libXext
|
|
|
|
libXcursor
|
|
|
|
libXrandr
|
|
|
|
libXxf86vm
|
|
|
|
])
|
|
|
|
++ [
|
2023-08-30 21:56:24 +02:00
|
|
|
# lwjgl
|
2023-05-04 17:18:52 +02:00
|
|
|
libpulseaudio
|
|
|
|
libGL
|
|
|
|
glfw
|
|
|
|
openal
|
|
|
|
stdenv.cc.cc.lib
|
2023-08-30 21:56:24 +02:00
|
|
|
|
|
|
|
# oshi
|
|
|
|
udev
|
2023-05-04 17:18:52 +02:00
|
|
|
]
|
|
|
|
++ lib.optional gamemodeSupport gamemode.lib
|
2023-06-19 22:23:29 +02:00
|
|
|
++ lib.optional textToSpeechSupport flite
|
2023-09-19 19:28:13 +02:00
|
|
|
++ lib.optional controllerSupport libusb1
|
2023-05-04 17:18:52 +02:00
|
|
|
++ additionalLibs;
|
|
|
|
|
2023-08-09 20:32:50 +02:00
|
|
|
runtimePrograms = [
|
2023-06-19 22:23:41 +02:00
|
|
|
xorg.xrandr
|
2023-08-09 20:32:50 +02:00
|
|
|
mesa-demos # need glxinfo
|
2023-11-14 17:50:28 +01:00
|
|
|
pciutils # need lspci
|
2023-06-19 22:23:41 +02:00
|
|
|
]
|
|
|
|
++ additionalPrograms;
|
|
|
|
|
2023-05-04 17:18:52 +02:00
|
|
|
in
|
2023-07-21 02:21:57 +02:00
|
|
|
[ "--prefix PRISMLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks}" ]
|
|
|
|
++ lib.optionals stdenv.isLinux [
|
2023-09-29 23:04:34 +02:00
|
|
|
"--set LD_LIBRARY_PATH ${addOpenGLRunpath.driverLink}/lib:${lib.makeLibraryPath runtimeLibs}"
|
2023-05-04 17:18:52 +02:00
|
|
|
# xorg.xrandr needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128
|
2023-08-09 20:32:50 +02:00
|
|
|
"--prefix PATH : ${lib.makeBinPath runtimePrograms}"
|
2023-05-04 17:18:52 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
inherit (prismlauncherFinal) meta;
|
|
|
|
}
|