1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:17:35 +00:00

Ladybird: Remove $SERENITY_SOURCE_DIR from resource root candidates

Now we will only load resources from $build/share/Lagom. On macOS, we
load from the bundle directory Contents/Resources instead. This
simplifies the commands and environment variables needed to execute
Ladybird from the build directory, and makes our install setup less
awkward for distributions and packagers.
This commit is contained in:
Andrew Kaster 2024-02-23 13:40:16 -07:00 committed by Andrew Kaster
parent 21ac431fac
commit 68402bec12
8 changed files with 38 additions and 80 deletions

View file

@ -23,10 +23,6 @@ ErrorOr<ByteString> application_directory()
void platform_init()
{
s_serenity_resource_root = [] {
auto const* source_dir = getenv("SERENITY_SOURCE_DIR");
if (source_dir) {
return ByteString::formatted("{}/Base", source_dir);
}
auto* home = getenv("XDG_CONFIG_HOME") ?: getenv("HOME");
VERIFY(home);
auto home_lagom = ByteString::formatted("{}/.lagom", home);
@ -36,11 +32,11 @@ void platform_init()
#ifdef AK_OS_MACOS
return LexicalPath(app_dir).parent().append("Resources"sv).string();
#else
return LexicalPath(app_dir).parent().append("share"sv).string();
return LexicalPath(app_dir).parent().append("share/Lagom"sv).string();
#endif
}();
Core::ResourceImplementation::install(make<Core::ResourceImplementationFile>(MUST(String::formatted("{}/res", s_serenity_resource_root))));
Core::ResourceImplementation::install(make<Core::ResourceImplementationFile>(MUST(String::from_byte_string(s_serenity_resource_root))));
}
ErrorOr<Vector<ByteString>> get_paths_for_helper_process(StringView process_name)