欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 健康 > 美食 > mac 安装homebrew

mac 安装homebrew

2024/11/30 6:56:56 来源:https://blog.csdn.net/weixin_44730335/article/details/140119439  浏览:    关键词:mac 安装homebrew
vim brew_install.sh

输入:

#!/bin/bash
set -u# First check if the OS is Linux.
if [[ "$(uname)" = "Linux" ]]; thenHOMEBREW_ON_LINUX=1
fi# Check if macOS is ARM
if [[ "$(uname)" = "Darwin" ]] && [[ "$(sysctl -n hw.optional.arm64 2>/dev/null || echo '0')" = "1" ]]; thenHOMEBREW_APPLE_SILICON=1
fi# On macOS, this script installs to /usr/local only.
# On Linux, it installs to /home/linuxbrew/.linuxbrew if you have sudo access
# and ~/.linuxbrew otherwise.
# To install elsewhere (which is unsupported)
# you can untar https://github.com/Homebrew/brew/tarball/master
# anywhere you like.
if [[ -z "${HOMEBREW_ON_LINUX-}" ]]; thenHOMEBREW_PREFIX="/usr/local"HOMEBREW_REPOSITORY="/usr/local/Homebrew"HOMEBREW_CACHE="${HOME}/Library/Caches/Homebrew"STAT="stat -f"CHOWN="/usr/sbin/chown"CHGRP="/usr/bin/chgrp"GROUP="admin"TOUCH="/usr/bin/touch"
elseHOMEBREW_PREFIX_DEFAULT="/home/linuxbrew/.linuxbrew"HOMEBREW_CACHE="${HOME}/.cache/Homebrew"STAT="stat --printf"CHOWN="/bin/chown"CHGRP="/bin/chgrp"GROUP="$(id -gn)"TOUCH="/bin/touch"
fi
BREW_REPO="https://github.com/Homebrew/brew"# TODO: bump version when new macOS is released
MACOS_LATEST_SUPPORTED="10.15"
# TODO: bump version when new macOS is released
MACOS_OLDEST_SUPPORTED="10.13"# For Homebrew on Linux
REQUIRED_RUBY_VERSION=2.6  # https://github.com/Homebrew/brew/pull/6556
REQUIRED_GLIBC_VERSION=2.13  # https://docs.brew.sh/Homebrew-on-Linux#requirements# no analytics during installation
export HOMEBREW_NO_ANALYTICS_THIS_RUN=1
export HOMEBREW_NO_ANALYTICS_MESSAGE_OUTPUT=1# string formatters
if [[ -t 1 ]]; thentty_escape() { printf "\033[%sm" "$1"; }
elsetty_escape() { :; }
fi
tty_mkbold() { tty_escape "1;$1"; }
tty_underline="$(tty_escape "4;39")"
tty_blue="$(tty_mkbold 34)"
tty_red="$(tty_mkbold 31)"
tty_bold="$(tty_mkbold 39)"
tty_reset="$(tty_escape 0)"have_sudo_access() {local -a argsif [[ -n "${SUDO_ASKPASS-}" ]]; thenargs=("-A")fiif [[ -z "${HAVE_SUDO_ACCESS-}" ]]; thenif [[ -n "${args[*]-}" ]]; then/usr/bin/sudo "${args[@]}" -l mkdir &>/dev/nullelse/usr/bin/sudo -l mkdir &>/dev/nullfiHAVE_SUDO_ACCESS="$?"fiif [[ -z "${HOMEBREW_ON_LINUX-}" ]] && [[ "$HAVE_SUDO_ACCESS" -ne 0 ]]; thenabort "Need sudo access on macOS (e.g. the user $USER to be an Administrator)!"fireturn "$HAVE_SUDO_ACCESS"
}shell_join() {local argprintf "%s" "$1"shiftfor arg in "$@"; doprintf " "printf "%s" "${arg// /\ }"done
}chomp() {printf "%s" "${1/"$'\n'"/}"
}ohai() {printf "${tty_blue}==>${tty_bold} %s${tty_reset}\n" "$(shell_join "$@")"
}warn() {printf "${tty_red}Warning${tty_reset}: %s\n" "$(chomp "$1")"
}abort() {printf "%s\n" "$1"exit 1
}execute() {if ! "$@"; thenabort "$(printf "Failed during: %s" "$(shell_join "$@")")"fi
}execute_sudo() {local -a args=("$@")if [[ -n "${SUDO_ASKPASS-}" ]]; thenargs=("-A" "${args[@]}")fiif have_sudo_access; thenohai "/usr/bin/sudo" "${args[@]}"execute "/usr/bin/sudo" "${args[@]}"elseohai "${args[@]}"execute "${args[@]}"fi
}getc() {local save_statesave_state=$(/bin/stty -g)/bin/stty raw -echoIFS= read -r -n 1 -d '' "$@"/bin/stty "$save_state"
}wait_for_user() {local cechoecho "Press RETURN to continue or any other key to abort"getc c# we test for \r and \n because some stuff does \r insteadif ! [[ "$c" == $'\r' || "$c" == $'\n' ]]; thenexit 1fi
}major_minor() {echo "${1%%.*}.$(x="${1#*.}"; echo "${x%%.*}")"
}if [[ -z "${HOMEBREW_ON_LINUX-}" ]]; thenmacos_version="$(major_minor "$(/usr/bin/sw_vers -productVersion)")"
fiversion_gt() {[[ "${1%.*}" -gt "${2%.*}" ]] || [[ "${1%.*}" -eq "${2%.*}" && "${1#*.}" -gt "${2#*.}" ]]
}
version_ge() {[[ "${1%.*}" -gt "${2%.*}" ]] || [[ "${1%.*}" -eq "${2%.*}" && "${1#*.}" -ge "${2#*.}" ]]
}
version_lt() {[[ "${1%.*}" -lt "${2%.*}" ]] || [[ "${1%.*}" -eq "${2%.*}" && "${1#*.}" -lt "${2#*.}" ]]
}should_install_git() {if [[ $(command -v git) ]]; thenreturn 1fi
}should_install_curl() {if [[ $(command -v curl) ]]; thenreturn 1fi
}should_install_command_line_tools() {if [[ -n "${HOMEBREW_ON_LINUX-}" ]]; thenreturn 1fiif [[ -n "${HOMEBREW_APPLE_SILICON-}" ]]; thenreturn 1;fiif version_gt "$macos_version" "10.13"; then! [[ -e "/Library/Developer/CommandLineTools/usr/bin/git" ]]else! [[ -e "/Library/Developer/CommandLineTools/usr/bin/git" ]] ||! [[ -e "/usr/include/iconv.h" ]]fi
}get_permission() {$STAT "%A" "$1"
}user_only_chmod() {[[ -d "$1" ]] && [[ "$(get_permission "$1")" != "755" ]]
}exists_but_not_writable() {[[ -e "$1" ]] && ! [[ -r "$1" && -w "$1" && -x "$1" ]]
}get_owner() {$STAT "%u" "$1"
}file_not_owned() {[[ "$(get_owner "$1")" != "$(id -u)" ]]
}get_group() {$STAT "%g" "$1"
}file_not_grpowned() {[[ " $(id -G "$USER") " != *" $(get_group "$1") "*  ]]
}# Please sync with 'test_ruby()' in 'Library/Homebrew/utils/ruby.sh' from Homebrew/brew repository.
test_ruby () {if [[ ! -x $1 ]]thenreturn 1fi"$1" --enable-frozen-string-literal --disable=gems,did_you_mean,rubyopt -rrubygems -e \"abort if Gem::Version.new(RUBY_VERSION.to_s.dup).to_s.split('.').first(2) != \Gem::Version.new('$REQUIRED_RUBY_VERSION').to_s.split('.').first(2)" 2>/dev/null
}no_usable_ruby() {local ruby_execIFS=$'\n' # Do word splitting on new lines onlyfor ruby_exec in $(which -a ruby); doif test_ruby "$ruby_exec"; thenreturn 1fidoneIFS=$' \t\n' # Restore IFS to its default valuereturn 0
}outdated_glibc() {local glibc_versionglibc_version=$(ldd --version | head -n1 | grep -o '[0-9.]*$' | grep -o '^[0-9]\+\.[0-9]\+')version_lt "$glibc_version" "$REQUIRED_GLIBC_VERSION"
}if [[ -n "${HOMEBREW_ON_LINUX-}" ]] && no_usable_ruby && outdated_glibc
thenabort "$(cat <<-EOFABORTHomebrew requires Ruby $REQUIRED_RUBY_VERSION which was not found on your system.Homebrew portable Ruby requires Glibc version $REQUIRED_GLIBC_VERSION or newer,and your Glibc version is too old.See ${tty_underline}https://docs.brew.sh/Homebrew-on-Linux#requirements${tty_reset}Install Ruby $REQUIRED_RUBY_VERSION and add its location to your PATH.EOFABORT)"
fi# USER isn't always set so provide a fall back for the installer and subprocesses.
if [[ -z "${USER-}" ]]; thenUSER="$(chomp "$(id -un)")"export USER
fi# Invalidate sudo timestamp before exiting (if it wasn't active before).
if ! /usr/bin/sudo -n -v 2>/dev/null; thentrap '/usr/bin/sudo -k' EXIT
fi# Things can fail later if `pwd` doesn't exist.
# Also sudo prints a warning message for no good reason
cd "/usr" || exit 1####################################################################### script
if should_install_git; thenabort "$(cat <<EOABORT
You must install Git before installing Homebrew. See:${tty_underline}https://docs.brew.sh/Installation${tty_reset}
EOABORT
)"
fiif should_install_curl; thenabort "$(cat <<EOABORT
You must install cURL before installing Homebrew. See:${tty_underline}https://docs.brew.sh/Installation${tty_reset}
EOABORT
)"
fiif [[ -z "${HOMEBREW_ON_LINUX-}" ]]; thenhave_sudo_access
elseif [[ -n "${CI-}" ]] || [[ -w "$HOMEBREW_PREFIX_DEFAULT" ]] || [[ -w "/home/linuxbrew" ]] || [[ -w "/home" ]]; thenHOMEBREW_PREFIX="$HOMEBREW_PREFIX_DEFAULT"elsetrap exit SIGINTif [[ $(/usr/bin/sudo -n -l mkdir 2>&1) != *"mkdir"* ]]; thenohai "Select the Homebrew installation directory"echo "- ${tty_bold}Enter your password${tty_reset} to install to ${tty_underline}${HOMEBREW_PREFIX_DEFAULT}${tty_reset} (${tty_bold}recommended${tty_reset})"echo "- ${tty_bold}Press Control-D${tty_reset} to install to ${tty_underline}$HOME/.linuxbrew${tty_reset}"echo "- ${tty_bold}Press Control-C${tty_reset} to cancel installation"fiif have_sudo_access; thenHOMEBREW_PREFIX="$HOMEBREW_PREFIX_DEFAULT"elseHOMEBREW_PREFIX="$HOME/.linuxbrew"fitrap - SIGINTfiHOMEBREW_REPOSITORY="${HOMEBREW_PREFIX}/Homebrew"
fiif [[ "$UID" == "0" ]]; thenabort "Don't run this as root!"
elif [[ -d "$HOMEBREW_PREFIX" && ! -x "$HOMEBREW_PREFIX" ]]; thenabort "$(cat <<EOABORT
The Homebrew prefix, ${HOMEBREW_PREFIX}, exists but is not searchable. If this is
not intentional, please restore the default permissions and try running the
installer again:sudo chmod 775 ${HOMEBREW_PREFIX}
EOABORT
)"
fiif [[ -z "${HOMEBREW_ON_LINUX-}" ]]; thenif version_lt "$macos_version" "10.7"; thenabort "$(cat <<EOABORT
Your Mac OS X version is too old. See:${tty_underline}https://github.com/mistydemeo/tigerbrew${tty_reset}
EOABORT
)"elif version_lt "$macos_version" "10.9"; thenabort "Your OS X version is too old"elif version_gt "$macos_version" "$MACOS_LATEST_SUPPORTED" || \version_lt "$macos_version" "$MACOS_OLDEST_SUPPORTED"; thenwho="We"what=""if version_gt "$macos_version" "$MACOS_LATEST_SUPPORTED"; thenwhat="pre-release version"elsewho+=" (and Apple)"what="old version"fiohai "You are using macOS ${macos_version}."ohai "${who} do not provide support for this ${what}."echo "$(cat <<EOS
This installation may not succeed.
After installation, you will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew\'s GitHub,
Discourse, Twitter or IRC. You are responsible for resolving any issues you
experience while you are running this ${what}.
EOS
)
"fi
fiohai "This script will install:"
echo "${HOMEBREW_PREFIX}/bin/brew"
echo "${HOMEBREW_PREFIX}/share/doc/homebrew"
echo "${HOMEBREW_PREFIX}/share/man/man1/brew.1"
echo "${HOMEBREW_PREFIX}/share/zsh/site-functions/_brew"
echo "${HOMEBREW_PREFIX}/etc/bash_completion.d/brew"
echo "${HOMEBREW_REPOSITORY}"# Keep relatively in sync with
# https://github.com/Homebrew/brew/blob/master/Library/Homebrew/keg.rb
directories=(bin etc include lib sbin share opt varFrameworksetc/bash_completion.d lib/pkgconfigshare/aclocal share/doc share/info share/locale share/manshare/man/man1 share/man/man2 share/man/man3 share/man/man4share/man/man5 share/man/man6 share/man/man7 share/man/man8var/log var/homebrew var/homebrew/linkedbin/brew)
group_chmods=()
for dir in "${directories[@]}"; doif exists_but_not_writable "${HOMEBREW_PREFIX}/${dir}"; thengroup_chmods+=("${HOMEBREW_PREFIX}/${dir}")fi
done# zsh refuses to read from these directories if group writable
directories=(share/zsh share/zsh/site-functions)
zsh_dirs=()
for dir in "${directories[@]}"; dozsh_dirs+=("${HOMEBREW_PREFIX}/${dir}")
donedirectories=(bin etc include lib sbin share var optshare/zsh share/zsh/site-functionsvar/homebrew var/homebrew/linkedCellar Caskroom Homebrew Frameworks)
mkdirs=()
for dir in "${directories[@]}"; doif ! [[ -d "${HOMEBREW_PREFIX}/${dir}" ]]; thenmkdirs+=("${HOMEBREW_PREFIX}/${dir}")fi
doneuser_chmods=()
if [[ "${#zsh_dirs[@]}" -gt 0 ]]; thenfor dir in "${zsh_dirs[@]}"; doif user_only_chmod "${dir}"; thenuser_chmods+=("${dir}")fidone
fichmods=()
if [[ "${#group_chmods[@]}" -gt 0 ]]; thenchmods+=("${group_chmods[@]}")
fi
if [[ "${#user_chmods[@]}" -gt 0 ]]; thenchmods+=("${user_chmods[@]}")
fichowns=()
chgrps=()
if [[ "${#chmods[@]}" -gt 0 ]]; thenfor dir in "${chmods[@]}"; doif file_not_owned "${dir}"; thenchowns+=("${dir}")fiif file_not_grpowned "${dir}"; thenchgrps+=("${dir}")fidone
fiif [[ "${#group_chmods[@]}" -gt 0 ]]; thenohai "The following existing directories will be made group writable:"printf "%s\n" "${group_chmods[@]}"
fi
if [[ "${#user_chmods[@]}" -gt 0 ]]; thenohai "The following existing directories will be made writable by user only:"printf "%s\n" "${user_chmods[@]}"
fi
if [[ "${#chowns[@]}" -gt 0 ]]; thenohai "The following existing directories will have their owner set to ${tty_underline}${USER}${tty_reset}:"printf "%s\n" "${chowns[@]}"
fi
if [[ "${#chgrps[@]}" -gt 0 ]]; thenohai "The following existing directories will have their group set to ${tty_underline}${GROUP}${tty_reset}:"printf "%s\n" "${chgrps[@]}"
fi
if [[ "${#mkdirs[@]}" -gt 0 ]]; thenohai "The following new directories will be created:"printf "%s\n" "${mkdirs[@]}"
fiif should_install_command_line_tools; thenohai "The Xcode Command Line Tools will be installed."
fiif [[ -t 0 && -z "${CI-}" ]]; thenwait_for_user
fiif [[ -d "${HOMEBREW_PREFIX}" ]]; thenif [[ "${#chmods[@]}" -gt 0 ]]; thenexecute_sudo "/bin/chmod" "u+rwx" "${chmods[@]}"fiif [[ "${#group_chmods[@]}" -gt 0 ]]; thenexecute_sudo "/bin/chmod" "g+rwx" "${group_chmods[@]}"fiif [[ "${#user_chmods[@]}" -gt 0 ]]; thenexecute_sudo "/bin/chmod" "755" "${user_chmods[@]}"fiif [[ "${#chowns[@]}" -gt 0 ]]; thenexecute_sudo "$CHOWN" "$USER" "${chowns[@]}"fiif [[ "${#chgrps[@]}" -gt 0 ]]; thenexecute_sudo "$CHGRP" "$GROUP" "${chgrps[@]}"fi
elseexecute_sudo "/bin/mkdir" "-p" "${HOMEBREW_PREFIX}"if [[ -z "${HOMEBREW_ON_LINUX-}" ]]; thenexecute_sudo "$CHOWN" "root:wheel" "${HOMEBREW_PREFIX}"elseexecute_sudo "$CHOWN" "$USER:$GROUP" "${HOMEBREW_PREFIX}"fi
fiif [[ "${#mkdirs[@]}" -gt 0 ]]; thenexecute_sudo "/bin/mkdir" "-p" "${mkdirs[@]}"execute_sudo "/bin/chmod" "g+rwx" "${mkdirs[@]}"execute_sudo "$CHOWN" "$USER" "${mkdirs[@]}"execute_sudo "$CHGRP" "$GROUP" "${mkdirs[@]}"
fiif ! [[ -d "${HOMEBREW_CACHE}" ]]; thenif [[ -z "${HOMEBREW_ON_LINUX-}" ]]; thenexecute_sudo "/bin/mkdir" "-p" "${HOMEBREW_CACHE}"elseexecute "/bin/mkdir" "-p" "${HOMEBREW_CACHE}"fi
fi
if exists_but_not_writable "${HOMEBREW_CACHE}"; thenexecute_sudo "/bin/chmod" "g+rwx" "${HOMEBREW_CACHE}"
fi
if file_not_owned "${HOMEBREW_CACHE}"; thenexecute_sudo "$CHOWN" "$USER" "${HOMEBREW_CACHE}"
fi
if file_not_grpowned "${HOMEBREW_CACHE}"; thenexecute_sudo "$CHGRP" "$GROUP" "${HOMEBREW_CACHE}"
fi
if [[ -d "${HOMEBREW_CACHE}" ]]; thenexecute "$TOUCH" "${HOMEBREW_CACHE}/.cleaned"
fiif should_install_command_line_tools && version_ge "$macos_version" "10.13"; thenohai "Searching online for the Command Line Tools"# This temporary file prompts the 'softwareupdate' utility to list the Command Line Toolsclt_placeholder="/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress"execute_sudo "$TOUCH" "$clt_placeholder"clt_label_command="/usr/sbin/softwareupdate -l |grep -B 1 -E 'Command Line Tools' |awk -F'*' '/^ *\\*/ {print \$2}' |sed -e 's/^ *Label: //' -e 's/^ *//' |sort -V |tail -n1"clt_label="$(chomp "$(/bin/bash -c "$clt_label_command")")"if [[ -n "$clt_label" ]]; thenohai "Installing $clt_label"execute_sudo "/usr/sbin/softwareupdate" "-i" "$clt_label"execute_sudo "/bin/rm" "-f" "$clt_placeholder"execute_sudo "/usr/bin/xcode-select" "--switch" "/Library/Developer/CommandLineTools"fi
fi# Headless install may have failed, so fallback to original 'xcode-select' method
if should_install_command_line_tools && test -t 0; thenohai "Installing the Command Line Tools (expect a GUI popup):"execute_sudo "/usr/bin/xcode-select" "--install"echo "Press any key when the installation has completed."getcexecute_sudo "/usr/bin/xcode-select" "--switch" "/Library/Developer/CommandLineTools"
fiif [[ -z "${HOMEBREW_ON_LINUX-}" ]] && ! output="$(/usr/bin/xcrun clang 2>&1)" && [[ "$output" == *"license"* ]]; thenabort "$(cat <<EOABORT
You have not agreed to the Xcode license.
Before running the installer again please agree to the license by opening
Xcode.app or running:sudo xcodebuild -license
EOABORT
)"
fiohai "Downloading and installing Homebrew..."
(cd "${HOMEBREW_REPOSITORY}" >/dev/null || return# we do it in four steps to avoid merge errors when reinstallingexecute "git" "init" "-q"# "git remote add" will fail if the remote is defined in the global configexecute "git" "config" "remote.origin.url" "${BREW_REPO}"execute "git" "config" "remote.origin.fetch" "+refs/heads/*:refs/remotes/origin/*"# ensure we don't munge line endings on checkoutexecute "git" "config" "core.autocrlf" "false"execute "git" "fetch" "origin" "--force"execute "git" "fetch" "origin" "--tags" "--force"execute "git" "reset" "--hard" "origin/master"execute "ln" "-sf" "${HOMEBREW_REPOSITORY}/bin/brew" "${HOMEBREW_PREFIX}/bin/brew"execute "${HOMEBREW_PREFIX}/bin/brew" "update" "--force"
) || exit 1if [[ ":${PATH}:" != *":${HOMEBREW_PREFIX}/bin:"* ]]; thenwarn "${HOMEBREW_PREFIX}/bin is not in your PATH."
fiohai "Installation successful!"
echo# Use the shell's audible bell.
if [[ -t 1 ]]; thenprintf "\a"
fi# Use an extra newline and bold to avoid this being missed.
ohai "Homebrew has enabled anonymous aggregate formulae and cask analytics."
echo "$(cat <<EOS
${tty_bold}Read the analytics documentation (and how to opt-out) here:${tty_underline}https://docs.brew.sh/Analytics${tty_reset}
No analytics data has been sent yet (or will be during this \`install\` run).
EOS
)
"ohai "Homebrew is run entirely by unpaid volunteers. Please consider donating:"
echo "$(cat <<EOS${tty_underline}https://github.com/Homebrew/brew#donations${tty_reset}
EOS
)
"(cd "${HOMEBREW_REPOSITORY}" >/dev/null || returnexecute "git" "config" "--replace-all" "homebrew.analyticsmessage" "true"execute "git" "config" "--replace-all" "homebrew.caskanalyticsmessage" "true"
) || exit 1ohai "Next steps:"
echo "- Run \`brew help\` to get started"
echo "- Further documentation: "
echo "    ${tty_underline}https://docs.brew.sh${tty_reset}"if [[ -n "${HOMEBREW_ON_LINUX-}" ]]; thencase "$SHELL" in*/bash*)if [[ -r "$HOME/.bash_profile" ]]; thenshell_profile="$HOME/.bash_profile"elseshell_profile="$HOME/.profile"fi;;*/zsh*)shell_profile="$HOME/.zprofile";;*)shell_profile="$HOME/.profile";;esacecho "- Install the Homebrew dependencies if you have sudo access:"if [[ $(command -v apt-get) ]]; thenecho "    sudo apt-get install build-essential"elif [[ $(command -v yum) ]]; thenecho "    sudo yum groupinstall 'Development Tools'"elif [[ $(command -v pacman) ]]; thenecho "    sudo pacman -S base-devel"elif [[ $(command -v apk) ]]; thenecho "    sudo apk add build-base"ficat <<EOSSee ${tty_underline}https://docs.brew.sh/linux${tty_reset} for more information
- Add Homebrew to your ${tty_bold}PATH${tty_reset} in ${tty_underline}${shell_profile}${tty_reset}:echo 'eval \$(${HOMEBREW_PREFIX}/bin/brew shellenv)' >> ${shell_profile}eval \$(${HOMEBREW_PREFIX}/bin/brew shellenv)
- We recommend that you install GCC:brew install gccEOS
fi

运行脚本:
 

// 检查权限 -rwxr-xr-x
ls -l brew_install.sh
// 添加权限
chmod +x brew_install.sh
// 运行脚本
./brew_install.sh
// 检查
cat brew_install.sh

参考:
mac系统安装homebrew - 简书

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com