@@ -3091,11 +3091,12 @@ publish_sdk () { #
3091
3091
git --git-dir=" $sdk64 " /usr/src/build-extra/.git push origin " $tag "
3092
3092
}
3093
3093
3094
- create_sdk_artifact () { # [--out=<directory>] [--git-sdk=<directory>] [--bitness=(32|64|auto )] [--force] <name>
3094
+ create_sdk_artifact () { # [--out=<directory>] [--git-sdk=<directory>] [--architecture=(x86_64|i686|aarch64)] [-- bitness=(32|64)] [--force] <name>
3095
3095
git_sdk_path=/
3096
3096
output_path=
3097
3097
force=
3098
- bitness=auto
3098
+ architecture=
3099
+ bitness=
3099
3100
keep_worktree=
3100
3101
while case " $1 " in
3101
3102
--out|-o)
@@ -3124,9 +3125,17 @@ create_sdk_artifact () { # [--out=<directory>] [--git-sdk=<directory>] [--bitnes
3124
3125
;;
3125
3126
--bitness=*|-b=*)
3126
3127
bitness=" ${1#* =} "
3128
+ echo " WARNING: using --bitness or -b is deprecated. Please use --architecture instead."
3127
3129
;;
3128
3130
-b*)
3129
3131
bitness=" ${1# -?} "
3132
+ echo " WARNING: using --bitness or -b is deprecated. Please use --architecture instead."
3133
+ ;;
3134
+ --architecture=*|-a=*)
3135
+ architecture=" ${1#* =} "
3136
+ ;;
3137
+ -a*)
3138
+ architecture=" ${1# -?} "
3130
3139
;;
3131
3140
--force|-f)
3132
3141
force=t
@@ -3146,11 +3155,43 @@ create_sdk_artifact () { # [--out=<directory>] [--git-sdk=<directory>] [--bitnes
3146
3155
test -n " $output_path " ||
3147
3156
output_path=" $( cygpath -am " $1 " ) "
3148
3157
3149
- case " $bitness " in
3150
- 32|64|auto) ;; # okay
3151
- *) die " Unhandled bitness: %s\n " " $bitness " ;;
3152
- esac
3158
+ if test -n " $bitness "
3159
+ then
3160
+ case " $bitness " in
3161
+ 32)
3162
+ architecture=i686
3163
+ ;;
3164
+ 64)
3165
+ architecture=x86_64
3166
+ ;;
3167
+ *) die " Unhandled bitness: %s\n " " $bitness " ;;
3168
+ esac
3169
+ elif test -z " $architecture "
3170
+ then
3171
+ die " Either --architecture or --bitness must be provided for this function to work."
3172
+ fi
3153
3173
3174
+ case " $architecture " in
3175
+ x86_64)
3176
+ MSYSTEM=MINGW64
3177
+ PREFIX=" /mingw64"
3178
+ # TODO update to git-sdk-amd64 after the repo has been updated
3179
+ SDK_REPO=" git-sdk-64"
3180
+ ;;
3181
+ i686)
3182
+ MSYSTEM=MINGW32
3183
+ PREFIX=" /mingw32"
3184
+ # TODO update to git-sdk-x86 after the repo has been updated
3185
+ SDK_REPO=" git-sdk-32"
3186
+ ;;
3187
+ aarch64)
3188
+ MSYSTEM=CLANGARM64
3189
+ PREFIX=" /clangarm64"
3190
+ SDK_REPO=" git-sdk-arm64"
3191
+ ;;
3192
+ *) die " Unhandled architecture: %s\n " " $architecture " ;;
3193
+ esac
3194
+
3154
3195
mode=
3155
3196
case " $1 " in
3156
3197
minimal|git-sdk-minimal) mode=minimal-sdk;;
@@ -3179,32 +3220,21 @@ create_sdk_artifact () { # [--out=<directory>] [--git-sdk=<directory>] [--bitnes
3179
3220
git_sdk_path=" ${git_sdk_path%/ } /.git"
3180
3221
test true = " $( git -C " $git_sdk_path " rev-parse --is-inside-git-dir) " ||
3181
3222
die " Not a Git repository: ' %s' \n " " $git_sdk_path "
3182
-
3183
- test auto != " $bitness " ||
3184
- if git -C " $git_sdk_path " rev-parse --quiet --verify HEAD:usr/i686-pc-msys 2>/dev/null
3185
- then
3186
- bitness=32
3187
- elif git -C " $git_sdk_path " rev-parse --quiet --verify HEAD:usr/x86_64-pc-msys 2>/dev/null
3188
- then
3189
- bitness=64
3190
- else
3191
- die " ' %s' is neither 32-bit nor 64-bit SDK? ! ? " " $git_sdk_path "
3192
- fi
3193
3223
else
3194
- test auto != " $bitness " ||
3195
- die " No SDK found at ' %s' ; Please use \` --bitness= < n > \` to indicate which SDK to use" " $git_sdk_path "
3224
+ test -z " $architecture " ||
3225
+ die " No SDK found at ' %s' ; Please use \` --architecture= < a > \` to indicate which SDK to use" " $git_sdk_path "
3196
3226
3197
3227
test " z$git_sdk_path " != " z${git_sdk_path% .git} " ||
3198
3228
git_sdk_path=" $git_sdk_path .git"
3199
- git clone --depth 1 --bare https://github.com/git-for-windows/git-sdk- $bitness " $git_sdk_path "
3229
+ git clone --depth 1 --bare https://github.com/git-for-windows/$SDK_REPO " $git_sdk_path "
3200
3230
fi
3201
3231
3202
3232
test full-sdk != " $mode " || {
3203
3233
mkdir -p " $output_path " &&
3204
3234
git -C " $git_sdk_path " archive --format=tar HEAD -- ':(exclude)ssl' |
3205
- xz -9 >" $output_path " /git-sdk- $bitness .tar.xz &&
3206
- echo " git-sdk- $bitness .tar.xz written to ' $output_path' " >&2 ||
3207
- die " Could not write git-sdk- $bitness .tar.xz to ' %s' \n " " $output_path "
3235
+ xz -9 >" $output_path " /$SDK_REPO .tar.xz &&
3236
+ echo " $SDK_REPO .tar.xz written to ' $output_path' " >&2 ||
3237
+ die " Could not write $SDK_REPO .tar.xz to ' %s' \n " " $output_path "
3208
3238
return 0
3209
3239
}
3210
3240
@@ -3261,14 +3291,14 @@ create_sdk_artifact () { # [--out=<directory>] [--git-sdk=<directory>] [--bitnes
3261
3291
EOF
3262
3292
git -C " $output_path " checkout -- &&
3263
3293
mkdir -p " $output_path /tmp" &&
3264
- printf 'export MSYSTEM=MINGW %s\nexport PATH=/mingw %s/bin:/usr/bin/:/usr/bin/core_perl:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem\n' " $bitness " " $bitness " >" $output_path /etc/profile" &&
3265
- mkdir -p " $output_path /mingw $bitness /bin" &&
3266
- case $bitness in
3267
- 32 )
3294
+ printf 'export MSYSTEM=%s\nexport PATH=%s/bin:/usr/bin/:/usr/bin/core_perl:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem\n' " $MSYSTEM " " $PREFIX " >" $output_path /etc/profile" &&
3295
+ mkdir -p " ${ output_path}${PREFIX} /bin" &&
3296
+ case $architecture in
3297
+ i686 )
3268
3298
# copy git.exe, for the libssp test
3269
3299
git -C " $output_path " show HEAD:mingw32/bin/git.exe \
3270
3300
>" $output_path /mingw32/bin/git.exe" &&
3271
- BITNESS=32 ARCH=i686 " $output_path /git-cmd.exe" --command=usr\\ bin\\ sh.exe -lx \
3301
+ ARCH=i686 " $output_path /git-cmd.exe" --command=usr\\ bin\\ sh.exe -lx \
3272
3302
" ${this_script_path%/* } /make-file-list.sh" |
3273
3303
# escape the ` [` in ` [.exe`
3274
3304
sed -e ' s|[][]|\\&|g' >> " $sparse_checkout_file " &&
@@ -3296,10 +3326,13 @@ create_sdk_artifact () { # [--out=<directory>] [--git-sdk=<directory>] [--bitnes
3296
3326
git -C " $git_sdk_path " show HEAD:.sparse/minimal-sdk > " $sparse_checkout_file " &&
3297
3327
printf ' \n' >> " $sparse_checkout_file " &&
3298
3328
git -C " $git_sdk_path " show HEAD:.sparse/makepkg-git >> " $sparse_checkout_file " &&
3299
- printf ' \n' >> " $sparse_checkout_file " &&
3300
- git -C " $git_sdk_path " show HEAD:.sparse/makepkg-git-i686 >> " $sparse_checkout_file " &&
3329
+ if test x86_64 = $architecture
3330
+ then
3331
+ printf ' \n' >> " $sparse_checkout_file " &&
3332
+ git -C " $git_sdk_path " show HEAD:.sparse/makepkg-git-i686 >> " $sparse_checkout_file "
3333
+ fi &&
3301
3334
printf ' \n# markdown, to render the release notes\n/usr/bin/markdown\n\n' >> " $sparse_checkout_file " &&
3302
- BITNESS=64 ARCH=x86_64 " $output_path /git-cmd.exe" --command=usr\\ bin\\ sh.exe -l \
3335
+ ARCH=$architecture " $output_path /git-cmd.exe" --command=usr\\ bin\\ sh.exe -l \
3303
3336
" ${this_script_path%/* } /make-file-list.sh" | sed -e ' s|[][]|\\&|g' -e ' s|^|/|' >> " $sparse_checkout_file "
3304
3337
;;
3305
3338
esac &&
@@ -3312,10 +3345,10 @@ create_sdk_artifact () { # [--out=<directory>] [--git-sdk=<directory>] [--bitnes
3312
3345
/usr/bin/msys-stdc++-*.dll
3313
3346
3314
3347
# WinToast
3315
- /mingw $bitness /bin/wintoast.exe
3348
+ $PREFIX /bin/wintoast.exe
3316
3349
3317
3350
# BusyBox
3318
- /mingw $bitness /bin/busybox.exe
3351
+ $PREFIX /bin/busybox.exe
3319
3352
EOF
3320
3353
mkdir -p " $output_path /.sparse" &&
3321
3354
cp " $sparse_checkout_file " " $output_path /.sparse/build-installers"
@@ -3326,8 +3359,11 @@ create_sdk_artifact () { # [--out=<directory>] [--git-sdk=<directory>] [--bitnes
3326
3359
then
3327
3360
printf ' \n' >> " $sparse_checkout_file " &&
3328
3361
git -C " $git_sdk_path " show HEAD:.sparse/$mode >> " $sparse_checkout_file " &&
3329
- printf ' \n' >> " $sparse_checkout_file " &&
3330
- git -C " $git_sdk_path " show HEAD:.sparse/$mode -i686 >> " $sparse_checkout_file "
3362
+ if test x86_64 = $architecture
3363
+ then
3364
+ printf ' \n' >> " $sparse_checkout_file " &&
3365
+ git -C " $git_sdk_path " show HEAD:.sparse/$mode -i686 >> " $sparse_checkout_file "
3366
+ fi
3331
3367
fi
3332
3368
;;
3333
3369
esac &&
@@ -3336,7 +3372,7 @@ create_sdk_artifact () { # [--out=<directory>] [--git-sdk=<directory>] [--bitnes
3336
3372
then
3337
3373
if test minimal-sdk = $mode
3338
3374
then
3339
- printf ' export MSYSTEM=MINGW64 \nexport PATH=/mingw64/ bin:/usr/bin/:/usr/bin/core_perl:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem\n' > " $output_path /etc/profile"
3375
+ printf ' export MSYSTEM=%s \nexport PATH=%s/ bin:/usr/bin/:/usr/bin/core_perl:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem\n' " $MSYSTEM " " $PREFIX " > " $output_path /etc/profile"
3340
3376
elif test makepkg-git = $mode
3341
3377
then
3342
3378
cat > " $output_path /etc/profile" << -\EOF
@@ -3353,6 +3389,9 @@ create_sdk_artifact () { # [--out=<directory>] [--git-sdk=<directory>] [--bitnes
3353
3389
if test MSYS = "$MSYSTEM "
3354
3390
then
3355
3391
PATH=/usr/bin:/usr/bin/core_perl:$SYSTEMROOT_MSYS /system32:$SYSTEMROOT_MSYS
3392
+ elif test CLANGARM64 = "$MSYSTEM "
3393
+ then
3394
+ PATH=/clangarm64/bin:/usr/bin:/usr/bin/core_perl:$SYSTEMROOT_MSYS /system32:$SYSTEMROOT_MSYS
3356
3395
elif test MINGW32 = "$MSYSTEM "
3357
3396
then
3358
3397
PATH=/mingw32/bin:/mingw64/bin:/usr/bin:/usr/bin/core_perl:$SYSTEMROOT_MSYS /system32:$SYSTEMROOT_MSYS
0 commit comments