Merge pull request #1485 from getchoo/nix-darwin

This commit is contained in:
Sefa Eyeoglu 2023-08-20 21:20:09 +02:00 committed by GitHub
commit 5c95448f1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 51 additions and 44 deletions

View File

@ -25,8 +25,7 @@
systems = [
"x86_64-linux"
"aarch64-linux"
# Disabled due to our packages not supporting darwin yet.
# "x86_64-darwin"
# "aarch64-darwin"
"x86_64-darwin"
"aarch64-darwin"
];
}

View File

@ -17,6 +17,7 @@
mkPrism = qt:
qt.callPackage ./package.nix {
inherit (inputs) libnbtplusplus;
inherit (prev.darwin.apple_sdk.frameworks) Cocoa;
inherit self version;
};
in {

View File

@ -2,6 +2,8 @@
lib,
stdenv,
cmake,
cmark,
Cocoa,
ninja,
jdk17,
zlib,
@ -9,15 +11,15 @@
quazip,
extra-cmake-modules,
tomlplusplus,
cmark,
ghc_filesystem,
gamemode,
msaClientID ? null,
gamemodeSupport ? true,
gamemodeSupport ? stdenv.isLinux,
self,
version,
libnbtplusplus,
}:
assert lib.assertMsg (stdenv.isLinux || !gamemodeSupport) "gamemodeSupport is only available on Linux";
stdenv.mkDerivation rec {
pname = "prismlauncher-unwrapped";
inherit version;
@ -34,13 +36,18 @@ stdenv.mkDerivation rec {
tomlplusplus
cmark
]
++ lib.optional gamemodeSupport gamemode;
++ lib.optional gamemodeSupport gamemode
++ lib.optionals stdenv.isDarwin [Cocoa];
hardeningEnable = ["pie"];
hardeningEnable = lib.optionals stdenv.isLinux ["pie"];
cmakeFlags =
lib.optionals (msaClientID != null) ["-DLauncher_MSA_CLIENT_ID=${msaClientID}"]
++ lib.optionals (lib.versionOlder qtbase.version "6") ["-DLauncher_QT_VERSION_MAJOR=5"];
[
"-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=''"];
postUnpack = ''
rm -rf source/libraries/libnbtplusplus
@ -57,9 +64,9 @@ stdenv.mkDerivation rec {
their own mods, texture packs, saves, etc) and helps you manage them and
their associated options with a simple interface.
'';
platforms = platforms.linux;
platforms = with platforms; linux ++ darwin;
changelog = "https://github.com/PrismLauncher/PrismLauncher/releases/tag/${version}";
license = licenses.gpl3Only;
maintainers = with maintainers; [minion3665 Scrumplex];
maintainers = with maintainers; [minion3665 Scrumplex getchoo];
};
}