Skip to content

Commit

Permalink
Merge pull request #437 from dennisameling/portable-clangarm64
Browse files Browse the repository at this point in the history
portable + installer: add CLANGARM64 support
  • Loading branch information
dscho authored Dec 17, 2022
2 parents 15c72a8 + 2fa6f5c commit f2bb9e5
Show file tree
Hide file tree
Showing 10 changed files with 179 additions and 161 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ jobs:
build-installers &&
cygpath -aw "$PWD/sdk-artifact/usr/bin/core_perl" >>$GITHUB_PATH &&
cygpath -aw "$PWD/sdk-artifact/usr/bin" >>$GITHUB_PATH &&
cygpath -aw "$PWD/sdk-artifact/mingw64/bin" >>$GITHUB_PATH
cygpath -aw "$PWD/sdk-artifact/mingw64/bin" >>$GITHUB_PATH &&
echo "MSYSTEM=MINGW64" >>$GITHUB_ENV
- name: build ${{ matrix.directory }}/
shell: bash
run: |
Expand Down Expand Up @@ -166,7 +167,8 @@ jobs:
esac &&
cygpath -aw "$PWD/sdk-artifact/usr/bin/core_perl" >>$GITHUB_PATH &&
cygpath -aw "$PWD/sdk-artifact/usr/bin" >>$GITHUB_PATH &&
cygpath -aw "$PWD/sdk-artifact/mingw${{ matrix.bitness }}/bin" >>$GITHUB_PATH
cygpath -aw "$PWD/sdk-artifact/mingw${{ matrix.bitness }}/bin" >>$GITHUB_PATH &&
echo "MSYSTEM=MINGW${{ matrix.bitness }}" >>$GITHUB_ENV
- name: build installer
if: matrix.artifact == 'build-installers'
shell: bash
Expand Down Expand Up @@ -202,7 +204,8 @@ jobs:
build-installers &&
cygpath -aw "$PWD/sdk-artifact/usr/bin/core_perl" >>$GITHUB_PATH &&
cygpath -aw "$PWD/sdk-artifact/usr/bin" >>$GITHUB_PATH &&
cygpath -aw "$PWD/sdk-artifact/mingw${{ matrix.bitness }}/bin" >>$GITHUB_PATH
cygpath -aw "$PWD/sdk-artifact/mingw${{ matrix.bitness }}/bin" >>$GITHUB_PATH &&
echo "MSYSTEM=MINGW${{ matrix.bitness }}" >>$GITHUB_ENV
- name: check for missing DLLs
shell: bash
run: ./check-for-missing-dlls.sh
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ edit-git-bash.exe
/portable/root/bin/
/portable/root/cmd/
/portable/root/etc/
/portable/root/clangarm64/
/portable/root/mingw32/
/portable/root/mingw64/
/portable/root/post-install.bat
Expand Down
2 changes: 1 addition & 1 deletion git-extra/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pkgname=('git-extra')
_ver_base=1.1
pkgver=1.1.612.56636bbd4
pkgver=1.1.614.d551cf0cc
pkgrel=1
pkgdesc="Git for Windows extra files"
arch=('i686' 'x86_64')
Expand Down
2 changes: 1 addition & 1 deletion git-extra/git-extra.install
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ GITATTRIBUTES
-e 's/^\*\.DOT\(.*\)/&\n*.dotm\1\n*.DOTM\1/' \
"$ETC_GITATTRIBUTES"

for dir in mingw32 mingw64
for dir in mingw32 mingw64 clangarm64
do
# Drop git-wrapper in place of builtins "to save space"
git_wrapper=/$dir/share/git/git-wrapper.exe
Expand Down
2 changes: 1 addition & 1 deletion git-extra/git-extra.install.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ GITATTRIBUTES
-e 's/^\*\.DOT\(.*\)/&\n*.dotm\1\n*.DOTM\1/' \
"$ETC_GITATTRIBUTES"

for dir in mingw32 mingw64
for dir in mingw32 mingw64 clangarm64
do
# Drop git-wrapper in place of builtins "to save space"
git_wrapper=/$dir/share/git/git-wrapper.exe
Expand Down
5 changes: 2 additions & 3 deletions installer/install.iss
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@

#include "config.iss"

#if !defined(APP_VERSION) || !defined(BITNESS)
#error "config.iss should define APP_VERSION and BITNESS"
#if !defined(APP_VERSION) || !defined(BITNESS) || !defined(MINGW_BITNESS)
#error "config.iss should define APP_VERSION, BITNESS and MINGW_BITNESS"
#endif

