tools/cibuild.sh: Sync the installation between macOS and Ubuntu
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
b83f3e6ca7
commit
4b760fcea8
@ -43,13 +43,20 @@ function arm-clang-toolchain {
|
|||||||
add_path "${tools}"/clang-arm-none-eabi/bin
|
add_path "${tools}"/clang-arm-none-eabi/bin
|
||||||
|
|
||||||
if [ ! -f "${tools}/clang-arm-none-eabi/bin/clang" ]; then
|
if [ ! -f "${tools}/clang-arm-none-eabi/bin/clang" ]; then
|
||||||
|
local flavor
|
||||||
|
case ${os} in
|
||||||
|
Linux)
|
||||||
|
flavor=linux
|
||||||
|
;;
|
||||||
|
esac
|
||||||
cd "${tools}"
|
cd "${tools}"
|
||||||
curl -O -L -s https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/download/release-14.0.0/LLVMEmbeddedToolchainForArm-14.0.0-linux.tar.gz
|
curl -O -L -s https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/download/release-14.0.0/LLVMEmbeddedToolchainForArm-14.0.0-${flavor}.tar.gz
|
||||||
tar zxf LLVMEmbeddedToolchainForArm-14.0.0-linux.tar.gz
|
tar zxf LLVMEmbeddedToolchainForArm-14.0.0-${flavor}.tar.gz
|
||||||
mv LLVMEmbeddedToolchainForArm-14.0.0 clang-arm-none-eabi
|
mv LLVMEmbeddedToolchainForArm-14.0.0 clang-arm-none-eabi
|
||||||
cp /usr/bin/clang-extdef-mapping-10 clang-arm-none-eabi/bin/clang-extdef-mapping
|
cp /usr/bin/clang-extdef-mapping-10 clang-arm-none-eabi/bin/clang-extdef-mapping
|
||||||
rm LLVMEmbeddedToolchainForArm-14.0.0-linux.tar.gz
|
rm LLVMEmbeddedToolchainForArm-14.0.0-${flavor}.tar.gz
|
||||||
fi
|
fi
|
||||||
|
|
||||||
clang --version
|
clang --version
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,6 +81,7 @@ function arm-gcc-toolchain {
|
|||||||
patch -p0 < ${nuttx}/tools/ci/patch/arm-none-eabi-workaround-for-newlib-version-break.patch
|
patch -p0 < ${nuttx}/tools/ci/patch/arm-none-eabi-workaround-for-newlib-version-break.patch
|
||||||
rm arm-gnu-toolchain-11.3.rel1${flavor}-x86_64-arm-none-eabi.tar
|
rm arm-gnu-toolchain-11.3.rel1${flavor}-x86_64-arm-none-eabi.tar
|
||||||
fi
|
fi
|
||||||
|
|
||||||
arm-none-eabi-gcc --version
|
arm-none-eabi-gcc --version
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,6 +105,7 @@ function arm64-gcc-toolchain {
|
|||||||
mv gcc-arm-11.2-2022.02-${flavor}-aarch64-none-elf gcc-aarch64-none-elf
|
mv gcc-arm-11.2-2022.02-${flavor}-aarch64-none-elf gcc-aarch64-none-elf
|
||||||
rm gcc-arm-11.2-2022.02-${flavor}-aarch64-none-elf.tar
|
rm gcc-arm-11.2-2022.02-${flavor}-aarch64-none-elf.tar
|
||||||
fi
|
fi
|
||||||
|
|
||||||
aarch64-none-elf-gcc --version
|
aarch64-none-elf-gcc --version
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,8 +116,13 @@ function avr-gcc-toolchain {
|
|||||||
brew tap osx-cross/avr
|
brew tap osx-cross/avr
|
||||||
brew install avr-gcc
|
brew install avr-gcc
|
||||||
;;
|
;;
|
||||||
|
Linux)
|
||||||
|
apt-get install -y avr-libc gcc-avr
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
avr-gcc --version
|
||||||
}
|
}
|
||||||
|
|
||||||
function binutils {
|
function binutils {
|
||||||
@ -126,10 +140,13 @@ function binutils {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
objcopy --version
|
||||||
}
|
}
|
||||||
|
|
||||||
function bloaty {
|
function bloaty {
|
||||||
add_path "${tools}"/bloaty/bin
|
add_path "${tools}"/bloaty/bin
|
||||||
|
|
||||||
if [ ! -f "${tools}/bloaty/bin/bloaty" ]; then
|
if [ ! -f "${tools}/bloaty/bin/bloaty" ]; then
|
||||||
git clone --branch main https://github.com/google/bloaty bloaty-src
|
git clone --branch main https://github.com/google/bloaty bloaty-src
|
||||||
cd bloaty-src
|
cd bloaty-src
|
||||||
@ -142,6 +159,8 @@ function bloaty {
|
|||||||
cd "${tools}"
|
cd "${tools}"
|
||||||
rm -rf bloaty-src
|
rm -rf bloaty-src
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
command bloaty --version
|
||||||
}
|
}
|
||||||
|
|
||||||
function c-cache {
|
function c-cache {
|
||||||
@ -165,12 +184,16 @@ function c-cache {
|
|||||||
ccache --version
|
ccache --version
|
||||||
}
|
}
|
||||||
|
|
||||||
function clang_clang-tidy {
|
function clang-tidy {
|
||||||
# Install Clang and Clang-Tidy for Ubuntu.
|
if ! type clang-tidy &> /dev/null; then
|
||||||
apt-get update -qq && DEBIAN_FRONTEND="noninteractive" apt-get install -y -qq \
|
case ${os} in
|
||||||
-o APT::Immediate-Configure=0 \
|
Linux)
|
||||||
clang \
|
apt-get install -y clang clang-tidy
|
||||||
clang-tidy
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
command clang-tidy --version
|
||||||
}
|
}
|
||||||
|
|
||||||
function elf-toolchain {
|
function elf-toolchain {
|
||||||
@ -181,6 +204,7 @@ function elf-toolchain {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
x86_64-elf-gcc --version
|
x86_64-elf-gcc --version
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,6 +234,8 @@ function gperf {
|
|||||||
cd "${tools}"
|
cd "${tools}"
|
||||||
rm -rf gperf-3.1; rm gperf-3.1.tar.gz
|
rm -rf gperf-3.1; rm gperf-3.1.tar.gz
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
command gperf --version
|
||||||
}
|
}
|
||||||
|
|
||||||
function kconfig-frontends {
|
function kconfig-frontends {
|
||||||
@ -229,21 +255,27 @@ function kconfig-frontends {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function mips-gcc-toolchain {
|
function mips-gcc-toolchain {
|
||||||
add_path "${tools}"/pinguino-compilers/linux64/p32/bin
|
if [ ! -f "${tools}/pinguino-compilers" ]; then
|
||||||
|
|
||||||
if [ ! -f "${tools}/pinguino-compilers/linux64/p32/bin/p32-gcc" ]; then
|
|
||||||
cd "${tools}"
|
cd "${tools}"
|
||||||
git clone https://github.com/PinguinoIDE/pinguino-compilers
|
git clone https://github.com/PinguinoIDE/pinguino-compilers
|
||||||
fi
|
fi
|
||||||
p32-gcc --version
|
|
||||||
|
case ${os} in
|
||||||
|
Darwin)
|
||||||
|
add_path "${tools}"/pinguino-compilers/macosx/p32/bin
|
||||||
|
mips-elf-gcc --version
|
||||||
|
;;
|
||||||
|
Linux)
|
||||||
|
add_path "${tools}"/pinguino-compilers/linux64/p32/bin
|
||||||
|
p32-gcc --version
|
||||||
|
;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
function python-tools {
|
function python-tools {
|
||||||
# Python User Env
|
# Python User Env
|
||||||
PIP_USER=yes
|
export PIP_USER=yes
|
||||||
export PIP_USER
|
export PYTHONUSERBASE=${tools}/pylocal
|
||||||
PYTHONUSERBASE=${tools}/pylocal
|
|
||||||
export PYTHONUSERBASE
|
|
||||||
add_path "${PYTHONUSERBASE}"/bin
|
add_path "${PYTHONUSERBASE}"/bin
|
||||||
pip3 install \
|
pip3 install \
|
||||||
CodeChecker \
|
CodeChecker \
|
||||||
@ -282,6 +314,7 @@ function riscv-gcc-toolchain {
|
|||||||
mv riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-${flavor} riscv64-unknown-elf-gcc
|
mv riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-${flavor} riscv64-unknown-elf-gcc
|
||||||
rm riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-${flavor}.tar.gz
|
rm riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-${flavor}.tar.gz
|
||||||
fi
|
fi
|
||||||
|
|
||||||
riscv64-unknown-elf-gcc --version
|
riscv64-unknown-elf-gcc --version
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -301,6 +334,8 @@ function rust {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
rustc --version
|
||||||
}
|
}
|
||||||
|
|
||||||
function rx-gcc-toolchain {
|
function rx-gcc-toolchain {
|
||||||
@ -350,6 +385,7 @@ function rx-gcc-toolchain {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rx-elf-gcc --version
|
rx-elf-gcc --version
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -368,6 +404,7 @@ function sparc-gcc-toolchain {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sparc-gaisler-elf-gcc --version
|
sparc-gaisler-elf-gcc --version
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -390,6 +427,7 @@ function xtensa-esp32-gcc-toolchain {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
xtensa-esp32-elf-gcc --version
|
xtensa-esp32-elf-gcc --version
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -399,6 +437,9 @@ function u-boot-tools {
|
|||||||
Darwin)
|
Darwin)
|
||||||
brew install u-boot-tools
|
brew install u-boot-tools
|
||||||
;;
|
;;
|
||||||
|
Linux)
|
||||||
|
apt-get install -y u-boot-tools
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -472,7 +513,7 @@ function install_tools {
|
|||||||
|
|
||||||
case ${os} in
|
case ${os} in
|
||||||
Darwin)
|
Darwin)
|
||||||
install="arm-gcc-toolchain arm64-gcc-toolchain avr-gcc-toolchain binutils bloaty c-cache elf-toolchain gen-romfs kconfig-frontends python-tools riscv-gcc-toolchain rust xtensa-esp32-gcc-toolchain u-boot-tools"
|
install="arm-gcc-toolchain arm64-gcc-toolchain avr-gcc-toolchain binutils bloaty c-cache elf-toolchain gen-romfs gperf kconfig-frontends mips-gcc-toolchain python-tools riscv-gcc-toolchain rust xtensa-esp32-gcc-toolchain u-boot-tools"
|
||||||
mkdir -p "${tools}"/homebrew
|
mkdir -p "${tools}"/homebrew
|
||||||
export HOMEBREW_CACHE=${tools}/homebrew
|
export HOMEBREW_CACHE=${tools}/homebrew
|
||||||
# https://github.com/actions/virtual-environments/issues/2322#issuecomment-749211076
|
# https://github.com/actions/virtual-environments/issues/2322#issuecomment-749211076
|
||||||
@ -481,7 +522,7 @@ case ${os} in
|
|||||||
brew update --quiet
|
brew update --quiet
|
||||||
;;
|
;;
|
||||||
Linux)
|
Linux)
|
||||||
install="arm-clang-toolchain arm-gcc-toolchain arm64-gcc-toolchain bloaty c-cache clang_clang-tidy gen-romfs gperf kconfig-frontends mips-gcc-toolchain python-tools riscv-gcc-toolchain rust rx-gcc-toolchain sparc-gcc-toolchain xtensa-esp32-gcc-toolchain"
|
install="arm-clang-toolchain arm-gcc-toolchain arm64-gcc-toolchain avr-gcc-toolchain binutils bloaty c-cache clang-tidy gen-romfs gperf kconfig-frontends mips-gcc-toolchain python-tools riscv-gcc-toolchain rust rx-gcc-toolchain sparc-gcc-toolchain xtensa-esp32-gcc-toolchain u-boot-tools"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user