From d2f1e5d01f6ca25c126f8edd017744eb198a4df3 Mon Sep 17 00:00:00 2001 From: kkHAIKE Date: Tue, 22 Jul 2025 12:44:48 +0800 Subject: [PATCH 1/2] feat: wine: Remove the USE_SYSTEM_WINE restriction on macOS Catalina --- pkg/wine/wine.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/pkg/wine/wine.go b/pkg/wine/wine.go index 22fe012..092e059 100644 --- a/pkg/wine/wine.go +++ b/pkg/wine/wine.go @@ -89,18 +89,27 @@ func executeMacOsWine(useSystemWine bool, ctx context.Context, args []string, ia log.Warn("cannot detect macOS version", zap.Error(err)) } + var wineExecutable string if catalina { if len(ia64Name) == 0 { - return errors.New("macOS Catalina doesn't support 32-bit executables and as result Wine cannot run Windows 32-bit applications too") + if useSystemWine { + args = append([]string{ia32Name}, args...) + } else { + return errors.New("macOS Catalina doesn't support 32-bit executables and as result Wine cannot run Windows 32-bit applications too") + } + } else { + args = append([]string{ia64Name}, args...) } - args = append([]string{ia64Name}, args...) + wineExecutable = "wine64" } else { args = append([]string{ia32Name}, args...) + + wineExecutable = "wine" } if useSystemWine { - command := exec.CommandContext(ctx, "wine", args...) + command := exec.CommandContext(ctx, wineExecutable, args...) env := os.Environ() env = append(env, fmt.Sprintf("WINEDEBUG=%s", "-all,err+all"), @@ -116,7 +125,6 @@ func executeMacOsWine(useSystemWine bool, ctx context.Context, args []string, ia } var wineDir string - var wineExecutable string if catalina { dirName := "wine-4.0.1-mac" //noinspection SpellCheckingInspection @@ -125,8 +133,6 @@ func executeMacOsWine(useSystemWine bool, ctx context.Context, args []string, ia if err != nil { return err } - - wineExecutable = "wine64" } else { dirName := "wine-2.0.3-mac-10.13" //noinspection SpellCheckingInspection @@ -135,8 +141,6 @@ func executeMacOsWine(useSystemWine bool, ctx context.Context, args []string, ia if err != nil { return err } - - wineExecutable = "wine" } command := exec.CommandContext(ctx, filepath.Join(wineDir, "bin", wineExecutable), args...) env := os.Environ() From 632058ce52fcb0023aa2f6674a1d9dd87a85a231 Mon Sep 17 00:00:00 2001 From: kkHAIKE Date: Sun, 27 Jul 2025 10:47:00 +0800 Subject: [PATCH 2/2] add Changeset --- .changeset/grumpy-queens-obey.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/grumpy-queens-obey.md diff --git a/.changeset/grumpy-queens-obey.md b/.changeset/grumpy-queens-obey.md new file mode 100644 index 0000000..104145e --- /dev/null +++ b/.changeset/grumpy-queens-obey.md @@ -0,0 +1,5 @@ +--- +"app-builder-bin": patch +--- + +feat: wine: Remove the USE_SYSTEM_WINE restriction on macOS Catalina