File vita3k-issue664_workaround.patch of Package vita3k

diff --git a/vita3k/main.cpp b/vita3k/main.cpp
index 27440b90..0f6f2424 100644
--- a/vita3k/main.cpp
+++ b/vita3k/main.cpp
@@ -84,8 +84,16 @@ static void run_execv(char *argv[], EmuEnvState &emuenv) {
 int main(int argc, char *argv[]) {
     ZoneScoped; // Tracy - Track main function scope
     Root root_paths;
+#ifdef WIN32
     root_paths.set_base_path(string_utils::utf_to_wide(SDL_GetBasePath()));
     root_paths.set_pref_path(string_utils::utf_to_wide(SDL_GetPrefPath(org_name, app_name)));
+#elif defined(__unix__) || defined(__APPLE__) && defined(__MACH__)
+    fs::path user_home = getenv("HOME");
+    fs::path local_path = user_home / "/.local/share/Vita3K/";
+    fs::path config_path = user_home / "/.config/Vita3k/";
+    root_paths.set_base_path(local_path);
+    root_paths.set_pref_path(config_path);
+#endif
 
     // Create default preference path for safety
     if (!fs::exists(root_paths.get_pref_path()))
diff --git a/vita3k/util/include/util/fs.h b/vita3k/util/include/util/fs.h
index 8076d61a..a038dbc1 100644
--- a/vita3k/util/include/util/fs.h
+++ b/vita3k/util/include/util/fs.h
@@ -52,6 +52,12 @@ public:
     }
 }; // class root
 
+#ifdef defined(__unix__) || defined(__APPLE__) && defined(__MACH__)
+extern fs::path user_home;
+extern fs::path config_path;
+extern fs::path local_path;
+#endif
+
 namespace fs_utils {
 
 /**
openSUSE Build Service is sponsored by