Skip to content

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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

wrrrzr
Copy link
Contributor

@wrrrzr wrrrzr commented Apr 27, 2025

  • Goal of the PR
    Rename legacy dirs to luanti
  • How does the PR work?
    Renames legacy dirs to luanti
  • Does it resolve any reported issue?
    Minetest → Luanti rename checklist #15322
  • Does this relate to a goal in the roadmap?
    Idk
  • If not a bug fix, why is this PR needed? What usecases does it solve?
    It makes easer dump luanti data on xdg systems

To do

This PR is a Work in Progress.

  • Move linux and bsd systems to xdg spec dirs
  • Move windows and mac to luanti dir
  • Migrate legacy dirs to new in code
  • Move luanti.conf to .config on xdg systems
  • Move android to luanti dir
  • Migrate android dir
  • Add info about new dirs in README
  • Test on Linux
  • Test on Windows
  • Test on Mac
  • Test on Android

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

@appgurueu appgurueu marked this pull request as draft April 27, 2025 14:22
@Zughy Zughy added Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements @ Engine Core What happens inside the very engine labels Apr 28, 2025
@@ -544,14 +572,25 @@ bool setSystemPaths()
if (minetest_user_path && minetest_user_path[0] != '\0') {
path_user = std::string(minetest_user_path);
} else {
// TODO: luanti with migration
path_user = std::string(getHomeOrFail())
+ "/Library/Application Support/"
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@ Engine Core What happens inside the very engine Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants