1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-02-07 13:31:37 +02:00
Carlos A Becker d7e1bcc1f0
fix: armv7 on linux is usually armv7l
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2021-10-05 23:15:21 -03:00

31 lines
728 B
Go

// Package linux contains functions that are useful to generate linux packages.
package linux
import "strings"
// Arch converts a goarch to a linux-compatible arch.
func Arch(key string) string {
// XXX: list of all linux arches: `go tool dist list | grep linux`
arch := strings.TrimPrefix(key, "linux")
for _, suffix := range []string{"hardfloat", "softfloat"} {
arch = strings.TrimSuffix(arch, suffix)
}
switch arch {
case "386":
return "i386"
case "amd64":
return "amd64"
case "arm5": // GOARCH + GOARM
return "armel"
case "arm6": // GOARCH + GOARM
return "armhf"
case "arm7": // GOARCH + GOARM
return "armv7l"
case "mips64le":
return "mips64el"
case "mipsle":
return "mipsel"
}
return arch
}