2022-10-21 18:38:19 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2023-10-09 19:29:22 +00:00
|
|
|
, canonicalize-jars-hook
|
2022-10-21 18:38:19 +00:00
|
|
|
, cmake
|
2023-07-15 17:15:38 +00:00
|
|
|
, cmark
|
2023-08-04 22:07:22 +00:00
|
|
|
, Cocoa
|
2023-04-12 12:48:02 +00:00
|
|
|
, ninja
|
2022-12-28 21:21:41 +00:00
|
|
|
, jdk17
|
2022-10-21 18:38:19 +00:00
|
|
|
, zlib
|
|
|
|
, qtbase
|
|
|
|
, quazip
|
|
|
|
, extra-cmake-modules
|
|
|
|
, tomlplusplus
|
|
|
|
, ghc_filesystem
|
2023-04-12 12:48:02 +00:00
|
|
|
, gamemode
|
2023-05-24 13:37:59 +00:00
|
|
|
, msaClientID ? null
|
2023-08-04 22:07:22 +00:00
|
|
|
, gamemodeSupport ? stdenv.isLinux
|
|
|
|
,
|
2022-10-21 18:38:19 +00:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
libnbtplusplus = fetchFromGitHub {
|
|
|
|
owner = "PrismLauncher";
|
|
|
|
repo = "libnbtplusplus";
|
2023-11-16 04:20:00 +00:00
|
|
|
rev = "a5e8fd52b8bf4ab5d5bcc042b2a247867589985f";
|
|
|
|
hash = "sha256-A5kTgICnx+Qdq3Fir/bKTfdTt/T1NQP2SC+nhN1ENug=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
in
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
assert lib.assertMsg (stdenv.isLinux || !gamemodeSupport) "gamemodeSupport is only available on Linux";
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2023-05-24 13:37:59 +00:00
|
|
|
pname = "prismlauncher-unwrapped";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "8.0";
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "PrismLauncher";
|
|
|
|
repo = "PrismLauncher";
|
2023-11-16 04:20:00 +00:00
|
|
|
rev = finalAttrs.version;
|
|
|
|
hash = "sha256-WBajtfj3qAMq8zd2S53CQyHiyqtvffLOHOjmOpdALAA=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeBuildInputs = [ extra-cmake-modules cmake jdk17 ninja canonicalize-jars-hook ];
|
2023-08-04 22:07:22 +00:00
|
|
|
buildInputs =
|
|
|
|
[
|
|
|
|
qtbase
|
|
|
|
zlib
|
|
|
|
quazip
|
|
|
|
ghc_filesystem
|
|
|
|
tomlplusplus
|
|
|
|
cmark
|
|
|
|
]
|
|
|
|
++ lib.optional gamemodeSupport gamemode
|
|
|
|
++ lib.optionals stdenv.isDarwin [ Cocoa ];
|
2023-05-24 13:37:59 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
hardeningEnable = lib.optionals stdenv.isLinux [ "pie" ];
|
2022-10-21 18:38:19 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
# downstream branding
|
|
|
|
"-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=''" ];
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
postUnpack = ''
|
|
|
|
rm -rf source/libraries/libnbtplusplus
|
2023-05-24 13:37:59 +00:00
|
|
|
ln -s ${libnbtplusplus} source/libraries/libnbtplusplus
|
2022-10-21 18:38:19 +00:00
|
|
|
'';
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
dontWrapQtApps = true;
|
2022-10-21 18:38:19 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
meta = {
|
2023-10-09 19:29:22 +00:00
|
|
|
mainProgram = "prismlauncher";
|
2022-10-21 18:38:19 +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.
|
|
|
|
'';
|
2024-01-02 11:29:13 +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-21 18:38:19 +00:00
|
|
|
};
|
2023-11-16 04:20:00 +00:00
|
|
|
})
|