Skip to content

Commit 8643fb3

Browse files
committed
replace msys2 with mingw
1 parent 9323f10 commit 8643fb3

File tree

4 files changed

+25
-30
lines changed

4 files changed

+25
-30
lines changed

cmd/internal/install/deps.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func Dependencies(projectPath string, goVersion, tinyPkgConfigVersion, pyVersion
1414
}
1515
// Only install MSYS2 on Windows
1616
if runtime.GOOS == "windows" {
17-
if err := installMsys2(projectPath, verbose); err != nil {
17+
if err := installMingw(projectPath, verbose); err != nil {
1818
return err
1919
}
2020
}

cmd/internal/install/env.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ const (
1313
PythonDir = "python"
1414
// GoDir is the directory name for Go installation
1515
GoDir = "go"
16-
// Msys2Dir is the directory name for MSYS2 installation
17-
Msys2Dir = "msys2"
18-
Msys2Root = Msys2Dir + "/msys64"
16+
// MingwDir is the directory name for Mingw installation
17+
MingwDir = "mingw"
18+
MingwRoot = MingwDir + "/mingw64"
1919

2020
TinyPkgConfigDir = "tiny-pkg-config"
2121
)
@@ -60,12 +60,12 @@ func GetGoCacheDir(projectPath string) string {
6060
return filepath.Join(GetGoRoot(projectPath), "go-build")
6161
}
6262

63-
func GetMsys2Dir(projectPath string) string {
64-
return filepath.Join(projectPath, DepsDir, Msys2Dir)
63+
func GetMingwDir(projectPath string) string {
64+
return filepath.Join(projectPath, DepsDir, MingwDir)
6565
}
6666

67-
func GetMsys2Root(projectPath string) string {
68-
return filepath.Join(projectPath, DepsDir, Msys2Root)
67+
func GetMingwRoot(projectPath string) string {
68+
return filepath.Join(projectPath, DepsDir, MingwRoot)
6969
}
7070

7171
func GetTinyPkgConfigDir(projectPath string) string {
@@ -80,7 +80,7 @@ func SetEnv(projectPath string) {
8080
path := os.Getenv("PATH")
8181
path = GetGoBinDir(absPath) + pathSeparator() + path
8282
if runtime.GOOS == "windows" {
83-
path = GetMsys2Root(absPath) + pathSeparator() + path
83+
path = GetMingwRoot(absPath) + pathSeparator() + path
8484
path = GetTinyPkgConfigDir(absPath) + pathSeparator() + path
8585
}
8686
os.Setenv("PATH", path)

cmd/internal/install/mingw.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package install
2+
3+
import (
4+
"fmt"
5+
)
6+
7+
const (
8+
mingwVersion = "14.2.0"
9+
mingwURL = "https://github.com/brechtsanders/winlibs_mingw/releases/download/14.2.0posix-19.1.1-12.0.0-ucrt-r2/winlibs-x86_64-posix-seh-gcc-14.2.0-llvm-19.1.1-mingw-w64ucrt-12.0.0-r2.zip"
10+
)
11+
12+
func installMingw(projectPath string, verbose bool) error {
13+
root := GetMingwDir(projectPath)
14+
fmt.Printf("Installing mingw in %v\n", root)
15+
return downloadAndExtract("mingw", mingwVersion, mingwURL, root, "", verbose)
16+
}

cmd/internal/install/msys2.go

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)