Skip to content

Commit

Permalink
First work for arm64 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisameling committed Mar 8, 2021
1 parent 55ce9e1 commit a654dbc
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 17 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
},
Expand All @@ -29,7 +36,7 @@
},
{
"platform": "windows",
"arch": "x86",
"arch": "386",
"name": "git-lfs-windows-386-v2.13.2.zip",
"checksum": "27d061f9fd6b14555c220758ae0b77d81ef20f64dde0179a515d55a75f5355a8"
},
Expand Down
38 changes: 23 additions & 15 deletions script/build-win32.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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
16 changes: 15 additions & 1 deletion script/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,28 @@ 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"
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
Expand Down

0 comments on commit a654dbc

Please sign in to comment.