-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Brings in changes from the Prism Launcher derivation(s) in nixpkgs, notably from NixOS/nixpkgs#321851 and NixOS/nixpkgs#303880 Signed-off-by: Evan Goode <[email protected]>
- Loading branch information
1 parent
17da1f2
commit 875727f
Showing
4 changed files
with
169 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,105 @@ | ||
{ | ||
lib, | ||
stdenv, | ||
canonicalize-jars-hook, | ||
cmake, | ||
cmark, | ||
Cocoa, | ||
ninja, | ||
jdk17, | ||
zlib, | ||
qtbase, | ||
quazip, | ||
darwin, | ||
extra-cmake-modules, | ||
tomlplusplus, | ||
ghc_filesystem, | ||
gamemode, | ||
ghc_filesystem, | ||
jdk17, | ||
kdePackages, | ||
ninja, | ||
stripJavaArchivesHook, | ||
tomlplusplus, | ||
zlib, | ||
msaClientID ? null, | ||
gamemodeSupport ? stdenv.isLinux, | ||
self, | ||
version, | ||
libnbtplusplus, | ||
}: | ||
assert lib.assertMsg (stdenv.isLinux || !gamemodeSupport) "gamemodeSupport is only available on Linux"; | ||
stdenv.mkDerivation rec { | ||
assert lib.assertMsg ( | ||
gamemodeSupport -> stdenv.isLinux | ||
) "gamemodeSupport is only available on Linux."; | ||
stdenv.mkDerivation { | ||
pname = "fjordlauncher-unwrapped"; | ||
inherit version; | ||
|
||
src = lib.cleanSource self; | ||
src = lib.fileset.toSource { | ||
root = ../../.; | ||
fileset = lib.fileset.unions (map (fileName: ../../${fileName}) [ | ||
"buildconfig" | ||
"cmake" | ||
"launcher" | ||
"libraries" | ||
"program_info" | ||
"tests" | ||
"COPYING.md" | ||
"CMakeLists.txt" | ||
]); | ||
}; | ||
|
||
postUnpack = '' | ||
rm -rf source/libraries/libnbtplusplus | ||
ln -s ${libnbtplusplus} source/libraries/libnbtplusplus | ||
''; | ||
|
||
nativeBuildInputs = [ | ||
cmake | ||
ninja | ||
extra-cmake-modules | ||
jdk17 | ||
stripJavaArchivesHook | ||
]; | ||
|
||
nativeBuildInputs = [extra-cmake-modules cmake jdk17 ninja canonicalize-jars-hook]; | ||
buildInputs = | ||
[ | ||
qtbase | ||
zlib | ||
quazip | ||
cmark | ||
ghc_filesystem | ||
kdePackages.qtbase | ||
kdePackages.qtnetworkauth | ||
kdePackages.quazip | ||
tomlplusplus | ||
cmark | ||
zlib | ||
] | ||
++ lib.optional gamemodeSupport gamemode | ||
++ lib.optionals stdenv.isDarwin [Cocoa]; | ||
++ lib.optionals stdenv.isDarwin [darwin.apple_sdk.frameworks.Cocoa] | ||
++ lib.optional gamemodeSupport gamemode; | ||
|
||
hardeningEnable = lib.optionals stdenv.isLinux ["pie"]; | ||
|
||
cmakeFlags = | ||
[ | ||
"-DLauncher_BUILD_PLATFORM=nixpkgs" | ||
(lib.cmakeFeature "Launcher_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 | ||
ln -s ${libnbtplusplus} source/libraries/libnbtplusplus | ||
''; | ||
++ lib.optionals (msaClientID != null) [ | ||
(lib.cmakeFeature "Launcher_MSA_CLIENT_ID" (toString msaClientID)) | ||
] | ||
++ lib.optionals (lib.versionOlder kdePackages.qtbase.version "6") [ | ||
(lib.cmakeFeature "Launcher_QT_VERSION_MAJOR" "5") | ||
] | ||
++ lib.optionals stdenv.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/") | ||
]; | ||
|
||
dontWrapQtApps = true; | ||
|
||
meta = with lib; { | ||
mainProgram = "fjordlauncher"; | ||
homepage = "https://github.com/unmojang/FjordLauncher/"; | ||
description = "A free, open source launcher for Minecraft"; | ||
meta = { | ||
description = "Prism Launcher fork with support for alternative auth servers"; | ||
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 platforms; linux ++ darwin; | ||
changelog = "https://github.com/unmojang/FjordLauncher/releases/tag/${version}"; | ||
license = licenses.gpl3Only; | ||
maintainers = with maintainers; [evan-goode]; | ||
homepage = "https://fjordlauncher.org/"; | ||
license = lib.licenses.gpl3Only; | ||
maintainers = with lib.maintainers; [ | ||
evan-goode | ||
]; | ||
mainProgram = "fjordlauncher"; | ||
platforms = lib.platforms.linux ++ lib.platforms.darwin; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters