nixpkgs/pkgs/games/prismlauncher/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

87 lines
2.4 KiB
Nix
Raw Normal View History

2022-10-18 16:55:33 +00:00
{ lib
, stdenv
, fetchFromGitHub
, canonicalize-jars-hook
2022-10-18 16:55:33 +00:00
, cmake
, cmark
2023-07-21 00:21:57 +00:00
, Cocoa
2023-04-01 18:55:58 +00:00
, ninja
, jdk17
2022-10-18 16:55:33 +00:00
, zlib
, qtbase
, quazip
, extra-cmake-modules
, tomlplusplus
, ghc_filesystem
, gamemode
, 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";
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";
stdenv.mkDerivation (finalAttrs: {
pname = "prismlauncher-unwrapped";
version = "8.2";
2022-10-18 16:55:33 +00:00
src = fetchFromGitHub {
owner = "PrismLauncher";
repo = "PrismLauncher";
rev = finalAttrs.version;
hash = "sha256-4VsoxZzi/EfEsnDvvwzg2xhj7j5B+k3gvaSqwJFDweE=";
2022-10-18 16:55:33 +00:00
};
nativeBuildInputs = [ extra-cmake-modules cmake jdk17 ninja canonicalize-jars-hook ];
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" ];
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
ln -s ${libnbtplusplus} source/libraries/libnbtplusplus
2022-10-18 16:55:33 +00:00
'';
dontWrapQtApps = true;
2022-10-18 16:55:33 +00:00
meta = {
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.
'';
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
};
})