Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 1 | { lib |
| 2 | , stdenv |
| 3 | , fetchFromGitHub |
| 4 | , cmake |
| 5 | , jdk8 |
| 6 | , jdk |
| 7 | , zlib |
| 8 | , file |
| 9 | , wrapQtAppsHook |
| 10 | , xorg |
| 11 | , libpulseaudio |
| 12 | , qtbase |
| 13 | , libGL |
| 14 | , quazip |
| 15 | , glfw |
| 16 | , openal |
| 17 | , msaClientID ? "" |
| 18 | , jdks ? [ jdk jdk8 ] |
| 19 | , extra-cmake-modules |
| 20 | , tomlplusplus |
| 21 | , ghc_filesystem |
| 22 | , libnbtplusplus |
| 23 | , |
| 24 | }: |
| 25 | let |
Skyler Grey | 68791c8 | 2022-10-31 00:26:04 +0000 | [diff] [blame] | 26 | rev = "243600b75babc636bdd1ac0dc8fd5fa4a2db1a0c"; |
| 27 | sha256 = "sha256-cDwa6NeZew+MubtRmUViLA8gUaoH3AMxD9PdQcgSgSU="; |
| 28 | |
| 29 | libnbtplusplus = fetchFromGitHub { |
| 30 | owner = "ljfa-ag"; |
| 31 | repo = "libnbtplusplus"; |
| 32 | rev = "v2.5"; |
| 33 | sha256 = "sha256-4PHKPbWIWAy9ym25M4SnllTkrqnR+g/0AOqyMBZcdX4="; |
| 34 | }; |
| 35 | in |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 36 | stdenv.mkDerivation { |
| 37 | pname = "prismlauncher"; |
| 38 | version = builtins.substring 0 7 rev; |
Skyler Grey | 68791c8 | 2022-10-31 00:26:04 +0000 | [diff] [blame] | 39 | |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 40 | src = fetchFromGitHub { |
| 41 | owner = "PlaceholderMC"; |
| 42 | repo = "PrismLauncher"; |
| 43 | inherit rev sha256; |
| 44 | }; |
Skyler Grey | 68791c8 | 2022-10-31 00:26:04 +0000 | [diff] [blame] | 45 | |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 46 | postUnpack = '' |
| 47 | rm -rf source/libraries/libnbtplusplus |
| 48 | mkdir source/libraries/libnbtplusplus |
| 49 | cp -a ${libnbtplusplus}/* source/libraries/libnbtplusplus |
| 50 | chmod -R a+r+w source/libraries/libnbtplusplus |
| 51 | chown -R $USER: source/libraries/libnbtplusplus |
| 52 | ls source/libraries/libnbtplusplus/* |
| 53 | ''; |
Skyler Grey | 68791c8 | 2022-10-31 00:26:04 +0000 | [diff] [blame] | 54 | |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 55 | nativeBuildInputs = [ extra-cmake-modules tomlplusplus ghc_filesystem cmake file jdk wrapQtAppsHook ]; |
| 56 | buildInputs = [ qtbase zlib quazip ]; |
Skyler Grey | 68791c8 | 2022-10-31 00:26:04 +0000 | [diff] [blame] | 57 | |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 58 | cmakeFlags = lib.optionals (msaClientID != "") [ "-DLauncher_MSA_CLIENT_ID=${msaClientID}" ]; |
Skyler Grey | 68791c8 | 2022-10-31 00:26:04 +0000 | [diff] [blame] | 59 | |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 60 | dontWrapQtApps = true; |
Skyler Grey | 68791c8 | 2022-10-31 00:26:04 +0000 | [diff] [blame] | 61 | |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 62 | postInstall = |
| 63 | let |
Skyler Grey | 68791c8 | 2022-10-31 00:26:04 +0000 | [diff] [blame] | 64 | libpath = with xorg; |
| 65 | lib.makeLibraryPath [ |
| 66 | libX11 |
| 67 | libXext |
| 68 | libXcursor |
| 69 | libXrandr |
| 70 | libXxf86vm |
| 71 | libpulseaudio |
| 72 | libGL |
| 73 | glfw |
| 74 | openal |
| 75 | stdenv.cc.cc.lib |
| 76 | ]; |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 77 | in |
| 78 | '' |
Skyler Grey | 68791c8 | 2022-10-31 00:26:04 +0000 | [diff] [blame] | 79 | # xorg.xrandr needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128 |
| 80 | wrapQtApp $out/bin/prismlauncher \ |
| 81 | --set LD_LIBRARY_PATH /run/opengl-driver/lib:${libpath} \ |
| 82 | --prefix PRISMLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks} \ |
| 83 | --prefix PATH : ${lib.makeBinPath [xorg.xrandr]} |
| 84 | ''; |
| 85 | |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 86 | meta = with lib; { |
| 87 | homepage = "https://github.com/PlaceholderMC/PrismLauncher/"; |
| 88 | description = "A free, open source launcher for Minecraft"; |
| 89 | longDescription = '' |
| 90 | Allows you to have multiple, separate instances of Minecraft (each with |
| 91 | their own mods, texture packs, saves, etc) and helps you manage them and |
| 92 | their associated options with a simple interface. |
| 93 | ''; |
| 94 | platforms = platforms.linux; |
| 95 | /* |
Skyler Grey | 68791c8 | 2022-10-31 00:26:04 +0000 | [diff] [blame] | 96 | changelog = "https://github.com/PlaceholderMC/PrismLauncher/releases/tag/${version}"; |
| 97 | */ |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 98 | license = licenses.gpl3Only; |
| 99 | maintainers = with maintainers; [ minion3665 ]; |
| 100 | }; |
| 101 | } |