diff options
| author | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-02-14 15:40:33 -0600 |
|---|---|---|
| committer | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-02-14 15:40:33 -0600 |
| commit | 6410929e17d642618f284d5c97d457f1ac653e6e (patch) | |
| tree | 5c0ee09e04f38a2dd70f1734d25c74e0b8ae5d43 /libs/nak/src | |
| parent | 817e8f5cd26739c69d930d21cd9dc4c0b6e4984e (diff) | |
Migrate data paths to ~/.local/share/fluorine/, add native build, fix %command% and system Proton scanning
- All data paths migrated from ~/.var/app/com.fluorine.manager/ to
~/.local/share/fluorine/ so native and Flatpak builds share the same
instances, plugins, and configs
- New fluorinepaths.h/.cpp with fluorineDataDir() helper and one-time
migration from old path (writes MOVED.txt breadcrumb)
- New libs/nak/src/paths.rs as Rust equivalent (data_dir())
- Strip %command% tokens from launch wrapper in protonlauncher.cpp
- Always scan /usr/share/steam/compatibilitytools.d/ for system Proton
packages (Arch installs Proton there); add Flatpak filesystem permission
- Native build (build-native.sh) installs to ~/.local/share/fluorine/
with desktop entry and ~/.local/bin symlink instead of portable zip
- build-flatpak.sh wrapper for Flatpak builds
- Fix container locale (LANG=C.UTF-8) for AutoUic warnings
- Fix prefixExists() to handle both compatdata and pfx directory layouts
- Fix globalInstancesRootPath() to use fluorineDataDir() on Linux
- Fix umu-run Flatpak lookup to use fluorineDataDir()
- Update README with build instructions and Arch dependency list
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'libs/nak/src')
| -rw-r--r-- | libs/nak/src/deps/tools.rs | 9 | ||||
| -rw-r--r-- | libs/nak/src/dxvk.rs | 6 | ||||
| -rw-r--r-- | libs/nak/src/lib.rs | 1 | ||||
| -rw-r--r-- | libs/nak/src/logging.rs | 5 | ||||
| -rw-r--r-- | libs/nak/src/paths.rs | 12 | ||||
| -rw-r--r-- | libs/nak/src/steam/proton.rs | 9 |
6 files changed, 23 insertions, 19 deletions
diff --git a/libs/nak/src/deps/tools.rs b/libs/nak/src/deps/tools.rs index c97247c..0e3e356 100644 --- a/libs/nak/src/deps/tools.rs +++ b/libs/nak/src/deps/tools.rs @@ -1,7 +1,7 @@ //! Linux tool management (winetricks, cabextract) //! //! Handles downloading and managing Linux CLI tools. -//! Tools are stored in ~/.var/app/com.fluorine.manager/bin/ for Fluorine Manager. +//! Tools are stored in ~/.local/share/fluorine/bin/ for Fluorine Manager. use std::error::Error; use std::fs; @@ -13,14 +13,13 @@ use std::process::Command; use crate::logging::{log_error, log_info, log_warning}; // ============================================================================ -// NaK Bin Directory (~/.var/app/com.fluorine.manager/bin/) +// NaK Bin Directory (~/.local/share/fluorine/bin/) // ============================================================================ -/// Get the tool bin directory path (~/.var/app/com.fluorine.manager/bin/) +/// Get the tool bin directory path (~/.local/share/fluorine/bin/) /// This is accessible from both native and Flatpak environments. pub fn get_nak_bin_path() -> PathBuf { - let home = std::env::var("HOME").unwrap_or_else(|_| "/tmp".to_string()); - PathBuf::from(home).join(".var/app/com.fluorine.manager/bin") + crate::paths::data_dir().join("bin") } /// Check if a command exists (either in system PATH or tool bin) diff --git a/libs/nak/src/dxvk.rs b/libs/nak/src/dxvk.rs index 97e4222..b335773 100644 --- a/libs/nak/src/dxvk.rs +++ b/libs/nak/src/dxvk.rs @@ -1,7 +1,7 @@ //! DXVK configuration management for Fluorine Manager. //! //! Downloads dxvk.conf from upstream, appends Fluorine-specific settings, -//! and stores at `~/.var/app/com.fluorine.manager/config/dxvk.conf`. +//! and stores at `~/.local/share/fluorine/config/dxvk.conf`. use std::error::Error; use std::fs; @@ -20,9 +20,7 @@ dxvk.enableGraphicsPipelineLibrary = False /// Get the path where the DXVK config will be stored. pub fn get_dxvk_conf_path() -> PathBuf { - let home = std::env::var("HOME").unwrap_or_else(|_| "/tmp".to_string()); - PathBuf::from(home) - .join(".var/app/com.fluorine.manager/config/dxvk.conf") + crate::paths::data_dir().join("config/dxvk.conf") } /// Ensure the dxvk.conf file exists, downloading if necessary. diff --git a/libs/nak/src/lib.rs b/libs/nak/src/lib.rs index c93f07b..59f41c6 100644 --- a/libs/nak/src/lib.rs +++ b/libs/nak/src/lib.rs @@ -7,6 +7,7 @@ pub mod config; pub mod dxvk; pub mod game_finder; pub mod logging; +pub mod paths; pub mod runtime_wrap; pub mod steam; pub mod utils; diff --git a/libs/nak/src/logging.rs b/libs/nak/src/logging.rs index 8c0f91a..e506bf8 100644 --- a/libs/nak/src/logging.rs +++ b/libs/nak/src/logging.rs @@ -1,7 +1,7 @@ //! Logging for Fluorine Manager. //! //! All log messages are: -//! 1. Written to `~/.var/app/com.fluorine.manager/logs/nak.log` (always) +//! 1. Written to `~/.local/share/fluorine/logs/nak.log` (always) //! 2. Forwarded to an optional callback set via `set_log_callback()` (for MOBase::log) use std::fs; @@ -25,8 +25,7 @@ pub fn set_log_callback(cb: impl Fn(&str, &str) + Send + Sync + 'static) { /// Get the log directory path. fn log_dir() -> PathBuf { - let home = std::env::var("HOME").unwrap_or_else(|_| "/tmp".to_string()); - PathBuf::from(home).join(".var/app/com.fluorine.manager/logs") + crate::paths::data_dir().join("logs") } /// Get the log file path. diff --git a/libs/nak/src/paths.rs b/libs/nak/src/paths.rs new file mode 100644 index 0000000..4b212b9 --- /dev/null +++ b/libs/nak/src/paths.rs @@ -0,0 +1,12 @@ +//! Shared data directory for Fluorine Manager. +//! +//! All data lives under `~/.local/share/fluorine/` — accessible from both +//! native and Flatpak builds (the Flatpak has `--filesystem=home`). + +use std::path::PathBuf; + +/// Returns the Fluorine data directory (`~/.local/share/fluorine`). +pub fn data_dir() -> PathBuf { + let home = std::env::var("HOME").unwrap_or_else(|_| "/tmp".to_string()); + PathBuf::from(home).join(".local/share/fluorine") +} diff --git a/libs/nak/src/steam/proton.rs b/libs/nak/src/steam/proton.rs index 064fd96..4059dc4 100644 --- a/libs/nak/src/steam/proton.rs +++ b/libs/nak/src/steam/proton.rs @@ -56,8 +56,6 @@ pub fn find_steam_protons() -> Vec<SteamProton> { return protons; }; - let is_flatpak = steam_path.to_string_lossy().contains(".var/app/com.valvesoftware.Steam"); - // 1. Steam's built-in Protons (steamapps/common/Proton*) protons.extend(find_builtin_protons(&steam_path)); @@ -65,11 +63,8 @@ pub fn find_steam_protons() -> Vec<SteamProton> { protons.extend(find_custom_protons(&steam_path)); // 3. System-level Protons in /usr/share/steam/compatibilitytools.d/ - if is_flatpak { - crate::logging::log_info("Flatpak Steam detected - skipping system protons in /usr/share/steam/compatibilitytools.d/"); - } else { - protons.extend(find_system_protons()); - } + // (Arch packages Proton here; Flatpak has --filesystem=/usr/share/steam:ro) + protons.extend(find_system_protons()); // Filter to only include Proton 10+ (required for Steam-native integration) protons.retain(is_proton_10_or_newer); |
