allow switching msys2 environment in packaging script (#335)
This commit is contained in:
parent
4673850c9c
commit
e79b8d47ab
|
@ -3,7 +3,14 @@
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
|
|
||||||
# Usage:
|
# Usage:
|
||||||
# packages/msys/build-x64.sh [-c|--clean] [-nd|--no-deps] [-t|--target-dir <dir>]
|
# packages/msys/build-mingw.sh [-m|--msystem <MSYSTEM>] [-c|--clean] [-nd|--no-deps] [-t|--target-dir <dir>]
|
||||||
|
# Options:
|
||||||
|
# -m, --msystem <MSYSTEM> switch to other MSYS2 environment
|
||||||
|
# (MINGW32, MINGW64, UCRT64, CLANG32, CLANG64)
|
||||||
|
# MUST be used before other options
|
||||||
|
# -c, --clean clean build and package directories
|
||||||
|
# -nd, --no-deps skip dependency check
|
||||||
|
# -t, --target-dir <dir> set target directory for the packages
|
||||||
|
|
||||||
source version.inc
|
source version.inc
|
||||||
[[ -n "${APP_VERSION_SUFFIX}" ]] && APP_VERSION="${APP_VERSION}${APP_VERSION_SUFFIX}"
|
[[ -n "${APP_VERSION_SUFFIX}" ]] && APP_VERSION="${APP_VERSION}${APP_VERSION_SUFFIX}"
|
||||||
|
@ -13,6 +20,21 @@ if [[ ! -v MSYSTEM ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ $# -gt 1 && ($1 == "-m" || $1 == "--msystem") ]]; then
|
||||||
|
msystem=$2
|
||||||
|
shift 2
|
||||||
|
case "${msystem}" in
|
||||||
|
MINGW32|MINGW64|UCRT64|CLANG32|CLANG64)
|
||||||
|
export MSYSTEM="${msystem}"
|
||||||
|
exec /bin/bash --login "$0" "$@"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Invalid MSYSTEM: ${msystem}"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
case "${MSYSTEM}" in
|
case "${MSYSTEM}" in
|
||||||
MINGW32|CLANG32) # there is no UCRT32
|
MINGW32|CLANG32) # there is no UCRT32
|
||||||
NSIS_ARCH=x86
|
NSIS_ARCH=x86
|
||||||
|
|
Loading…
Reference in New Issue