这篇笔记讲述了如何在离线环境下 build neovim

neovim 的官方目前 (#2024-04-20) 并没有提供 linux-arm64 的 binary,在一些场景下需要 build from source。neovim build 时默认会从 github 上下载依赖,国内网络环境下经常下载失败。这篇笔记讲述了如何预先在不受限的网络环境中准备相关的文件,避免在 build 时访问网络上的资源。

  1. Clone the Repo

    git clone https://github.com/neovim/neovim
    cd neovim
  2. Install system build prerequisites

    • neovim/BUILD.md

    • debian/ubuntu: Clone the third-party deps and move them to .deps/build/src ref

      sudo apt-get install ninja-build gettext cmake unzip curl build-essential
      git clone https://github.com/neovim/deps ~/nvim-deps
      mkdir -p .deps/build/src/
      rsync -avP ~/nvim-deps/src/ .deps/build/src
  3. Build With USE_EXISTING_SRC_DIR=ON

    make CMAKE_BUILD_TYPE=Release	USE_EXISTING_SRC_DIR=ON