nixpkgs/pkgs/by-name/pr/prismlauncher-unwrapped/package.nix

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

121 lines
3.0 KiB
Nix
Raw Normal View History

2024-06-22 23:27:20 +01:00
{
lib,
stdenv,
fetchFromGitHub,
cmake,
cmark,
darwin,
extra-cmake-modules,
gamemode,
ghc_filesystem,
jdk17,
2024-06-22 23:27:20 +01:00
kdePackages,
ninja,
2024-06-22 23:47:48 +01:00
nix-update-script,
stripJavaArchivesHook,
2024-06-22 23:27:20 +01:00
tomlplusplus,
zlib,
2024-06-22 23:27:20 +01:00
msaClientID ? null,
gamemodeSupport ? stdenv.hostPlatform.isLinux,
2022-10-18 17:55:33 +01:00
}:
2022-10-18 17:55:33 +01:00
let
libnbtplusplus = fetchFromGitHub {
owner = "PrismLauncher";
repo = "libnbtplusplus";
2024-10-20 23:24:11 +01:00
rev = "23b955121b8217c1c348a9ed2483167a6f3ff4ad";
hash = "sha256-yy0q+bky80LtK1GWzz7qpM+aAGrOqLuewbid8WT1ilk=";
2022-10-18 17:55:33 +01:00
};
in
2023-07-21 01:21:57 +01:00
2024-06-22 23:27:20 +01:00
assert lib.assertMsg (
gamemodeSupport -> stdenv.hostPlatform.isLinux
) "gamemodeSupport is only available on Linux.";
2023-07-21 01:21:57 +01:00
stdenv.mkDerivation (finalAttrs: {
pname = "prismlauncher-unwrapped";
version = "9.1";
2022-10-18 17:55:33 +01:00
src = fetchFromGitHub {
owner = "PrismLauncher";
repo = "PrismLauncher";
2024-10-20 23:24:11 +01:00
rev = "refs/tags/${finalAttrs.version}";
hash = "sha256-LVrWFBsI4+BOY5hlevfzqfRXQM6AFd5bMnXbBqTrxzA=";
2022-10-18 17:55:33 +01:00
};
postUnpack = ''
rm -rf source/libraries/libnbtplusplus
ln -s ${libnbtplusplus} source/libraries/libnbtplusplus
'';
2024-06-22 23:27:20 +01:00
nativeBuildInputs = [
cmake
ninja
extra-cmake-modules
jdk17
2024-06-22 23:27:20 +01:00
stripJavaArchivesHook
];
2023-07-21 01:21:57 +01:00
buildInputs =
[
cmark
ghc_filesystem
2024-06-22 23:26:55 +01:00
kdePackages.qtbase
2024-10-20 23:24:11 +01:00
kdePackages.qtnetworkauth
2024-06-22 23:26:55 +01:00
kdePackages.quazip
2023-07-21 01:21:57 +01:00
tomlplusplus
zlib
2023-07-21 01:21:57 +01:00
]
++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.Cocoa ]
++ lib.optional gamemodeSupport gamemode;
2022-10-18 17:55:33 +01:00
2023-07-21 01:21:57 +01:00
hardeningEnable = lib.optionals stdenv.hostPlatform.isLinux [ "pie" ];
2024-06-22 23:27:20 +01:00
cmakeFlags =
[
# downstream branding
2024-06-23 19:46:14 +01:00
(lib.cmakeFeature "Launcher_BUILD_PLATFORM" "nixpkgs")
]
++ lib.optionals (msaClientID != null) [
(lib.cmakeFeature "Launcher_MSA_CLIENT_ID" (toString msaClientID))
2024-06-22 23:27:20 +01:00
]
++ lib.optionals (lib.versionOlder kdePackages.qtbase.version "6") [
2024-06-23 19:46:14 +01:00
(lib.cmakeFeature "Launcher_QT_VERSION_MAJOR" "5")
2024-06-22 23:27:20 +01:00
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# we wrap our binary manually
2024-06-23 19:46:14 +01:00
(lib.cmakeFeature "INSTALL_BUNDLE" "nodeps")
# disable built-in updater
2024-06-23 19:46:14 +01:00
(lib.cmakeFeature "MACOSX_SPARKLE_UPDATE_FEED_URL" "''")
(lib.cmakeFeature "CMAKE_INSTALL_PREFIX" "${placeholder "out"}/Applications/")
2024-06-22 23:27:20 +01:00
];
2022-10-18 17:55:33 +01:00
2024-10-20 23:29:28 +01:00
doCheck = true;
dontWrapQtApps = true;
2022-10-18 17:55:33 +01:00
2024-06-22 23:47:48 +01:00
passthru = {
updateScript = nix-update-script { };
};
meta = {
2022-10-18 17:55:33 +01:00
description = "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.
'';
homepage = "https://prismlauncher.org/";
2024-10-20 23:24:11 +01:00
changelog = "https://github.com/PrismLauncher/PrismLauncher/releases/tag/${finalAttrs.version}";
license = lib.licenses.gpl3Only;
2024-06-22 23:27:20 +01:00
maintainers = with lib.maintainers; [
minion3665
Scrumplex
getchoo
];
mainProgram = "prismlauncher";
platforms = lib.platforms.linux ++ lib.platforms.darwin;
2022-10-18 17:55:33 +01:00
};
})