|
1 |
| -## msys2 安装 |
| 1 | +#!/usr/bin/env bash |
| 2 | +set -x |
2 | 3 |
|
3 |
| -# 打开站点: |
4 |
| -# |
5 |
| -# https://mirrors.tuna.tsinghua.edu.cn/msys2/distrib/x86_64/ |
| 4 | +__DIR__=$( |
| 5 | + cd "$(dirname "$0")" |
| 6 | + pwd |
| 7 | +) |
| 8 | +__PROJECT__=$( |
| 9 | + cd ${__DIR__}/../../../../ |
| 10 | + pwd |
| 11 | +) |
| 12 | +cd ${__PROJECT__} |
| 13 | +pwd |
6 | 14 |
|
7 |
| -wget https://mirrors.tuna.tsinghua.edu.cn/msys2/distrib/x86_64/msys2-x86_64-20230318.exe |
8 | 15 |
|
9 |
| -# msys2 help |
10 |
| -# https://mirror.tuna.tsinghua.edu.cn/help/msys2/ |
| 16 | +MIRROR='' |
| 17 | +IS_UPGRADE=0 |
| 18 | +while [ $# -gt 0 ]; do |
| 19 | + case "$1" in |
| 20 | + --mirror) |
| 21 | + MIRROR="$2" |
| 22 | + ;; |
| 23 | + --upgrade) |
| 24 | + IS_UPGRADE=1 |
| 25 | + ;; |
| 26 | + --*) |
| 27 | + echo "Illegal option $1" |
| 28 | + ;; |
| 29 | + esac |
| 30 | + shift $(($# > 0 ? 1 : 0)) |
| 31 | +done |
| 32 | + |
| 33 | +case "$MIRROR" in |
| 34 | +china) |
| 35 | + sed -i "s#https\?://mirror.msys2.org/#https://mirrors.tuna.tsinghua.edu.cn/msys2/#g" /etc/pacman.d/mirrorlist* |
| 36 | + ;; |
| 37 | +esac |
| 38 | + |
| 39 | +if [ $IS_UPGRADE == 1 ] ; then |
| 40 | + # 升级 |
| 41 | + pacman -Su --noconfirm |
| 42 | +fi |
11 | 43 |
|
12 | 44 |
|
13 | 45 | # 搜索包
|
14 |
| -pacman -Ss curl |
15 |
| -# 升级 |
16 |
| -pacman -Syu |
17 |
| -# 安装包 |
18 |
| -pacman -Sy git curl wget |
| 46 | +# pacman -Ss curl |
| 47 | + |
| 48 | +# 将本地的包数据库与远程的仓库进行了同步 |
| 49 | +pacman -Sy |
| 50 | + |
19 | 51 | # 无须确认安装包
|
20 |
| -pacman -Sy --noconfirm git curl wget openssl |
| 52 | +pacman -S --noconfirm git curl wget openssl |
| 53 | + |
| 54 | +pacman -S --noconfirm zip unzip xz gcc cmake make |
| 55 | +pacman -S --noconfirm re2c |
| 56 | + |
| 57 | +pacman -S --noconfirm openssl-devel libreadline |
| 58 | + |
| 59 | +pacman -S --noconfirm lzip |
| 60 | +pacman -S --noconfirm zip unzip |
| 61 | +pacman -S --noconfirm bison automake autoconf libtool coreutils |
| 62 | +pacman -S --noconfirm libcurl-devel libxml2-devel libxslt-devel |
| 63 | +pacman -S --noconfirm zlib-devel |
| 64 | +pacman -S --noconfirm libbz2-devel liblz4-devel liblzma-devel libcares-devel |
| 65 | +pacman -S --noconfirm libyaml-devel libzstd-devel libreadline-devel |
| 66 | +pacman -S --noconfirm libssh2-devel libidn2-devel gettext-devel |
| 67 | +pacman -S --noconfirm libzstd-devel |
| 68 | +pacman -S --noconfirm icu-devel |
| 69 | +pacman -S --noconfirm libsqlite-devel libsqlite |
| 70 | +pacman -S --noconfirm gmp-devel |
| 71 | +pacman -S --noconfirm libintl |
| 72 | +pacman -S --noconfirm pcre2 |
| 73 | +pacman -S --noconfirm brotli-devel |
| 74 | + |
| 75 | +:<<EOF |
| 76 | +# 不存在的包 |
| 77 | +pacman -S --noconfirm libpcre2-devel libssl-devel libgmp-devel |
| 78 | +pacman -S --noconfirm ImageMagick libpng-devel libjpeg-devel libfreetype-devel libwebp-devel libsqlite3-devel |
| 79 | +pacman -S --noconfirm libzip-devel libicu-devel libonig-devel libsodium-devel |
| 80 | +pacman -S --noconfirm libMagick-devel libbrotli-devel libintl-devel libpq-devel |
| 81 | +pacman -S --noconfirm libpq5 libpq-devel |
| 82 | +pacman -S --noconfirm gcc-g++ |
| 83 | +
|
| 84 | +# msys 环境下 可以安装 re2c |
| 85 | +# 不需要执行 bash ./sapi/scripts/cygwin/install-re2c.sh |
| 86 | +
|
| 87 | +
|
| 88 | +EOF |
| 89 | + |
| 90 | +# 清理缓存 |
| 91 | +pacman -Scc --noconfirm |
0 commit comments