Files
prismlauncher-crack/nix/unwrapped.nix
Sefa Eyeoglu 48c91c13ad nix: Disable deprecated PIE flags
Fixes the following warning with nixos-unstable (and upcoming 25.11)

    evaluation warning: The 'pie' hardening flag has been removed in
    favor of enabling PIE by default in compilers and should no longer
    be used. PIE can be disabled with the -no-pie compiler flag, but
    this is usually not necessary as most build systems pass this if
    needed. Usage of the 'pie' hardening flag will become an error in
    future.

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2025-11-17 19:09:58 +01:00

124 lines
2.7 KiB
Nix

{
lib,
stdenv,
cmake,
cmark,
apple-sdk_11,
extra-cmake-modules,
gamemode,
jdk17,
kdePackages,
libnbtplusplus,
ninja,
qrencode,
self,
stripJavaArchivesHook,
tomlplusplus,
zlib,
msaClientID ? null,
gamemodeSupport ? stdenv.hostPlatform.isLinux,
}:
assert lib.assertMsg (
gamemodeSupport -> stdenv.hostPlatform.isLinux
) "gamemodeSupport is only available on Linux.";
let
date =
let
# YYYYMMDD
date' = lib.substring 0 8 self.lastModifiedDate;
year = lib.substring 0 4 date';
month = lib.substring 4 2 date';
date = lib.substring 6 2 date';
in
if (self ? "lastModifiedDate") then
lib.concatStringsSep "-" [
year
month
date
]
else
"unknown";
in
stdenv.mkDerivation {
pname = "prismlauncher-unwrapped";
version = "10.0-unstable-${date}";
src = lib.fileset.toSource {
root = ../.;
fileset = lib.fileset.unions [
../CMakeLists.txt
../COPYING.md
../buildconfig
../cmake
../launcher
../libraries
../program_info
../tests
];
};
postUnpack = ''
rm -rf source/libraries/libnbtplusplus
ln -s ${libnbtplusplus} source/libraries/libnbtplusplus
'';
nativeBuildInputs = [
cmake
ninja
extra-cmake-modules
jdk17
stripJavaArchivesHook
];
buildInputs = [
cmark
kdePackages.qtbase
kdePackages.qtnetworkauth
kdePackages.quazip
qrencode
tomlplusplus
zlib
]
++ lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk_11 ]
++ lib.optional gamemodeSupport gamemode;
cmakeFlags = [
# downstream branding
(lib.cmakeFeature "Launcher_BUILD_PLATFORM" "nixpkgs")
]
++ lib.optionals (msaClientID != null) [
(lib.cmakeFeature "Launcher_MSA_CLIENT_ID" (toString msaClientID))
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# we wrap our binary manually
(lib.cmakeFeature "INSTALL_BUNDLE" "nodeps")
# disable built-in updater
(lib.cmakeFeature "MACOSX_SPARKLE_UPDATE_FEED_URL" "''")
(lib.cmakeFeature "CMAKE_INSTALL_PREFIX" "${placeholder "out"}/Applications/")
];
doCheck = true;
dontWrapQtApps = true;
meta = {
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/";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [
Scrumplex
getchoo
];
mainProgram = "prismlauncher";
platforms = lib.platforms.linux ++ lib.platforms.darwin;
};
}