2022-10-21 18:38:19 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2023-08-04 22:07:22 +00:00
|
|
|
, fetchpatch
|
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";
|
|
|
|
rev = "2203af7eeb48c45398139b583615134efd8d407f";
|
|
|
|
sha256 = "sha256-TvVOjkUobYJD9itQYueELJX3wmecvEdCbJ0FinW2mL4=";
|
|
|
|
};
|
|
|
|
in
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
assert lib.assertMsg (stdenv.isLinux || !gamemodeSupport) "gamemodeSupport is only available on Linux";
|
|
|
|
|
|
|
|
stdenv.mkDerivation
|
|
|
|
rec {
|
2023-05-24 13:37:59 +00:00
|
|
|
pname = "prismlauncher-unwrapped";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "7.2";
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "PrismLauncher";
|
|
|
|
repo = "PrismLauncher";
|
|
|
|
rev = version;
|
2023-08-04 22:07:22 +00:00
|
|
|
sha256 = "sha256-RArg60S91YKp1Mt97a5JNfBEOf2cmuX4pK3VAx2WfqM=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
patches = [
|
|
|
|
./0001-launcher-translations-explicitly-convert-QVector-ite.patch
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2023-08-04 22:07:22 +00:00
|
|
|
# https://github.com/PrismLauncher/PrismLauncher/pull/1452
|
|
|
|
# These patches allow us to disable the Sparkle updater and cmake bundling
|
|
|
|
# TODO: remove these when updating to 8.0
|
|
|
|
(fetchpatch {
|
|
|
|
name = "disable-sparkle-when-url-is-empty.patch";
|
|
|
|
url = "https://github.com/PrismLauncher/PrismLauncher/commit/48e50401968a72846350c6fbd76cc957b64a6b5a.patch";
|
|
|
|
hash = "sha256-IFxp6Sj87ogQcMooV4Ql5/4B+C7oTzEk+4tlMud2OLo=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "make-install_bundle-cached.patch";
|
|
|
|
url = "https://github.com/PrismLauncher/PrismLauncher/commit/a8498b0dab94d0ab6c9e5cf395e5003db541b749.patch";
|
|
|
|
hash = "sha256-ji5GGUnzVut9xFXkynqf9aVR9FO/zsqIbt3P9dexJ2I=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "dont-include-sparkle-when-not-enabled.patch";
|
|
|
|
url = "https://github.com/PrismLauncher/PrismLauncher/commit/51bfda937d47837ed426150ed6f43a60b4ca0ce1.patch";
|
|
|
|
hash = "sha256-7hMgANOg4zRIf3F2AfLXGR3dAEBqVmKm/J5SH0G5oCk=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "introduce-internal-updater-variable.patch";
|
|
|
|
url = "https://github.com/PrismLauncher/PrismLauncher/commit/b1aa9e584624a0732dd55fc6c459524a8abfe6ba.patch";
|
|
|
|
hash = "sha256-mm++EfnBxz7NVtKLMb889mMq8F/OdQmzob8OmlvNlRA=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
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
|
|
|
|
|
|
|
meta = with lib; {
|
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.
|
|
|
|
'';
|
2023-08-04 22:07:22 +00:00
|
|
|
platforms = with platforms; linux ++ darwin;
|
2022-10-21 18:38:19 +00:00
|
|
|
changelog = "https://github.com/PrismLauncher/PrismLauncher/releases/tag/${version}";
|
|
|
|
license = licenses.gpl3Only;
|
2023-07-15 17:15:38 +00:00
|
|
|
maintainers = with maintainers; [ minion3665 Scrumplex getchoo ];
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
}
|