Skip to content

Instantly share code, notes, and snippets.

@jrmolin
Last active September 3, 2024 15:46
Show Gist options
  • Save jrmolin/9b664a7a493740c257f474c5b4a22fb7 to your computer and use it in GitHub Desktop.
Save jrmolin/9b664a7a493740c257f474c5b4a22fb7 to your computer and use it in GitHub Desktop.
Build neovim for Linux/aarch64 with Docker and git (mostly automated)
#!/usr/bin/env bash
CONTAINER=${CONTAINER:-nvim-builder}
INSTALL_DIR=${INSTALL_DIR:-/opt/nvim}
# make the docker container
docker build -t ${CONTAINER} .
if [ ! -d neovim ] ; then
git clone github.com:neovim/neovim
cd neovim && git checkout stable && cd -
fi
if [ -d "${INSTALL_DIR}" ] ; then
sudo rm -rf "${INSTALL_DIR}"
fi
sudo mkdir -pv "${INSTALL_DIR}"
sudo chown $(id -nu):$(id -ng) "${INSTALL_DIR}"
docker run \
-eUSER=$(whoami) \
-eINSTALL_DIR="${INSTALL_DIR}" \
-u"$(id -u):$(id -g)" \
-w"$(pwd)" \
-v"$(pwd):$(pwd)" \
-v"${INSTALL_DIR}:${INSTALL_DIR}" \
-v"/tmp:/tmp" \
${CONTAINER}
FROM ubuntu:24.04
RUN apt-get update && \
apt-get install -y \
ninja-build \
gettext \
cmake \
unzip \
curl \
build-essential
ADD start.sh /
RUN chmod +x /start.sh
CMD [ "/start.sh" ]
#!/usr/bin/env bash
cd neovim \
&& make clean \
&& make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
&& make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment