2022-10-18 17:55:33 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2024-03-17 12:35:12 +00:00
|
|
|
, stripJavaArchivesHook
|
2022-10-18 17:55:33 +01:00
|
|
|
, cmake
|
2023-06-11 21:00:20 +01:00
|
|
|
, cmark
|
2023-07-21 01:21:57 +01:00
|
|
|
, Cocoa
|
2023-04-01 19:55:58 +01:00
|
|
|
, ninja
|
2022-12-19 06:24:18 +00:00
|
|
|
, jdk17
|
2022-10-18 17:55:33 +01:00
|
|
|
, zlib
|
|
|
|
, qtbase
|
|
|
|
, quazip
|
|
|
|
, extra-cmake-modules
|
|
|
|
, tomlplusplus
|
|
|
|
, ghc_filesystem
|
2023-05-04 16:18:52 +01:00
|
|
|
, gamemode
|
2023-05-04 16:24:17 +01:00
|
|
|
, msaClientID ? null
|
2023-07-21 01:21:57 +01:00
|
|
|
, gamemodeSupport ? stdenv.isLinux
|
|
|
|
,
|
2022-10-18 17:55:33 +01:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
libnbtplusplus = fetchFromGitHub {
|
|
|
|
owner = "PrismLauncher";
|
|
|
|
repo = "libnbtplusplus";
|
2023-11-07 19:45:10 +00:00
|
|
|
rev = "a5e8fd52b8bf4ab5d5bcc042b2a247867589985f";
|
|
|
|
hash = "sha256-A5kTgICnx+Qdq3Fir/bKTfdTt/T1NQP2SC+nhN1ENug=";
|
2022-10-18 17:55:33 +01:00
|
|
|
};
|
|
|
|
in
|
2023-07-21 01:21:57 +01:00
|
|
|
|
|
|
|
assert lib.assertMsg (stdenv.isLinux || !gamemodeSupport) "gamemodeSupport is only available on Linux";
|
|
|
|
|
2023-11-07 19:45:10 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2023-05-04 16:18:52 +01:00
|
|
|
pname = "prismlauncher-unwrapped";
|
2024-04-23 19:21:14 +01:00
|
|
|
version = "8.3";
|
2022-10-18 17:55:33 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "PrismLauncher";
|
|
|
|
repo = "PrismLauncher";
|
2023-11-07 19:45:10 +00:00
|
|
|
rev = finalAttrs.version;
|
2024-04-23 19:21:14 +01:00
|
|
|
hash = "sha256-1YGzCgNdzscnOVeNlHMFJa0RbMo6C2qQjtBOeDxHakI=";
|
2022-10-18 17:55:33 +01:00
|
|
|
};
|
|
|
|
|
2024-03-17 12:35:12 +00:00
|
|
|
nativeBuildInputs = [ extra-cmake-modules cmake jdk17 ninja stripJavaArchivesHook ];
|
2023-07-21 01:21:57 +01:00
|
|
|
buildInputs =
|
|
|
|
[
|
|
|
|
qtbase
|
|
|
|
zlib
|
|
|
|
quazip
|
|
|
|
ghc_filesystem
|
|
|
|
tomlplusplus
|
|
|
|
cmark
|
|
|
|
]
|
|
|
|
++ lib.optional gamemodeSupport gamemode
|
|
|
|
++ lib.optionals stdenv.isDarwin [ Cocoa ];
|
2022-10-18 17:55:33 +01:00
|
|
|
|
2023-07-21 01:21:57 +01:00
|
|
|
hardeningEnable = lib.optionals stdenv.isLinux [ "pie" ];
|
2023-05-06 20:59:55 +01:00
|
|
|
|
2023-07-26 13:21:33 +01:00
|
|
|
cmakeFlags = [
|
|
|
|
# downstream branding
|
|
|
|
"-DLauncher_BUILD_PLATFORM=nixpkgs"
|
|
|
|
] ++ lib.optionals (msaClientID != null) [ "-DLauncher_MSA_CLIENT_ID=${msaClientID}" ]
|
2023-07-21 01:21:57 +01:00
|
|
|
++ lib.optionals (lib.versionOlder qtbase.version "6") [ "-DLauncher_QT_VERSION_MAJOR=5" ]
|
2024-04-20 23:25:19 +01:00
|
|
|
++ lib.optionals stdenv.isDarwin [
|
|
|
|
"-DINSTALL_BUNDLE=nodeps"
|
|
|
|
"-DMACOSX_SPARKLE_UPDATE_FEED_URL=''"
|
|
|
|
"-DCMAKE_INSTALL_PREFIX=${placeholder "out"}/Applications/"
|
|
|
|
];
|
2022-10-18 17:55:33 +01:00
|
|
|
|
|
|
|
postUnpack = ''
|
|
|
|
rm -rf source/libraries/libnbtplusplus
|
2023-05-04 16:23:31 +01:00
|
|
|
ln -s ${libnbtplusplus} source/libraries/libnbtplusplus
|
2022-10-18 17:55:33 +01:00
|
|
|
'';
|
|
|
|
|
2023-05-04 16:18:52 +01:00
|
|
|
dontWrapQtApps = true;
|
2022-10-18 17:55:33 +01:00
|
|
|
|
2023-12-31 17:31:19 +00:00
|
|
|
meta = {
|
2023-09-19 18:28:13 +01:00
|
|
|
mainProgram = "prismlauncher";
|
2022-10-18 17:55:33 +01:00
|
|
|
homepage = "https://prismlauncher.org/";
|
2024-06-07 08:46:46 +01:00
|
|
|
description = "Free, open source launcher for Minecraft";
|
2022-10-18 17:55:33 +01:00
|
|
|
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.
|
|
|
|
'';
|
2023-12-31 17:31:19 +00:00
|
|
|
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 ];
|
2022-10-18 17:55:33 +01:00
|
|
|
};
|
2023-11-07 19:45:10 +00:00
|
|
|
})
|