Skip to content

Commit

Permalink
Added support for Apple Silicon. Fixes #1997
Browse files Browse the repository at this point in the history
Signed-off-by: Waldemar Kindler <waldemar.kindler@gmail.com>
  • Loading branch information
waldemar-kindler committed May 20, 2021
1 parent 5ab48da commit fb72643
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
9 changes: 7 additions & 2 deletions build/make.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const (
GOOS = "GOOS"
X86 = "386"
X86_64 = "amd64"
ARM64 = "arm64"
darwin = "darwin"
linux = "linux"
freebsd = "freebsd"
Expand Down Expand Up @@ -92,7 +93,7 @@ func runTests(coverage bool) {
if *verbose {
runProcess("go", "test", "./...", "-v")
} else {
runProcess("go", "test", "./...")
runProcess("go", "test", "./...")
}
}
}
Expand Down Expand Up @@ -151,7 +152,7 @@ var certFile = flag.String("certFile", "", "Should be passed for signing the win
// Each target name is the directory name
var (
platformEnvs = []map[string]string{
map[string]string{GOARCH: X86, GOOS: darwin, CGO_ENABLED: "0"},
map[string]string{GOARCH: ARM64, GOOS: darwin, CGO_ENABLED: "0"},
map[string]string{GOARCH: X86_64, GOOS: darwin, CGO_ENABLED: "0"},
map[string]string{GOARCH: X86, GOOS: linux, CGO_ENABLED: "0"},
map[string]string{GOARCH: X86_64, GOOS: linux, CGO_ENABLED: "0"},
Expand Down Expand Up @@ -441,6 +442,10 @@ func getPackageArchSuffix() string {
return "x86_64"
}

if arch := getGOARCH(); arch == "arm" {
return "arm64"
}

if arch := getGOARCH(); arch == X86 {
return "x86"
}
Expand Down
3 changes: 2 additions & 1 deletion build/npm/src/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const fs = require('fs');
const BASE_URL="https://github.com/getgauge/gauge/releases/download/",
ARCH_MAPPING = {
"ia32": "x86",
"x64": "x86_64"
"x64": "x86_64",
"arm64": "arm64"
},
PLATFORM_MAPPING = {
"darwin": "darwin",
Expand Down
4 changes: 3 additions & 1 deletion build/pip/setup.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ class CustomInstallCommand(install):
"""Customized setuptools install command to download and setup."""

_base_url = 'https://api.github.com/repos/getgauge/gauge/releases'
_arch_map = {{"ia32": "x86", "x64": "x86_64"}}
_arch_map = {{"ia32": "x86", "x64": "x86_64", "arm64": "arm64"}}
_os_map = {{"Darwin": "darwin", "Linux": "linux", "Windows": "windows"}}
_os_name = _os_map[platform.system()]

def _get_arch(self):
if 'arm64' in platform.platform():
return self._arch_map['arm64']
if '64' in platform.architecture()[0]:
return self._arch_map['x64']
else:
Expand Down

0 comments on commit fb72643

Please sign in to comment.