summaryrefslogtreecommitdiff
path: root/cerbero-uninstalled
diff options
context:
space:
mode:
authorAndoni Morales Alastruey <ylatuya@gmail.com>2021-09-29 10:21:43 +0100
committerAndoni Morales Alastruey <ylatuya@gmail.com>2022-03-04 11:07:22 +0100
commit235ffdf123811513c5e73a04c997ed8dffa53682 (patch)
treed7cfe2587fbeb5fdb0d33e6105bd92a688780b2d /cerbero-uninstalled
parent77839490bf79659682ed87b8a45752754a0d87df (diff)
Add support for MSYS2
This is the initial commit to start supporting MSYS2 (https://www.msys2.org/) in favor of the old MSYS/MinGW. MSYS2 brings several important improvements: * Project with active development * In sync with latest Cygwin * Up-to-date packages * Package manager Here is a more detailed writeup of MSYS2 from Git's migration https://github.com/git/git/commit/df5218b4c30b2fa1ba0d1ada4166ad85bc83be26 The old msys will still be supported to ease the migration but a deprecation warning will be shown to migrate to MSYS2 Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/743>
Diffstat (limited to 'cerbero-uninstalled')
-rwxr-xr-xcerbero-uninstalled27
1 files changed, 19 insertions, 8 deletions
diff --git a/cerbero-uninstalled b/cerbero-uninstalled
index 7a66e2bf..2e68a969 100755
--- a/cerbero-uninstalled
+++ b/cerbero-uninstalled
@@ -24,8 +24,19 @@
ARGS=$@
SCRIPTDIR="`dirname $0`"
-case "$MSYSTEM" in
- *MINGW*) PYTHON="py -3";;
+if [[ -f "/mingw/bin/mingw-get.exe" ]]; then
+ MSYS_VERSION=1
+elif [[ -f "/usr/bin/pacman" ]]; then
+ MSYS_VERSION=2
+ if [ "$MSYSTEM" != "UCRT64" ]; then
+ echo "MSYS2 must use the UCRT64 environment instead of $MSYSTEM. https://www.msys2.org/docs/environments/";
+ exit 1;
+ fi
+fi
+
+case "$MSYS_VERSION" in
+ *1) PYTHON="py -3";;
+ *2) PYTHON="winpty py -3";;
*) PYTHON="python3";;
esac
@@ -69,13 +80,13 @@ msys_dir_to_win32() {
echo ${mounted_path}${path}
}
+
get_scriptdir() {
- if [ -n "$MSYSTEM" ]; then
- # Get the win32 path, instead of the Cygwin one
- msys_dir_to_win32 "$SCRIPTDIR"
- else
- echo $SCRIPTDIR
- fi
+ case "$MSYS_VERSION" in
+ *1) msys_dir_to_win32 "$SCRIPTDIR";;
+ *2) cygpath -m -C ANSI "$SCRIPTDIR";;
+ *) echo $SCRIPTDIR;;
+ esac
}
$PYTHON -c """