在 macOS 下编译 Nekoray
git clone https://github.com/MatsuriDayo/nekoray.git --recursive
- 安装
CMake
Ninja
npm
- 安装 Qt
5.15.x
编译环境,并设置好有关环境变量,以免 CMake 找不到 Qt。 (qtbase
qtsvg
qttools
) - 安装
appdmg
(sudo npm install -g appdmg
)
同 Build_Linux
(这一步可能要挂梯)
./libs/build_deps_all.sh
mkdir build
cd build
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DNKR_PACKAGE_MACOS=1 ..
ninja
如有疑问,请参考这个脚本
将 编译得到的 nekoray_core
nekobox_core
放入 build/nekoray.app/Contents/MacOS
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资源路径
代替。
appdmg appdmg.json /path/to/nekoray.dmg