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