From 4de8657894c029d53cb5d1ea0524ab22c03933a4 Mon Sep 17 00:00:00 2001 From: partisan Date: Thu, 8 May 2025 20:50:03 +0200 Subject: [PATCH] added option to build for windows on linux --- main.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/main.go b/main.go index b780f39..128f15f 100644 --- a/main.go +++ b/main.go @@ -8,6 +8,7 @@ import ( "path/filepath" "runtime" "spitfire-builder/spitfire" + "strings" "time" //"errors" ) @@ -215,6 +216,12 @@ func BuildProcess() (string, error) { if err := spitfire.ApplyPatches(sourcePath, patchesRepo, "pre-compile-patches", filepath.Join(sourcePath, "patcher"), skipPatchUpdate); err != nil { return "", fmt.Errorf("❌ pre-patch: %w", err) } + if strings.ToLower(platform) == "windows" { + fmt.Println("🪟 Applying Windows-specific patches...") + if err := spitfire.ApplyPatches(sourcePath, patchesRepo, "os-windows", filepath.Join(sourcePath, "patcher"), skipPatchUpdate); err != nil { + return "", fmt.Errorf("❌ windows-specific patches: %w", err) + } + } if err := spitfire.Configure(sourcePath); err != nil { return "", fmt.Errorf("❌ configure: %w", err) } @@ -240,6 +247,12 @@ func BuildProcess() (string, error) { if err := spitfire.ApplyPatches(sourcePath, patchesRepo, "pre-compile-patches", filepath.Join(sourcePath, "patcher"), skipPatchUpdate); err != nil { return "", fmt.Errorf("❌ pre-patch: %w", err) } + if strings.ToLower(platform) == "windows" { + fmt.Println("🪟 Applying Windows-specific patches...") + if err := spitfire.ApplyPatches(sourcePath, patchesRepo, "os-windows", filepath.Join(sourcePath, "patcher"), skipPatchUpdate); err != nil { + return "", fmt.Errorf("❌ windows-specific patches: %w", err) + } + } } if err := spitfire.Configure(sourcePath); err != nil { return "", fmt.Errorf("❌ configure: %w", err) @@ -285,6 +298,12 @@ func BuildProcess() (string, error) { if err := spitfire.ApplyPatches(sourcePath, patchesRepo, "pre-compile-patches", filepath.Join(sourcePath, "patcher"), skipPatchUpdate); err != nil { return "", fmt.Errorf("❌ pre-patch: %w", err) } + if strings.ToLower(platform) == "windows" { + fmt.Println("🪟 Applying Windows-specific patches...") + if err := spitfire.ApplyPatches(sourcePath, patchesRepo, "os-windows", filepath.Join(sourcePath, "patcher"), skipPatchUpdate); err != nil { + return "", fmt.Errorf("❌ windows-specific patches: %w", err) + } + } fmt.Println("✅ Pre-compile patches applied") } else if postPatch { fmt.Println("🔧 Applying post-compile patches...")