2022-10-18 16:55:33 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2024-03-17 12:35:12 +00:00
|
|
|
, stripJavaArchivesHook
|
2022-10-18 16:55:33 +00:00
|
|
|
, cmake
|
2023-06-11 20:00:20 +00:00
|
|
|
, cmark
|
2023-07-21 00:21:57 +00:00
|
|
|
, Cocoa
|
2023-04-01 18:55:58 +00:00
|
|
|
, ninja
|
2022-12-19 06:24:18 +00:00
|
|
|
, jdk17
|
2022-10-18 16:55:33 +00:00
|
|
|
, zlib
|
|
|
|
, qtbase
|
|
|
|
, quazip
|
|
|
|
, extra-cmake-modules
|
|
|
|
, tomlplusplus
|
|
|
|
, ghc_filesystem
|
2023-05-04 15:18:52 +00:00
|
|
|
, gamemode
|
2023-05-04 15:24:17 +00:00
|
|
|
, msaClientID ? null
|
2023-07-21 00:21:57 +00:00
|
|
|
, gamemodeSupport ? stdenv.isLinux
|
|
|
|
,
|
2022-10-18 16:55:33 +00: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 16:55:33 +00:00
|
|
|
};
|
|
|
|
in
|
2023-07-21 00:21:57 +00: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 15:18:52 +00:00
|
|
|
pname = "prismlauncher-unwrapped";
|
2024-03-03 19:30:07 +00:00
|
|
|
version = "8.2";
|
2022-10-18 16:55:33 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "PrismLauncher";
|
|
|
|
repo = "PrismLauncher";
|
2023-11-07 19:45:10 +00:00
|
|
|
rev = finalAttrs.version;
|
2024-03-03 19:30:07 +00:00
|
|
|
hash = "sha256-4VsoxZzi/EfEsnDvvwzg2xhj7j5B+k3gvaSqwJFDweE=";
|
2022-10-18 16:55:33 +00:00
|
|
|
};
|
|
|
|
|
2024-03-17 12:35:12 +00:00
|
|
|
nativeBuildInputs = [ extra-cmake-modules cmake jdk17 ninja stripJavaArchivesHook ];
|
2023-07-21 00:21:57 +00:00
|
|
|
buildInputs =
|
|
|
|
[
|
|
|
|
qtbase
|
|
|
|
zlib
|
|
|
|
quazip
|
|
|
|
ghc_filesystem
|
|
|
|
tomlplusplus
|
|
|
|
cmark
|
|
|
|
]
|
|
|
|
++ lib.optional gamemodeSupport gamemode
|
|
|
|
++ lib.optionals stdenv.isDarwin [ Cocoa ];
|
2022-10-18 16:55:33 +00:00
|
|
|
|
2023-07-21 00:21:57 +00:00
|
|
|
hardeningEnable = lib.optionals stdenv.isLinux [ "pie" ];
|
2023-05-06 19:59:55 +00:00
|
|
|
|
2023-07-26 12:21:33 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
# downstream branding
|
|
|
|
"-DLauncher_BUILD_PLATFORM=nixpkgs"
|
|
|
|
] ++ lib.optionals (msaClientID != null) [ "-DLauncher_MSA_CLIENT_ID=${msaClientID}" ]
|
2023-07-21 00:21:57 +00:00
|
|
|
++ lib.optionals (lib.versionOlder qtbase.version "6") [ "-DLauncher_QT_VERSION_MAJOR=5" ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ "-DINSTALL_BUNDLE=nodeps" "-DMACOSX_SPARKLE_UPDATE_FEED_URL=''" ];
|
2022-10-18 16:55:33 +00:00
|
|
|
|
|
|
|
postUnpack = ''
|
|
|
|
rm -rf source/libraries/libnbtplusplus
|
2023-05-04 15:23:31 +00:00
|
|
|
ln -s ${libnbtplusplus} source/libraries/libnbtplusplus
|
2022-10-18 16:55:33 +00:00
|
|
|
'';
|
|
|
|
|
2023-05-04 15:18:52 +00:00
|
|
|
dontWrapQtApps = true;
|
2022-10-18 16:55:33 +00:00
|
|
|
|
2023-12-31 17:31:19 +00:00
|
|
|
meta = {
|
2023-09-19 17:28:13 +00:00
|
|
|
mainProgram = "prismlauncher";
|
2022-10-18 16:55:33 +00: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.
|
|
|
|
'';
|
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 16:55:33 +00:00
|
|
|
};
|
2023-11-07 19:45:10 +00:00
|
|
|
})
|