mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 10:27:46 +08:00
build(Makefile): set supported platforms by go-version
Set supported platforms correctly by go version (no darwin-386 for >=1.15, no darwin-arm64 unless >=1.16), make check-go-version work on mac License: MIT Signed-off-by: hannahhoward <hannah@hannahhoward.net>
This commit is contained in:
parent
1722eeefa6
commit
66e0f8a1d9
@ -34,27 +34,27 @@ check_at_least_version() {
|
||||
# We expect a version to be of form X.X.X
|
||||
# if the second dot doesn't match, we consider it a prerelease
|
||||
|
||||
if MIN_MIN=$(expr "$MIN_VERS" : "[^.]*\.\([0-9]\+\)"); then
|
||||
if MIN_MIN=$(expr "$MIN_VERS" : "[^.]*\.\([0-9][0-9]*\)"); then
|
||||
# this captured digit is necessary, since expr returns code 1 if the output is empty
|
||||
if expr "$MIN_VERS" : "[^.]*\.[0-9]*\([0-9]\.\|[0-9]\$\)" >/dev/null; then
|
||||
MIN_PRERELEASE="0"
|
||||
else
|
||||
MIN_PRERELEASE="1"
|
||||
fi
|
||||
MIN_FIX=$(expr "$MIN_VERS" : "[^.]*\.[0-9]\+[^0-9]\+\([0-9]\+\)") || MIN_FIX="0"
|
||||
MIN_FIX=$(expr "$MIN_VERS" : "[^.]*\.[0-9][0-9]*[^0-9][^0-9]*\([0-9][0-9]*\)") || MIN_FIX="0"
|
||||
else
|
||||
MIN_MIN="0"
|
||||
MIN_PRERELEASE="0"
|
||||
MIN_FIX="0"
|
||||
fi
|
||||
if CUR_MIN=$(expr "$CUR_VERS" : "[^.]*\.\([0-9]\+\)"); then
|
||||
if CUR_MIN=$(expr "$CUR_VERS" : "[^.]*\.\([0-9][0-9]*\)"); then
|
||||
# this captured digit is necessary, since expr returns code 1 if the output is empty
|
||||
if expr "$CUR_VERS" : "[^.]*\.[0-9]*\([0-9]\.\|[0-9]\$\)" >/dev/null; then
|
||||
CUR_PRERELEASE="0"
|
||||
else
|
||||
CUR_PRERELEASE="1"
|
||||
fi
|
||||
CUR_FIX=$(expr "$CUR_VERS" : "[^.]*\.[0-9]\+[^0-9]\+\([0-9]\+\)") || CUR_FIX="0"
|
||||
CUR_FIX=$(expr "$CUR_VERS" : "[^.]*\.[0-9][0-9]*[^0-9][^0-9]*\([0-9][0-9]*\)") || CUR_FIX="0"
|
||||
else
|
||||
CUR_MIN="0"
|
||||
CUR_PRERELEASE="0"
|
||||
|
||||
@ -17,9 +17,13 @@ SUPPORTED_PLATFORMS += linux-arm64
|
||||
SUPPORTED_PLATFORMS += linux-386
|
||||
SUPPORTED_PLATFORMS += linux-amd64
|
||||
|
||||
SUPPORTED_PLATFORMS += darwin-386
|
||||
SUPPORTED_PLATFORMS += darwin-amd64
|
||||
|
||||
ifeq ($(shell bin/check_go_version "1.15.0" 2>/dev/null; echo $$?),1)
|
||||
SUPPORTED_PLATFORMS += darwin-386
|
||||
endif
|
||||
ifeq ($(shell bin/check_go_version "1.16.0" 2>/dev/null; echo $$?),0)
|
||||
SUPPORTED_PLATFORMS += darwin-arm64
|
||||
endif
|
||||
SUPPORTED_PLATFORMS += freebsd-386
|
||||
SUPPORTED_PLATFORMS += freebsd-amd64
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user