Răsfoiți Sursa

arm64 support (#35)

* Add arm64 build support thanks to @435vic
Victor Javier 6 ani în urmă
părinte
comite
c1bdb38d45
5 a modificat fișierele cu 38 adăugiri și 3 ștergeri
  1. 4 0
      .travis.yml
  2. 5 1
      build.sh
  3. 20 1
      check_tags.sh
  4. 3 0
      create_zip.sh
  5. 6 1
      install_deps.sh

+ 4 - 0
.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

+ 5 - 1
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
+fi

+ 20 - 1
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"])')

+ 3 - 0
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 .

+ 6 - 1
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
+fi