Merge pull request #22 from unmojang/evan-goode/nix-sync
nix: sync changes from nixpkgs
This commit is contained in:
commit
5be25307bb
@ -960,8 +960,7 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
|||||||
[[fallthrough]];
|
[[fallthrough]];
|
||||||
default: {
|
default: {
|
||||||
qDebug() << "Exiting because update lockfile is present";
|
qDebug() << "Exiting because update lockfile is present";
|
||||||
QMetaObject::invokeMethod(
|
QMetaObject::invokeMethod(this, []() { exit(1); }, Qt::QueuedConnection);
|
||||||
this, []() { exit(1); }, Qt::QueuedConnection);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -993,8 +992,7 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
|||||||
[[fallthrough]];
|
[[fallthrough]];
|
||||||
default: {
|
default: {
|
||||||
qDebug() << "Exiting because update lockfile is present";
|
qDebug() << "Exiting because update lockfile is present";
|
||||||
QMetaObject::invokeMethod(
|
QMetaObject::invokeMethod(this, []() { exit(1); }, Qt::QueuedConnection);
|
||||||
this, []() { exit(1); }, Qt::QueuedConnection);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1707,8 +1705,7 @@ QString Application::getJarPath(QString jarFile)
|
|||||||
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
|
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
|
||||||
FS::PathCombine(m_rootPath, "share", BuildConfig.LAUNCHER_NAME),
|
FS::PathCombine(m_rootPath, "share", BuildConfig.LAUNCHER_NAME),
|
||||||
#endif
|
#endif
|
||||||
FS::PathCombine(m_rootPath, "jars"),
|
FS::PathCombine(m_rootPath, "jars"), FS::PathCombine(applicationDirPath(), "jars"),
|
||||||
FS::PathCombine(applicationDirPath(), "jars"),
|
|
||||||
FS::PathCombine(applicationDirPath(), "..", "jars") // from inside build dir, for debuging
|
FS::PathCombine(applicationDirPath(), "..", "jars") // from inside build dir, for debuging
|
||||||
};
|
};
|
||||||
for (QString p : potentialPaths) {
|
for (QString p : potentialPaths) {
|
||||||
|
@ -79,11 +79,9 @@ QProcessEnvironment CleanEnviroment()
|
|||||||
|
|
||||||
QStringList stripped = {
|
QStringList stripped = {
|
||||||
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
|
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
|
||||||
"LD_LIBRARY_PATH",
|
"LD_LIBRARY_PATH", "LD_PRELOAD",
|
||||||
"LD_PRELOAD",
|
|
||||||
#endif
|
#endif
|
||||||
"QT_PLUGIN_PATH",
|
"QT_PLUGIN_PATH", "QT_FONTPATH"
|
||||||
"QT_FONTPATH"
|
|
||||||
};
|
};
|
||||||
for (auto key : rawenv.keys()) {
|
for (auto key : rawenv.keys()) {
|
||||||
auto value = rawenv.value(key);
|
auto value = rawenv.value(key);
|
||||||
|
@ -281,10 +281,8 @@ void ResourceFolderModel::resolveResource(Resource* res)
|
|||||||
|
|
||||||
connect(
|
connect(
|
||||||
task.get(), &Task::succeeded, this, [=] { onParseSucceeded(ticket, res->internal_id()); }, Qt::ConnectionType::QueuedConnection);
|
task.get(), &Task::succeeded, this, [=] { onParseSucceeded(ticket, res->internal_id()); }, Qt::ConnectionType::QueuedConnection);
|
||||||
connect(
|
connect(task.get(), &Task::failed, this, [=] { onParseFailed(ticket, res->internal_id()); }, Qt::ConnectionType::QueuedConnection);
|
||||||
task.get(), &Task::failed, this, [=] { onParseFailed(ticket, res->internal_id()); }, Qt::ConnectionType::QueuedConnection);
|
connect(task.get(), &Task::finished, this, [=] { m_active_parse_tasks.remove(ticket); }, Qt::ConnectionType::QueuedConnection);
|
||||||
connect(
|
|
||||||
task.get(), &Task::finished, this, [=] { m_active_parse_tasks.remove(ticket); }, Qt::ConnectionType::QueuedConnection);
|
|
||||||
|
|
||||||
m_helper_thread_task.addTask(task);
|
m_helper_thread_task.addTask(task);
|
||||||
|
|
||||||
|
@ -136,8 +136,9 @@ void Modrinth::loadIndexedPackVersions(ModPlatform::IndexedPack& pack, QJsonArra
|
|||||||
pack.versionsLoaded = true;
|
pack.versionsLoaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Modrinth::loadIndexedPackVersion(QJsonObject& obj, QString preferred_hash_type, QString preferred_file_name)
|
auto Modrinth::loadIndexedPackVersion(QJsonObject& obj,
|
||||||
-> ModPlatform::IndexedVersion
|
QString preferred_hash_type,
|
||||||
|
QString preferred_file_name) -> ModPlatform::IndexedVersion
|
||||||
{
|
{
|
||||||
ModPlatform::IndexedVersion file;
|
ModPlatform::IndexedVersion file;
|
||||||
|
|
||||||
@ -251,8 +252,9 @@ auto Modrinth::loadIndexedPackVersion(QJsonObject& obj, QString preferred_hash_t
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Modrinth::loadDependencyVersions([[maybe_unused]] const ModPlatform::Dependency& m, QJsonArray& arr, const BaseInstance* inst)
|
auto Modrinth::loadDependencyVersions([[maybe_unused]] const ModPlatform::Dependency& m,
|
||||||
-> ModPlatform::IndexedVersion
|
QJsonArray& arr,
|
||||||
|
const BaseInstance* inst) -> ModPlatform::IndexedVersion
|
||||||
{
|
{
|
||||||
auto profile = (dynamic_cast<const MinecraftInstance*>(inst))->getPackProfile();
|
auto profile = (dynamic_cast<const MinecraftInstance*>(inst))->getPackProfile();
|
||||||
QString mcVersion = profile->getComponentVersion("net.minecraft");
|
QString mcVersion = profile->getComponentVersion("net.minecraft");
|
||||||
|
@ -91,8 +91,9 @@ auto intEntry(toml::table table, QString entry_name) -> int
|
|||||||
return node.value_or(0);
|
return node.value_or(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto V1::createModFormat([[maybe_unused]] QDir& index_dir, ModPlatform::IndexedPack& mod_pack, ModPlatform::IndexedVersion& mod_version)
|
auto V1::createModFormat([[maybe_unused]] QDir& index_dir,
|
||||||
-> Mod
|
ModPlatform::IndexedPack& mod_pack,
|
||||||
|
ModPlatform::IndexedVersion& mod_version) -> Mod
|
||||||
{
|
{
|
||||||
Mod mod;
|
Mod mod;
|
||||||
|
|
||||||
|
@ -94,17 +94,15 @@ void ModUpdateDialog::checkCandidates()
|
|||||||
|
|
||||||
if (!m_modrinth_to_update.empty()) {
|
if (!m_modrinth_to_update.empty()) {
|
||||||
m_modrinth_check_task.reset(new ModrinthCheckUpdate(m_modrinth_to_update, versions, loaders, m_mod_model));
|
m_modrinth_check_task.reset(new ModrinthCheckUpdate(m_modrinth_to_update, versions, loaders, m_mod_model));
|
||||||
connect(m_modrinth_check_task.get(), &CheckUpdateTask::checkFailed, this, [this](Mod* mod, QString reason, QUrl recover_url) {
|
connect(m_modrinth_check_task.get(), &CheckUpdateTask::checkFailed, this,
|
||||||
m_failed_check_update.append({ mod, reason, recover_url });
|
[this](Mod* mod, QString reason, QUrl recover_url) { m_failed_check_update.append({ mod, reason, recover_url }); });
|
||||||
});
|
|
||||||
check_task.addTask(m_modrinth_check_task);
|
check_task.addTask(m_modrinth_check_task);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_flame_to_update.empty()) {
|
if (!m_flame_to_update.empty()) {
|
||||||
m_flame_check_task.reset(new FlameCheckUpdate(m_flame_to_update, versions, loaders, m_mod_model));
|
m_flame_check_task.reset(new FlameCheckUpdate(m_flame_to_update, versions, loaders, m_mod_model));
|
||||||
connect(m_flame_check_task.get(), &CheckUpdateTask::checkFailed, this, [this](Mod* mod, QString reason, QUrl recover_url) {
|
connect(m_flame_check_task.get(), &CheckUpdateTask::checkFailed, this,
|
||||||
m_failed_check_update.append({ mod, reason, recover_url });
|
[this](Mod* mod, QString reason, QUrl recover_url) { m_failed_check_update.append({ mod, reason, recover_url }); });
|
||||||
});
|
|
||||||
check_task.addTask(m_flame_check_task);
|
check_task.addTask(m_flame_check_task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,8 +93,9 @@ class ModrinthModPage : public ModPage {
|
|||||||
|
|
||||||
[[nodiscard]] inline auto helpPage() const -> QString override { return "Mod-platform"; }
|
[[nodiscard]] inline auto helpPage() const -> QString override { return "Mod-platform"; }
|
||||||
|
|
||||||
auto validateVersion(ModPlatform::IndexedVersion& ver, QString mineVer, std::optional<ModPlatform::ModLoaderTypes> loaders = {}) const
|
auto validateVersion(ModPlatform::IndexedVersion& ver,
|
||||||
-> bool override;
|
QString mineVer,
|
||||||
|
std::optional<ModPlatform::ModLoaderTypes> loaders = {}) const -> bool override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ModrinthResourcePackPage : public ResourcePackResourcePage {
|
class ModrinthResourcePackPage : public ResourcePackResourcePage {
|
||||||
|
@ -474,8 +474,7 @@ PrismUpdaterApp::PrismUpdaterApp(int& argc, char** argv) : QApplication(argc, ar
|
|||||||
target_dir = QDir(m_rootPath).absoluteFilePath("..");
|
target_dir = QDir(m_rootPath).absoluteFilePath("..");
|
||||||
}
|
}
|
||||||
|
|
||||||
QMetaObject::invokeMethod(
|
QMetaObject::invokeMethod(this, [this, target_dir]() { moveAndFinishUpdate(target_dir); }, Qt::QueuedConnection);
|
||||||
this, [this, target_dir]() { moveAndFinishUpdate(target_dir); }, Qt::QueuedConnection);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
QMetaObject::invokeMethod(this, &PrismUpdaterApp::loadReleaseList, Qt::QueuedConnection);
|
QMetaObject::invokeMethod(this, &PrismUpdaterApp::loadReleaseList, Qt::QueuedConnection);
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
tools.clang-tools = lib.mkForce pkgs.clang-tools_16;
|
tools.clang-tools = lib.mkForce pkgs.clang-tools_18;
|
||||||
};
|
};
|
||||||
|
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
|
@ -13,8 +13,6 @@
|
|||||||
in {
|
in {
|
||||||
inherit
|
inherit
|
||||||
(ourPackages)
|
(ourPackages)
|
||||||
fjordlauncher-qt5-unwrapped
|
|
||||||
fjordlauncher-qt5
|
|
||||||
fjordlauncher-unwrapped
|
fjordlauncher-unwrapped
|
||||||
fjordlauncher
|
fjordlauncher
|
||||||
;
|
;
|
||||||
@ -25,37 +23,11 @@
|
|||||||
flake = {
|
flake = {
|
||||||
overlays.default = final: prev: let
|
overlays.default = final: prev: let
|
||||||
version = builtins.substring 0 8 self.lastModifiedDate or "dirty";
|
version = builtins.substring 0 8 self.lastModifiedDate or "dirty";
|
||||||
|
in {
|
||||||
filteredSelf = inputs.nix-filter.lib.filter {
|
fjordlauncher-unwrapped = prev.callPackage ./pkg {
|
||||||
root = ../.;
|
|
||||||
include = [
|
|
||||||
"buildconfig"
|
|
||||||
"cmake"
|
|
||||||
"launcher"
|
|
||||||
"libraries"
|
|
||||||
"program_info"
|
|
||||||
"tests"
|
|
||||||
../COPYING.md
|
|
||||||
../CMakeLists.txt
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# common args for prismlauncher evaluations
|
|
||||||
unwrappedArgs = {
|
|
||||||
self = filteredSelf;
|
|
||||||
|
|
||||||
inherit (inputs) libnbtplusplus;
|
inherit (inputs) libnbtplusplus;
|
||||||
inherit ((final.darwin or prev.darwin).apple_sdk.frameworks) Cocoa;
|
|
||||||
inherit version;
|
inherit version;
|
||||||
};
|
};
|
||||||
in {
|
|
||||||
fjordlauncher-qt5-unwrapped = prev.libsForQt5.callPackage ./pkg unwrappedArgs;
|
|
||||||
|
|
||||||
fjordlauncher-qt5 = prev.libsForQt5.callPackage ./pkg/wrapper.nix {
|
|
||||||
fjordlauncher-unwrapped = final.fjordlauncher-qt5-unwrapped;
|
|
||||||
};
|
|
||||||
|
|
||||||
fjordlauncher-unwrapped = prev.qt6Packages.callPackage ./pkg unwrappedArgs;
|
|
||||||
|
|
||||||
fjordlauncher = prev.qt6Packages.callPackage ./pkg/wrapper.nix {
|
fjordlauncher = prev.qt6Packages.callPackage ./pkg/wrapper.nix {
|
||||||
inherit (final) fjordlauncher-unwrapped;
|
inherit (final) fjordlauncher-unwrapped;
|
||||||
|
@ -1,74 +1,105 @@
|
|||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
stdenv,
|
stdenv,
|
||||||
canonicalize-jars-hook,
|
|
||||||
cmake,
|
cmake,
|
||||||
cmark,
|
cmark,
|
||||||
Cocoa,
|
darwin,
|
||||||
ninja,
|
|
||||||
jdk17,
|
|
||||||
zlib,
|
|
||||||
qtbase,
|
|
||||||
quazip,
|
|
||||||
extra-cmake-modules,
|
extra-cmake-modules,
|
||||||
tomlplusplus,
|
|
||||||
ghc_filesystem,
|
|
||||||
gamemode,
|
gamemode,
|
||||||
|
ghc_filesystem,
|
||||||
|
jdk17,
|
||||||
|
kdePackages,
|
||||||
|
ninja,
|
||||||
|
stripJavaArchivesHook,
|
||||||
|
tomlplusplus,
|
||||||
|
zlib,
|
||||||
msaClientID ? null,
|
msaClientID ? null,
|
||||||
gamemodeSupport ? stdenv.isLinux,
|
gamemodeSupport ? stdenv.isLinux,
|
||||||
self,
|
|
||||||
version,
|
version,
|
||||||
libnbtplusplus,
|
libnbtplusplus,
|
||||||
}:
|
}:
|
||||||
assert lib.assertMsg (stdenv.isLinux || !gamemodeSupport) "gamemodeSupport is only available on Linux";
|
assert lib.assertMsg (
|
||||||
stdenv.mkDerivation rec {
|
gamemodeSupport -> stdenv.isLinux
|
||||||
|
) "gamemodeSupport is only available on Linux.";
|
||||||
|
stdenv.mkDerivation {
|
||||||
pname = "fjordlauncher-unwrapped";
|
pname = "fjordlauncher-unwrapped";
|
||||||
inherit version;
|
inherit version;
|
||||||
|
|
||||||
src = lib.cleanSource self;
|
src = lib.fileset.toSource {
|
||||||
|
root = ../../.;
|
||||||
nativeBuildInputs = [extra-cmake-modules cmake jdk17 ninja canonicalize-jars-hook];
|
fileset = lib.fileset.unions (map (fileName: ../../${fileName}) [
|
||||||
buildInputs =
|
"buildconfig"
|
||||||
[
|
"cmake"
|
||||||
qtbase
|
"launcher"
|
||||||
zlib
|
"libraries"
|
||||||
quazip
|
"program_info"
|
||||||
ghc_filesystem
|
"tests"
|
||||||
tomlplusplus
|
"COPYING.md"
|
||||||
cmark
|
"CMakeLists.txt"
|
||||||
]
|
]);
|
||||||
++ lib.optional gamemodeSupport gamemode
|
};
|
||||||
++ lib.optionals stdenv.isDarwin [Cocoa];
|
|
||||||
|
|
||||||
hardeningEnable = lib.optionals stdenv.isLinux ["pie"];
|
|
||||||
|
|
||||||
cmakeFlags =
|
|
||||||
[
|
|
||||||
"-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 = ''
|
postUnpack = ''
|
||||||
rm -rf source/libraries/libnbtplusplus
|
rm -rf source/libraries/libnbtplusplus
|
||||||
ln -s ${libnbtplusplus} source/libraries/libnbtplusplus
|
ln -s ${libnbtplusplus} source/libraries/libnbtplusplus
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
cmake
|
||||||
|
ninja
|
||||||
|
extra-cmake-modules
|
||||||
|
jdk17
|
||||||
|
stripJavaArchivesHook
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs =
|
||||||
|
[
|
||||||
|
cmark
|
||||||
|
ghc_filesystem
|
||||||
|
kdePackages.qtbase
|
||||||
|
kdePackages.qtnetworkauth
|
||||||
|
kdePackages.quazip
|
||||||
|
tomlplusplus
|
||||||
|
zlib
|
||||||
|
]
|
||||||
|
++ lib.optionals stdenv.isDarwin [darwin.apple_sdk.frameworks.Cocoa]
|
||||||
|
++ lib.optional gamemodeSupport gamemode;
|
||||||
|
|
||||||
|
hardeningEnable = lib.optionals stdenv.isLinux ["pie"];
|
||||||
|
|
||||||
|
cmakeFlags =
|
||||||
|
[
|
||||||
|
(lib.cmakeFeature "Launcher_BUILD_PLATFORM" "nixpkgs")
|
||||||
|
]
|
||||||
|
++ 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;
|
dontWrapQtApps = true;
|
||||||
|
|
||||||
meta = with lib; {
|
meta = {
|
||||||
mainProgram = "fjordlauncher";
|
description = "Prism Launcher fork with support for alternative auth servers";
|
||||||
homepage = "https://github.com/unmojang/FjordLauncher/";
|
|
||||||
description = "A free, open source launcher for Minecraft";
|
|
||||||
longDescription = ''
|
longDescription = ''
|
||||||
Allows you to have multiple, separate instances of Minecraft (each with
|
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 own mods, texture packs, saves, etc) and helps you manage them and
|
||||||
their associated options with a simple interface.
|
their associated options with a simple interface.
|
||||||
'';
|
'';
|
||||||
platforms = with platforms; linux ++ darwin;
|
homepage = "https://fjordlauncher.org/";
|
||||||
changelog = "https://github.com/unmojang/FjordLauncher/releases/tag/${version}";
|
license = lib.licenses.gpl3Only;
|
||||||
license = licenses.gpl3Only;
|
maintainers = with lib.maintainers; [
|
||||||
maintainers = with maintainers; [evan-goode];
|
evan-goode
|
||||||
|
];
|
||||||
|
mainProgram = "fjordlauncher";
|
||||||
|
platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -3,94 +3,143 @@
|
|||||||
stdenv,
|
stdenv,
|
||||||
symlinkJoin,
|
symlinkJoin,
|
||||||
fjordlauncher-unwrapped,
|
fjordlauncher-unwrapped,
|
||||||
wrapQtAppsHook,
|
|
||||||
addOpenGLRunpath,
|
addOpenGLRunpath,
|
||||||
qtbase, # needed for wrapQtAppsHook
|
flite,
|
||||||
qtsvg,
|
gamemode,
|
||||||
qtwayland,
|
|
||||||
xorg,
|
|
||||||
libpulseaudio,
|
|
||||||
libGL,
|
|
||||||
glfw,
|
glfw,
|
||||||
openal,
|
glfw-wayland-minecraft,
|
||||||
|
glxinfo,
|
||||||
jdk8,
|
jdk8,
|
||||||
jdk17,
|
jdk17,
|
||||||
jdk21,
|
jdk21,
|
||||||
gamemode,
|
kdePackages,
|
||||||
flite,
|
libGL,
|
||||||
mesa-demos,
|
libpulseaudio,
|
||||||
udev,
|
|
||||||
libusb1,
|
libusb1,
|
||||||
msaClientID ? null,
|
makeWrapper,
|
||||||
gamemodeSupport ? stdenv.isLinux,
|
openal,
|
||||||
textToSpeechSupport ? stdenv.isLinux,
|
pciutils,
|
||||||
controllerSupport ? stdenv.isLinux,
|
udev,
|
||||||
jdks ? [jdk21 jdk17 jdk8],
|
vulkan-loader,
|
||||||
|
xorg,
|
||||||
additionalLibs ? [],
|
additionalLibs ? [],
|
||||||
additionalPrograms ? [],
|
additionalPrograms ? [],
|
||||||
}: let
|
controllerSupport ? stdenv.isLinux,
|
||||||
fjordlauncherFinal = fjordlauncher-unwrapped.override {
|
gamemodeSupport ? stdenv.isLinux,
|
||||||
inherit msaClientID gamemodeSupport;
|
jdks ? [
|
||||||
};
|
jdk21
|
||||||
|
jdk17
|
||||||
|
jdk8
|
||||||
|
],
|
||||||
|
msaClientID ? null,
|
||||||
|
textToSpeechSupport ? stdenv.isLinux,
|
||||||
|
# Adds `glfw-wayland-minecraft` to `LD_LIBRARY_PATH`
|
||||||
|
# when launched on wayland, allowing for the game to be run natively.
|
||||||
|
# Make sure to enable "Use system installation of GLFW" in instance settings
|
||||||
|
# for this to take effect
|
||||||
|
#
|
||||||
|
# Warning: This build of glfw may be unstable, and the launcher
|
||||||
|
# itself can take slightly longer to start
|
||||||
|
withWaylandGLFW ? false,
|
||||||
|
}:
|
||||||
|
assert lib.assertMsg (
|
||||||
|
controllerSupport -> stdenv.isLinux
|
||||||
|
) "controllerSupport only has an effect on Linux.";
|
||||||
|
assert lib.assertMsg (
|
||||||
|
textToSpeechSupport -> stdenv.isLinux
|
||||||
|
) "textToSpeechSupport only has an effect on Linux.";
|
||||||
|
assert lib.assertMsg (
|
||||||
|
withWaylandGLFW -> stdenv.isLinux
|
||||||
|
) "withWaylandGLFW is only available on Linux."; let
|
||||||
|
fjordlauncher' = fjordlauncher-unwrapped.override {inherit msaClientID gamemodeSupport;};
|
||||||
in
|
in
|
||||||
symlinkJoin {
|
symlinkJoin {
|
||||||
name = "fjordlauncher-${fjordlauncherFinal.version}";
|
name = "fjordlauncher-${fjordlauncher'.version}";
|
||||||
|
|
||||||
paths = [fjordlauncherFinal];
|
paths = [fjordlauncher'];
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs =
|
||||||
wrapQtAppsHook
|
[kdePackages.wrapQtAppsHook]
|
||||||
];
|
# purposefully using a shell wrapper here for variable expansion
|
||||||
|
# see https://github.com/NixOS/nixpkgs/issues/172583
|
||||||
|
++ lib.optional withWaylandGLFW makeWrapper;
|
||||||
|
|
||||||
buildInputs =
|
buildInputs =
|
||||||
[
|
[
|
||||||
qtbase
|
kdePackages.qtbase
|
||||||
qtsvg
|
kdePackages.qtsvg
|
||||||
]
|
]
|
||||||
++ lib.optional (lib.versionAtLeast qtbase.version "6" && stdenv.isLinux) qtwayland;
|
++ lib.optional (
|
||||||
|
lib.versionAtLeast kdePackages.qtbase.version "6" && stdenv.isLinux
|
||||||
|
)
|
||||||
|
kdePackages.qtwayland;
|
||||||
|
|
||||||
postBuild = ''
|
env = {
|
||||||
|
waylandPreExec = lib.optionalString withWaylandGLFW ''
|
||||||
|
if [ -n "$WAYLAND_DISPLAY" ]; then
|
||||||
|
export LD_LIBRARY_PATH=${lib.getLib glfw-wayland-minecraft}/lib:"$LD_LIBRARY_PATH"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
postBuild =
|
||||||
|
lib.optionalString withWaylandGLFW ''
|
||||||
|
qtWrapperArgs+=(--run "$waylandPreExec")
|
||||||
|
''
|
||||||
|
+ ''
|
||||||
wrapQtAppsHook
|
wrapQtAppsHook
|
||||||
'';
|
'';
|
||||||
|
|
||||||
qtWrapperArgs = let
|
qtWrapperArgs = let
|
||||||
runtimeLibs =
|
runtimeLibs =
|
||||||
(with xorg; [
|
[
|
||||||
libX11
|
|
||||||
libXext
|
|
||||||
libXcursor
|
|
||||||
libXrandr
|
|
||||||
libXxf86vm
|
|
||||||
])
|
|
||||||
++ [
|
|
||||||
# lwjgl
|
# lwjgl
|
||||||
|
glfw
|
||||||
libpulseaudio
|
libpulseaudio
|
||||||
libGL
|
libGL
|
||||||
glfw
|
|
||||||
openal
|
openal
|
||||||
stdenv.cc.cc.lib
|
stdenv.cc.cc.lib
|
||||||
|
|
||||||
# oshi
|
vulkan-loader # VulkanMod's lwjgl
|
||||||
udev
|
|
||||||
|
udev # oshi
|
||||||
|
|
||||||
|
xorg.libX11
|
||||||
|
xorg.libXext
|
||||||
|
xorg.libXcursor
|
||||||
|
xorg.libXrandr
|
||||||
|
xorg.libXxf86vm
|
||||||
]
|
]
|
||||||
++ lib.optional gamemodeSupport gamemode.lib
|
|
||||||
++ lib.optional textToSpeechSupport flite
|
++ lib.optional textToSpeechSupport flite
|
||||||
|
++ lib.optional gamemodeSupport gamemode.lib
|
||||||
++ lib.optional controllerSupport libusb1
|
++ lib.optional controllerSupport libusb1
|
||||||
++ additionalLibs;
|
++ additionalLibs;
|
||||||
|
|
||||||
runtimePrograms =
|
runtimePrograms =
|
||||||
[
|
[
|
||||||
xorg.xrandr
|
glxinfo
|
||||||
mesa-demos # need glxinfo
|
pciutils # need lspci
|
||||||
|
xorg.xrandr # needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128
|
||||||
]
|
]
|
||||||
++ additionalPrograms;
|
++ additionalPrograms;
|
||||||
in
|
in
|
||||||
["--prefix FJORDLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks}"]
|
["--prefix fjordLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks}"]
|
||||||
++ lib.optionals stdenv.isLinux [
|
++ lib.optionals stdenv.isLinux [
|
||||||
"--set LD_LIBRARY_PATH ${addOpenGLRunpath.driverLink}/lib:${lib.makeLibraryPath runtimeLibs}"
|
"--set LD_LIBRARY_PATH ${addOpenGLRunpath.driverLink}/lib:${lib.makeLibraryPath runtimeLibs}"
|
||||||
# xorg.xrandr needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128
|
|
||||||
"--prefix PATH : ${lib.makeBinPath runtimePrograms}"
|
"--prefix PATH : ${lib.makeBinPath runtimePrograms}"
|
||||||
];
|
];
|
||||||
|
|
||||||
inherit (fjordlauncherFinal) meta;
|
meta = {
|
||||||
|
inherit
|
||||||
|
(fjordlauncher'.meta)
|
||||||
|
description
|
||||||
|
longDescription
|
||||||
|
homepage
|
||||||
|
changelog
|
||||||
|
license
|
||||||
|
maintainers
|
||||||
|
mainProgram
|
||||||
|
platforms
|
||||||
|
;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
@ -203,7 +203,10 @@ class ResourceFolderModelTest : public QObject {
|
|||||||
|
|
||||||
QCOMPARE(model.size(), 0);
|
QCOMPARE(model.size(), 0);
|
||||||
|
|
||||||
{ EXEC_UPDATE_TASK(model.installResource(folder_resource), QVERIFY) } {
|
{
|
||||||
|
EXEC_UPDATE_TASK(model.installResource(folder_resource), QVERIFY)
|
||||||
|
}
|
||||||
|
{
|
||||||
EXEC_UPDATE_TASK(model.installResource(file_mod), QVERIFY)
|
EXEC_UPDATE_TASK(model.installResource(file_mod), QVERIFY)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user