mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-17 12:34:37 +03:00
1.6 KiB
1.6 KiB
在 macOS 下编译 Nekoray
git clone 源码
git clone https://github.com/MatsuriDayo/nekoray.git --recursive
先决条件
- 安装
CMakeNinjanpm - 安装 Qt
5.15.x编译环境,并设置好有关环境变量,以免 CMake 找不到 Qt。 (qtbaseqtsvgqttools) - 安装
appdmg(sudo npm install -g appdmg)
CMake 参数
同 Build_Linux
C++ 部分
编译安装 C/C++ 依赖
(这一步可能要挂梯)
./libs/build_deps_all.sh
编译本体
mkdir build
cd build
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DNKR_PACKAGE_MACOS=1 ..
ninja
Go 部分编译
打包
如有疑问,请参考这个脚本
准备core
将 编译得到的 nekoray_core nekobox_core 放入 build/nekoray.app/Contents/MacOS
准备geo文件(可选)
curl -Lso build/nekoray.app/Contents/MacOS/geoip.dat "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat"
curl -Lso build/nekoray.app/Contents/MacOS/geosite.dat "https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat"
curl -Lso build/nekoray.app/Contents/MacOS/geoip.db "https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db"
curl -Lso build/nekoray.app/Contents/MacOS/geosite.db "https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db"
如果打包时没有包含geo文件,可在应用内设置 v2ray资源路径 代替。
在nekoray目录下打包
appdmg appdmg.json /path/to/nekoray.dmg