brew安装_macOS安装citra

本文详细介绍了在Mac上安装Homebrew的过程,包括解决安装时的网络问题,更换国内镜像源以提高速度,以及后续安装依赖环境如pkg-config、SDL2、Qt5、CMake等。最后,通过Git克隆citra-emu/citra源代码,并使用CMake编译,完成citra模拟器的安装。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、安装Homebrew

终端输入

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

若报错

curl: (7) Failed to connect to http:// raw.githubusercontent.com port 443: Connection refused

直接下载文件brew_install.rb

链接: https://pan.baidu.com/s/1BONMlbkwWcuBqy3BHgWvyg 提取码: uvxn

终端运行

ruby [把brew_install.rb拖入]

415eb981c9fd8ddefa721e673187d5f6.png

回车继续之后输入密码,密码是隐藏起来的,输入之后回车就好。

二、Homebrew更换国内镜像源

替换brew.git:
$ cd "$(brew --repo)"
中科大:
$ git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
清华:
$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git

替换homebrew-core.git:
$ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"

中科大:
$ git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

清华:
$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git


替换homebrew-bottles:

中科大:
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
$ source ~/.bash_profile

清华:
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile

$ source ~/.bash_profile

应用:
$ brew update
————————————————
版权声明:本文为CSDN博主「膨胀权」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/d940319760/java/article/details/94446136

三、安装依赖环境

1.pkg-config ​

brew install pkgconfig

2.SDL2​

brew install sdl2

3.Qt5 ​

brew install qt5

4.CMak

brew install cmake

5.最新版本的Xcode和Xcode命令行工具

Xcode从App Store直接安装

Xcode命令行工具终端运行命令行:

xcode-select --install

(若显示xcode-select: error: command line tools are already installed, use "Software Update" to install updates,这说明已经安装过)

四、安装citra

1.从Github上clone下源代码

git clone --recursive https://github.com/citra-emu/citra
cd citra

2.让CMake识别Qt5的安装路径

export Qt5_DIR=$(brew --prefix)/opt/qt5

3.创建需要的项目文件

mkdir build
cd build
cmake .. -DCMAKE_OSX_ARCHITECTURES="x86_64;x86_64h" -DCMAKE_BUILD_TYPE=Release

4.大功告成

make -j4

运行完毕之后citra-qt.app 就会在build/bin下。

参考

[1]如何在Mac上(编译)运行3DS模拟器_无聊P_新浪博客

[2]Mac安装homebrew报错curl: (7) Failed to connect to raw.githubusercontent.com port 443: Operation

[3]Mac Homebrew 如何更换国内镜像源

[4]Xcode中Command Line Tools安装方法

[5]Building for macOS · citra-emu/citra Wiki · GitHub

### 使用 HomebrewmacOS安装软件 HomebrewmacOS 平台上的包管理工具,可以方便地安装各种开源软件。对于 Python 的安装以及遇到 `pip3` 命令未被识别的情况,可以通过以下方式解决[^1]。 #### 安装 Homebrew 如果发现 Homebrew 安装过程非常缓慢甚至卡住,这可能是由于网络连接问题造成的。为了加速下载速度并顺利完成安装,建议更换国内镜像源后再尝试安装 Homebrew: ```bash # 替换为清华大学的镜像地址来加快安装速度 /usr/bin/ruby -e "$(curl -fsSL https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/install/install)" ``` 完成上述命令后即可正常运行 `/usr/bin/ruby brew_install` 来继续安装流程[^2]。 #### 解决 pip3 不可用的问题 当通过 Homebrew 成功安装 Python 后却发现无法正常使用 `pip3` 时,可能是因为环境变量 PATH 设置不正确所致。此时应该确认当前使用的 shell 配置文件(如 `.zshrc` 或者 `.bash_profile`)中包含了如下路径设置: ```bash export PATH="/usr/local/opt/python/libexec/bin:$PATH" ``` 保存更改后的配置文件,并重新加载使之生效;之后再试一次 `pip3 --version` 查看版本号以验证是否解决问题。 #### 示例:使用 Homebrew 安装 NPM 和 Docker Toolbox 除了 Python 外,还可以利用 Homebrew 轻松获取其他开发所需组件,比如 Node.js 的包管理器 NPM: ```bash brew install npm ``` 而对于想要体验容器化应用的同学来说,则可以直接借助 Homebrew 获取 Docker Toolbox 工具集[^3]: ```bash brew cask install docker-toolbox ``` 需要注意的是,在执行这些操作之前最好先更新本地 Homebrew 数据库至最新状态(`brew update`)。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值