From 32f31aeb27486f1d63dced3aed45dc029edced0f Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Fri, 7 Mar 2025 10:36:14 +0000 Subject: [PATCH 1/6] Initial macOS Build support Signed-off-by: Isaac Marovitz --- .github/workflows/build-project.yml | 2 +- .github/workflows/build-release.yml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-project.yml b/.github/workflows/build-project.yml index 8abacc3..1879986 100644 --- a/.github/workflows/build-project.yml +++ b/.github/workflows/build-project.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-24.04 strategy: matrix: - rid: [linux-x64, win-x64] + rid: [linux-x64, win-x64, osx-arm64] steps: - name: Checkout Repository diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index f1492cc..19b8673 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -75,6 +75,9 @@ jobs: - name: win-x64 Build run: dotnet publish -p:PublishProfile=win-x64 -c Release -p:AssemblyVersion=${{ github.event.inputs.version }} -p:FileVersion=${{ github.event.inputs.version }} -o ./output/win-x64 ${{env.PROJECT_PATH}} + - name: osx-arm64 Build + run: dotnet publish -p:PublishProfile=osx-arm64 -c Release -p:AssemblyVersion=${{ github.event.inputs.version }} -p:FileVersion=${{ github.event.inputs.version }} -o ./output/osx-arm64 ${{env.PROJECT_PATH}} + - name: flatpak-x86_64 Build env: APP_VERSION: ${{ github.event.inputs.version }} @@ -87,6 +90,7 @@ jobs: run: | mkdir -p ./release mv ./output/win-x64/HedgeModManager.UI.exe ./release/HedgeModManager.exe + mv ./output/osx-arm64/HedgeModManager.UI ./release/HedgeModManager mv ./flatpak/${{env.FLATPAK_ID}}.flatpak ./release/${{env.FLATPAK_ID}}.flatpak - name: Create Release From d26bd682dd92b3b43ce0334e6cbdf3f39b4c4235 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Wed, 5 Mar 2025 02:04:38 +0000 Subject: [PATCH 2/6] Initial macOS Build support Signed-off-by: Isaac Marovitz --- .../Properties/PublishProfiles/osx-arm64.pubxml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Source/HedgeModManager.UI/Properties/PublishProfiles/osx-arm64.pubxml diff --git a/Source/HedgeModManager.UI/Properties/PublishProfiles/osx-arm64.pubxml b/Source/HedgeModManager.UI/Properties/PublishProfiles/osx-arm64.pubxml new file mode 100644 index 0000000..f079ae4 --- /dev/null +++ b/Source/HedgeModManager.UI/Properties/PublishProfiles/osx-arm64.pubxml @@ -0,0 +1,7 @@ + + + osx-arm64 + true + false + + From 3eb11f8ee0943df31c8f677f5746af70b49f9cd6 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Wed, 5 Mar 2025 02:01:58 +0000 Subject: [PATCH 3/6] Ignore .DS_Store Signed-off-by: Isaac Marovitz --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f740d3a..460b688 100644 --- a/.gitignore +++ b/.gitignore @@ -215,3 +215,4 @@ _Pvt_Extensions/ ModelManifest.xml Ignored/ +.DS_Store From 1d52578fe81d846e15e739739891e2c3849290e5 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Thu, 6 Mar 2025 14:15:48 +0000 Subject: [PATCH 4/6] Add Heroic Location Signed-off-by: Isaac Marovitz --- Source/Libraries/HedgeModManager.Epic/EpicLocator.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/Libraries/HedgeModManager.Epic/EpicLocator.cs b/Source/Libraries/HedgeModManager.Epic/EpicLocator.cs index 85fb224..32283f9 100644 --- a/Source/Libraries/HedgeModManager.Epic/EpicLocator.cs +++ b/Source/Libraries/HedgeModManager.Epic/EpicLocator.cs @@ -31,7 +31,12 @@ public void LocateEpicRoots() searchPaths.Add(Path.Combine(appdata, "heroic")); searchPaths.Add(Path.Combine("heroic")); } - + + if (OperatingSystem.IsMacOS()) + { + searchPaths.Add(Path.Combine(appdata, "heroic")); + } + if (OperatingSystem.IsLinux()) { // Heroic Games Launcher (Flatpak) From 32028d8d649689f02612a3ce367dc21469ea663f Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Thu, 6 Mar 2025 14:30:21 +0000 Subject: [PATCH 5/6] Add Steam path fixup Signed-off-by: Isaac Marovitz --- .../HedgeModManager.Steam/SteamLocator.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Source/Libraries/HedgeModManager.Steam/SteamLocator.cs b/Source/Libraries/HedgeModManager.Steam/SteamLocator.cs index 5f310e7..5fdd853 100644 --- a/Source/Libraries/HedgeModManager.Steam/SteamLocator.cs +++ b/Source/Libraries/HedgeModManager.Steam/SteamLocator.cs @@ -128,6 +128,22 @@ public List Locate() continue; } + // Paths will be encoded by Windows steam and will need to be adapted for macOS Paths. + // C:\ is equivalent to the Wine prefix. + // Any other drive letter should be removed and treated as raw Unix path. + if (OperatingSystem.IsMacOS()) + { + if (path.StartsWith(@"C:\")) + { + path = SteamInstallPath; + } + else + { + // Remove drive letter and replace slashes + path = path[2..].Replace(@"\", "/"); + } + } + var libPath = Path.Combine(path, "steamapps"); foreach (var app in apps) { From 2ea48008f67166424298975c65d05f119be899cd Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Fri, 7 Mar 2025 10:38:16 +0000 Subject: [PATCH 6/6] Steam infra Signed-off-by: Isaac Marovitz --- .../HedgeModManager.Steam/SteamLocator.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Source/Libraries/HedgeModManager.Steam/SteamLocator.cs b/Source/Libraries/HedgeModManager.Steam/SteamLocator.cs index 5fdd853..72e8772 100644 --- a/Source/Libraries/HedgeModManager.Steam/SteamLocator.cs +++ b/Source/Libraries/HedgeModManager.Steam/SteamLocator.cs @@ -32,6 +32,13 @@ public class SteamLocator : IGameLocator return null; } + [SupportedOSPlatform("macos")] + private string? FindSteamLibraryMacOS() + { + // TODO: Open a folder selection window + return ""; + } + private string? FindSteamLibraryUnix() { var pathList = new[] @@ -62,6 +69,12 @@ public class SteamLocator : IGameLocator return SteamInstallPath; } + if (OperatingSystem.IsMacOS()) + { + SteamInstallPath = FindSteamLibraryMacOS(); + return SteamInstallPath; + } + SteamInstallPath = FindSteamLibraryUnix(); return SteamInstallPath; } @@ -128,7 +141,7 @@ public List Locate() continue; } - // Paths will be encoded by Windows steam and will need to be adapted for macOS Paths. + // Paths will be encoded by Windows Steam and will need to be adapted for macOS paths. // C:\ is equivalent to the Wine prefix. // Any other drive letter should be removed and treated as raw Unix path. if (OperatingSystem.IsMacOS())