#define APP_NAME 'Git'
#ifdef COMPILE_FROM_IDE
#undef APP_VERSION
#define APP_VERSION 'Snapshot'
#endif
#define MINGW_BITNESS 'mingw'+BITNESS
#define APP_CONTACT_URL 'https://github.com/git-for-windows/git/wiki/Contact'
#define APP_URL 'https://gitforwindows.org/'
#define APP_BUILTINS 'share\git\builtins.txt'
Expand Down
47 changes: 18 additions & 29 deletions installer/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@ do
--include-pdbs)
include_pdbs=t
;;
--include-arm64-artifacts=*)
case "${1#*=}" in
/*) ;; # absolute path, okay
*) die "Need an absolute path: $1";;
esac
arm64_artifacts_directory="${1#*=}"
;;
*)
break
esac
Expand All @@ -111,19 +104,25 @@ case "$displayver" in
esac

# Evaluate architecture
ARCH="$(uname -m)"

case "$ARCH" in
i686)
case "$MSYSTEM" in
MINGW32)
BITNESS=32
ARCH=i686
;;
MINGW64)
BITNESS=64
ARCH=x86_64
;;
x86_64)
CLANGARM64)
BITNESS=64
ARCH=aarch64
inno_defines="$inno_defines$LF#define INSTALLER_FILENAME_SUFFIX 'arm64'"
;;
*)
die "Unhandled architecture: $ARCH"
die "Unhandled MSYSTEM: $MSYSTEM"
;;
esac
MSYSTEM_LOWER=${MSYSTEM,,}

echo "Generating release notes to be included in the installer ..."
../render-release-notes.sh --css usr/share/git/ ||
Expand Down Expand Up @@ -152,7 +151,7 @@ then
LIST=
else
echo "Generating file list to be included in the installer ..."
LIST="$(ARCH=$ARCH BITNESS=$BITNESS \
LIST="$(ARCH=$ARCH \
ETC_GITCONFIG="$etc_gitconfig" \
PACKAGE_VERSIONS_FILE=package-versions.txt \
INCLUDE_GIT_UPDATE=1 \
Expand All @@ -168,12 +167,12 @@ test -z "$cmd_git" || {
die "Could not execute 'git version'"

printf '; List of files\n%s\n%s\n%s\n%s\n%s\n%s\n' \
"Source: \"mingw$BITNESS\\bin\\blocked-file-util.exe\"; Flags: dontcopy" \
"Source: \"$MSYSTEM_LOWER\\bin\\blocked-file-util.exe\"; Flags: dontcopy" \
"Source: \"{#SourcePath}\\package-versions.txt\"; DestDir: {app}\\etc; Flags: replacesameversion restartreplace; AfterInstall: DeleteFromVirtualStore" \
"Source: \"{#SourcePath}\\..\\ReleaseNotes.css\"; DestDir: {app}\\usr\\share\\git; Flags: replacesameversion restartreplace; AfterInstall: DeleteFromVirtualStore" \
"Source: \"cmd\\git.exe\"; DestDir: {app}\\bin; Flags: replacesameversion restartreplace; AfterInstall: DeleteFromVirtualStore" \
"Source: \"mingw$BITNESS\\share\\git\\compat-bash.exe\"; DestName: bash.exe; DestDir: {app}\\bin; Flags: replacesameversion restartreplace; AfterInstall: DeleteFromVirtualStore" \
"Source: \"mingw$BITNESS\\share\\git\\compat-bash.exe\"; DestName: sh.exe; DestDir: {app}\\bin; Flags: replacesameversion restartreplace; AfterInstall: DeleteFromVirtualStore" \
"Source: \"$MSYSTEM_LOWER\\share\\git\\compat-bash.exe\"; DestName: bash.exe; DestDir: {app}\\bin; Flags: replacesameversion restartreplace; AfterInstall: DeleteFromVirtualStore" \
"Source: \"$MSYSTEM_LOWER\\share\\git\\compat-bash.exe\"; DestName: sh.exe; DestDir: {app}\\bin; Flags: replacesameversion restartreplace; AfterInstall: DeleteFromVirtualStore" \
"Source: \"{#SourcePath}\\..\\post-install.bat\"; DestName: post-install.bat; DestDir: {app}; Flags: replacesameversion restartreplace" \
>file-list.iss ||
die "Could not write to file-list.iss"
Expand Down Expand Up @@ -316,22 +315,12 @@ test -z "$include_pdbs" || {
} ||
die "Could not include .pdb files"

test -z "$arm64_artifacts_directory" || {
echo "Including ARM64 artifacts from $arm64_artifacts_directory" &&
inno_defines="$inno_defines$LF#define INSTALLER_FILENAME_SUFFIX 'arm64'" &&
mixed="$(cygpath -m "$arm64_artifacts_directory")" &&
find "$arm64_artifacts_directory" -type f |
sed -e "s|^$arm64_artifacts_directory\\(/.*\)\?/\([^/]*\)$|Source: \"$mixed\\1/\\2\"; DestDir: {app}/arm64\\1; Flags: replacesameversion restartreplace; AfterInstall: DeleteFromVirtualStore|" \
-e 's|/|\\|g' \
>> file-list.iss
} ||
die "Could not include ARM64 artifacts"

etc_gitconfig_dir="${etc_gitconfig%/gitconfig}"
printf "%s\n%s\n%s\n%s\n%s%s" \
printf "%s\n%s\n%s\n%s\n%s\n%s%s" \
"#define APP_VERSION '$displayver'" \
"#define FILENAME_VERSION '$version'" \
"#define BITNESS '$BITNESS'" \
"#define MINGW_BITNESS '$MSYSTEM_LOWER'" \
"#define SOURCE_DIR '$(cygpath -aw /)'" \
"#define ETC_GITCONFIG_DIR '${etc_gitconfig_dir//\//\\}'" \
"$inno_defines" \
Expand Down
Loading

0 comments on commit f2bb9e5

Please sign in to comment.