From c1bdb38d45bdb00873d4869cae2c7827f5c015fe Mon Sep 17 00:00:00 2001 From: Victor Javier Date: Wed, 10 Oct 2018 10:20:56 -0500 Subject: [PATCH] arm64 support (#35) * Add arm64 build support thanks to @435vic --- .travis.yml | 4 ++++ build.sh | 6 +++++- check_tags.sh | 21 ++++++++++++++++++++- create_zip.sh | 3 +++ install_deps.sh | 7 ++++++- 5 files changed, 38 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5b0e132..89e489d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,9 @@ matrix: - os: linux sudo: required env: BUILDARCH=ia32 + - os: linux + sudo: required + env: BUILDARCH=arm64 - os: osx language: node_js @@ -35,6 +38,7 @@ deploy: - vscode/.build/linux/rpm/i386/*.rpm - vscode/.build/linux/deb/amd64/deb/*.deb - vscode/.build/linux/rpm/x86_64/*.rpm + - vscode/.build/linux/deb/arm64/deb/*.deb on: all_branches: true condition: $SHOULD_BUILD = yes diff --git a/build.sh b/build.sh index 067d79f..4e48d1e 100755 --- a/build.sh +++ b/build.sh @@ -30,6 +30,10 @@ if [[ "$SHOULD_BUILD" == "yes" ]]; then npm run gulp vscode-linux-ia32-build-deb npm run gulp vscode-linux-ia32-build-rpm unset npm_config_arch + elif [[ "$BUILDARCH" == "arm64" ]]; then + npm run gulp vscode-linux-arm64-min + npm run gulp vscode-linux-arm64-build-deb + # npm run gulp vscode-linux-arm64-build-rpm else npm run gulp vscode-linux-x64-min npm run gulp vscode-linux-x64-build-deb @@ -37,4 +41,4 @@ if [[ "$SHOULD_BUILD" == "yes" ]]; then fi cd .. -fi \ No newline at end of file +fi diff --git a/check_tags.sh b/check_tags.sh index 98f5f00..e7fe6e4 100755 --- a/check_tags.sh +++ b/check_tags.sh @@ -1,6 +1,6 @@ #!/bin/bash -GITHUB_RESPONSE=$(curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/vscodium/vscodium/releases/tags/$LATEST_MS_TAG) +GITHUB_RESPONSE=$(curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/VSCodium/vscodium/releases/tags/$LATEST_MS_TAG) echo "Github response: ${GITHUB_RESPONSE}" VSCODIUM_ASSETS=$(echo $GITHUB_RESPONSE | jq '.assets') echo "VSCodium assets: ${VSCODIUM_ASSETS}" @@ -33,6 +33,25 @@ if [ "$GITHUB_TOKEN" != "" ]; then if [[ "$SHOULD_BUILD" != "yes" ]]; then echo "Already have all the Linux ia32 builds" fi + elif [[ $BUILDARCH == "arm64" ]]; then + # HAVE_ARM64_RPM=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["arm64.rpm"])') + HAVE_ARM64_DEB=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["arm64.deb"])') + HAVE_ARM64_TAR=$(echo $VSCODIUM_ASSETS | jq --arg suffix "arm64-$LATEST_MS_TAG.tar.gz" 'map(.name) | contains([$suffix])') + # if [[ "$HAVE_ARM64_RPM" != "true" ]]; then + # echo "Building on Linux arm64 because we have no RPM" + # export SHOULD_BUILD="yes" + # fi + if [[ "$HAVE_ARM64_DEB" != "true" ]]; then + echo "Building on Linux arm64 because we have no DEB" + export SHOULD_BUILD="yes" + fi + if [[ "$HAVE_ARM64_TAR" != "true" ]]; then + echo "Building on Linux arm64 because we have no TAR" + export SHOULD_BUILD="yes" + fi + if [[ "$SHOULD_BUILD" != "yes" ]]; then + echo "Already have all the Linux arm64 builds" + fi else HAVE_64_RPM=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["x86_64.rpm"])') HAVE_64_DEB=$(echo $VSCODIUM_ASSETS | jq 'map(.name) | contains(["amd64.deb"])') diff --git a/create_zip.sh b/create_zip.sh index 1306204..5942670 100755 --- a/create_zip.sh +++ b/create_zip.sh @@ -7,6 +7,9 @@ if [[ "$SHOULD_BUILD" == "yes" ]]; then elif [[ "$BUILDARCH" == "ia32" ]]; then cd VSCode-linux-ia32 tar czf ../VSCode-linux-ia32-${LATEST_MS_TAG}.tar.gz . + elif [[ "$BUILDARCH" == "arm64" ]]; then + cd VSCode-linux-arm64 + tar czf ../VSCode-linux-arm64-${LATEST_MS_TAG}.tar.gz . else cd VSCode-linux-x64 tar czf ../VSCode-linux-x64-${LATEST_MS_TAG}.tar.gz . diff --git a/install_deps.sh b/install_deps.sh index 9a35011..4c51fed 100755 --- a/install_deps.sh +++ b/install_deps.sh @@ -12,5 +12,10 @@ else sudo apt-get update sudo apt-get install libc6-dev-i386 gcc-multilib g++-multilib sudo apt-get install libx11-dev:i386 libxkbfile-dev:i386 + elif [[ $BUILDARCH == "arm64" ]]; then + # Use the default C / C++ compilers, + # because some makefiles default to CC:=gcc: + export CC=/usr/bin/cc + export CXX=/usr/bin/c++ fi -fi \ No newline at end of file +fi