2023-05-27 18:45:28 +01:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
2023-08-23 10:52:31 +01:00
|
|
|
canonicalize-jars-hook,
|
2023-05-27 18:45:28 +01:00
|
|
|
cmake,
|
2023-08-04 16:55:31 +01:00
|
|
|
cmark,
|
|
|
|
Cocoa,
|
2023-05-27 18:45:28 +01:00
|
|
|
ninja,
|
|
|
|
jdk17,
|
|
|
|
zlib,
|
|
|
|
qtbase,
|
|
|
|
quazip,
|
|
|
|
extra-cmake-modules,
|
|
|
|
tomlplusplus,
|
2023-06-02 11:41:18 +01:00
|
|
|
ghc_filesystem,
|
2023-05-27 18:45:28 +01:00
|
|
|
gamemode,
|
2023-06-02 11:41:18 +01:00
|
|
|
msaClientID ? null,
|
2023-08-04 16:55:31 +01:00
|
|
|
gamemodeSupport ? stdenv.isLinux,
|
2023-05-27 18:45:28 +01:00
|
|
|
self,
|
|
|
|
version,
|
|
|
|
libnbtplusplus,
|
|
|
|
}:
|
2023-08-04 16:55:31 +01:00
|
|
|
assert lib.assertMsg (stdenv.isLinux || !gamemodeSupport) "gamemodeSupport is only available on Linux";
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "prismlauncher-unwrapped";
|
|
|
|
inherit version;
|
2023-05-27 18:45:28 +01:00
|
|
|
|
2023-08-04 16:55:31 +01:00
|
|
|
src = lib.cleanSource self;
|
2023-05-27 18:45:28 +01:00
|
|
|
|
2023-08-23 10:52:31 +01:00
|
|
|
nativeBuildInputs = [extra-cmake-modules cmake jdk17 ninja canonicalize-jars-hook];
|
2023-08-04 16:55:31 +01:00
|
|
|
buildInputs =
|
|
|
|
[
|
|
|
|
qtbase
|
|
|
|
zlib
|
|
|
|
quazip
|
|
|
|
ghc_filesystem
|
|
|
|
tomlplusplus
|
|
|
|
cmark
|
|
|
|
]
|
|
|
|
++ lib.optional gamemodeSupport gamemode
|
|
|
|
++ lib.optionals stdenv.isDarwin [Cocoa];
|
2023-06-02 11:41:18 +01:00
|
|
|
|
2023-08-04 16:55:31 +01:00
|
|
|
hardeningEnable = lib.optionals stdenv.isLinux ["pie"];
|
2023-05-27 18:45:28 +01:00
|
|
|
|
2023-08-04 16:55:31 +01:00
|
|
|
cmakeFlags =
|
|
|
|
[
|
|
|
|
"-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=''"];
|
2023-05-27 18:45:28 +01:00
|
|
|
|
2023-08-04 16:55:31 +01:00
|
|
|
postUnpack = ''
|
|
|
|
rm -rf source/libraries/libnbtplusplus
|
|
|
|
ln -s ${libnbtplusplus} source/libraries/libnbtplusplus
|
|
|
|
'';
|
2023-05-27 18:45:28 +01:00
|
|
|
|
2023-08-04 16:55:31 +01:00
|
|
|
dontWrapQtApps = true;
|
2023-05-27 18:45:28 +01:00
|
|
|
|
2023-08-04 16:55:31 +01:00
|
|
|
meta = with lib; {
|
2023-09-19 18:45:52 +01:00
|
|
|
mainProgram = "prismlauncher";
|
2023-08-04 16:55:31 +01:00
|
|
|
homepage = "https://prismlauncher.org/";
|
|
|
|
description = "A free, open source launcher for Minecraft";
|
|
|
|
longDescription = ''
|
|
|
|
Allows you to have multiple, separate instances of Minecraft (each with
|
|
|
|
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];
|
|
|
|
};
|
|
|
|
}
|