-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Move dirs to luanti and linux and bsd to xdg #16092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| } else { | ||
| // TODO: luanti with migration | ||
| path_user = std::string(getHomeOrFail()) | ||
| + "/Library/Application Support/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, in the case of moving this directory on macOS, the best approach is probably to start using the sandbox app data directory.
It should be more secure and potentially allow us to distribute Luanti via App Store in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, what i need to do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to use NSHomeDirectory() to get the sandbox path.
com.apple.security.app-sandbox has to be added to plist for macos app (misc/macos/Info.plist.in). Otherwise, NSHomeDirectory() would not work as expected.
|
This PR addresses #15382. |
siliconsniffer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a core dev, this just resolves the compilation errors.
Additionally, there are two whitespace/newline changes which seem unnecessary.
| std::optional<std::string> getPlatformSpecificConfigFile() { | ||
| std::string config_home = xdg_get_config_dir(); | ||
| fs::CreateAllDirs(config_home); | ||
| return config_home + DIR_DELIM CONFIGFILE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return config_home + DIR_DELIM CONFIGFILE; | |
| return config_home + DIR_DELIM + CONFIGFILE; |
| // glibc-only pretty much | ||
| #include <malloc.h> | ||
| #endif | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #include "constants.h" |
| #endif | ||
| #if defined(__APPLE__) | ||
| #include <mach-o/dyld.h> | ||
| #import <Foundation/Foundation.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an Objective-C/C++ framework. It cannot be used in C++ code directly. You have to do an Objective-C++ wrapper, I assume.
Something like porting_ios files in #15451
Rename legacy dirs to luanti
Renames legacy dirs to luanti
Minetest → Luanti rename checklist #15322
Idk
It makes easer dump luanti data on xdg systems
To do
This PR is a Work in Progress.
How to test
Build luanti without RUN_IN_PLACE and check .local/share/luanti on linux or bsd, or "C\Users<user>\AppData\Roaming\Luanti" on windows or /Users//Library/Application Support/luanti on mac and is exists check legacy dir