From a654dbc8f0671de1aa52b7f0aaa0eaf179b7df7b Mon Sep 17 00:00:00 2001 From: Dennis Ameling Date: Fri, 27 Nov 2020 09:54:44 +0100 Subject: [PATCH] First work for arm64 builds --- .github/workflows/ci.yml | 4 ++++ dependencies.json | 9 ++++++++- script/build-win32.sh | 38 +++++++++++++++++++++++--------------- script/package.sh | 16 +++++++++++++++- 4 files changed, 50 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b61d2351..569f2d98 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,6 +34,10 @@ jobs: - os: windows-2019 friendlyName: Windows targetPlatform: win32 + - os: windows-2019 + friendlyName: Windows + targetPlatform: win32 + arch: arm64 - os: ubuntu-18.04 friendlyName: Linux targetPlatform: ubuntu diff --git a/dependencies.json b/dependencies.json index f1d6b458..329c2c69 100644 --- a/dependencies.json +++ b/dependencies.json @@ -15,6 +15,13 @@ "filename": "MinGit-2.26.2-32-bit.zip", "url": "https://github.com/git-for-windows/git/releases/download/v2.26.2.windows.1/MinGit-2.26.2-32-bit.zip", "checksum": "d4953a8144eec84d210de48128cda4de4dd359e4112ab3086dda971b85aefb8e" + }, + { + "platform": "windows", + "arch": "arm64", + "filename": "MinGit-2.30.0-arm64.zip", + "url": "https://github.com/dennisameling/git/releases/download/2.30.0-beta2/MinGit-2.30.0-arm64.zip", + "checksum": "d105fadcc2d407952c777577aa4c263e3878816e52230e5824169cffa0d9bdc6" } ] }, @@ -29,7 +36,7 @@ }, { "platform": "windows", - "arch": "x86", + "arch": "386", "name": "git-lfs-windows-386-v2.13.2.zip", "checksum": "27d061f9fd6b14555c220758ae0b77d81ef20f64dde0179a515d55a75f5355a8" }, diff --git a/script/build-win32.sh b/script/build-win32.sh index ad2d3a3f..dc6ff08f 100755 --- a/script/build-win32.sh +++ b/script/build-win32.sh @@ -10,18 +10,31 @@ if [[ -z "${DESTINATION}" ]]; then exit 1 fi -if [ "$TARGET_ARCH" = "64" ]; then - DEPENDENCY_ARCH="amd64" - MINGW_DIR="mingw64" -else - DEPENDENCY_ARCH="x86" - MINGW_DIR="mingw32" -fi +case $TARGET_ARCH in + 64) + GIT_ARCH="amd64" + MINGW_DIR="mingw64" + GIT_LFS_ARCH="amd64" + ;; + 32) + GIT_ARCH="x86" + MINGW_DIR="mingw32" + GIT_LFS_ARCH="386" + ;; + arm64) + GIT_ARCH="arm64" + MINGW_DIR="arm64" + GIT_LFS_ARCH="386" + ;; + *) + die "Unsupported architecture: $TARGET_ARCH" + ;; +esac GIT_LFS_VERSION=$(jq --raw-output ".[\"git-lfs\"].version[1:]" dependencies.json) -GIT_LFS_CHECKSUM="$(jq --raw-output ".\"git-lfs\".files[] | select(.arch == \"$DEPENDENCY_ARCH\" and .platform == \"windows\") | .checksum" dependencies.json)" -GIT_FOR_WINDOWS_URL=$(jq --raw-output ".git.packages[] | select(.arch == \"$DEPENDENCY_ARCH\" and .platform == \"windows\") | .url" dependencies.json) -GIT_FOR_WINDOWS_CHECKSUM=$(jq --raw-output ".git.packages[] | select(.arch == \"$DEPENDENCY_ARCH\" and .platform == \"windows\") | .checksum" dependencies.json) +GIT_LFS_CHECKSUM="$(jq --raw-output ".\"git-lfs\".files[] | select(.arch == \"$GIT_LFS_ARCH\" and .platform == \"windows\") | .checksum" dependencies.json)" +GIT_FOR_WINDOWS_URL=$(jq --raw-output ".git.packages[] | select(.arch == \"$GIT_ARCH\" and .platform == \"windows\") | .url" dependencies.json) +GIT_FOR_WINDOWS_CHECKSUM=$(jq --raw-output ".git.packages[] | select(.arch == \"$GIT_ARCH\" and .platform == \"windows\") | .checksum" dependencies.json) CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # shellcheck source=script/compute-checksum.sh @@ -47,7 +60,6 @@ if [[ "$GIT_LFS_VERSION" ]]; then # download Git LFS, verify its the right contents, and unpack it echo "-- Bundling Git LFS" GIT_LFS_FILE=git-lfs.zip - if [ "$TARGET_ARCH" -eq "64" ]; then GIT_LFS_ARCH="amd64"; else GIT_LFS_ARCH="386"; fi GIT_LFS_URL="https://github.com/git-lfs/git-lfs/releases/download/v${GIT_LFS_VERSION}/git-lfs-windows-${GIT_LFS_ARCH}-v${GIT_LFS_VERSION}.zip" echo "-- Downloading from $GIT_LFS_URL" curl -sL -o $GIT_LFS_FILE "$GIT_LFS_URL" @@ -139,8 +151,4 @@ elif [[ -f "$DESTINATION/$MINGW_DIR/etc/gitattributes" ]]; then rm "$DESTINATION/$MINGW_DIR/etc/gitattributes" fi -echo "-- Removing legacy credential helpers" -rm "$DESTINATION/$MINGW_DIR/bin/git-credential-store.exe" -rm "$DESTINATION/$MINGW_DIR/bin/git-credential-wincred.exe" - set +eu diff --git a/script/package.sh b/script/package.sh index 236db9c9..f9803482 100755 --- a/script/package.sh +++ b/script/package.sh @@ -33,6 +33,21 @@ if ! [ -d "$DESTINATION" ]; then exit 1 fi +case $TARGET_ARCH in + 64) + ARCH=x64 + ;; + 32) + ARCH=x86 + ;; + arm64) + ARCH=arm64 + ;; + *) + die "Unsupported architecture: $TARGET_ARCH" + ;; +esac + if [ "$TARGET_PLATFORM" == "ubuntu" ]; then GZIP_FILE="dugite-native-$VERSION-$BUILD_HASH-ubuntu.tar.gz" LZMA_FILE="dugite-native-$VERSION-$BUILD_HASH-ubuntu.lzma" @@ -40,7 +55,6 @@ elif [ "$TARGET_PLATFORM" == "macOS" ]; then GZIP_FILE="dugite-native-$VERSION-$BUILD_HASH-macOS.tar.gz" LZMA_FILE="dugite-native-$VERSION-$BUILD_HASH-macOS.lzma" elif [ "$TARGET_PLATFORM" == "win32" ]; then - if [ "$TARGET_ARCH" -eq "64" ]; then ARCH="x64"; else ARCH="x86"; fi GZIP_FILE="dugite-native-$VERSION-$BUILD_HASH-windows-$ARCH.tar.gz" LZMA_FILE="dugite-native-$VERSION-$BUILD_HASH-windows-$ARCH.lzma" else