Skip to content

Instantly share code, notes, and snippets.

@osamuaoki
Last active April 1, 2023 12:57
Show Gist options
  • Save osamuaoki/9299fca297f47f06aeac4a568eaee206 to your computer and use it in GitHub Desktop.
Save osamuaoki/9299fca297f47f06aeac4a568eaee206 to your computer and use it in GitHub Desktop.
neovim build script -- shared lib on debian experimental
#!/bin/sh -e
# This is for Debian bookworm + experimental system
# dpkg-architecture
DEB_HOST_MULTIARCH=x86_64-linux-gnu
GENERATOR="-G Ninja"
VERBOSE=""
LOGLEVEL="--log-level=STATUS"
while [ $# -gt 0 ]; do
if [ "$1" = "-v" ] || [ "$1" = "--verbose" ]; then
# verbose build
VERBOSE="--verbose"
LOGLEVEL="--log-level=VERBOSE"
shift
elif [ "$1" = "-m" ] || [ "$1" = "--make" ]; then
# use make instead
GENERATOR=""
shift
else
echo "${0##*/} [-v|--verbose] [-m|--make]"
exit 0
fi
done
git clone https://github.com/neovim/neovim.git
cd neovim
mkdir build
cd build
# execute cmake in build
BUILD_TYPE=RelWithDebInfo
# Configure to build with Ninja (use luajit)
cmake $GENERATOR \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DBUSTED_OUTPUT_TYPE=nvim \
-DLIBLUV_LIBRARY:FILEPATH=/usr/lib/$DEB_HOST_MULTIARCH/lua/5.1/luv.so \
-DLIBLUV_INCLUDE_DIR:PATH=/usr/include/lua5.1 \
-DPREFER_LUA=OFF \
-DCOMPILE_LUA=OFF \
"$LOGLEVEL" \
..
# Build with Ninja ($VERBOSE is unquoted with reason)
cmake --build . $VERBOSE
# Build Debian package ($VERBOSE is unquoted with reason)
cpack -G DEB $VERBOSE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment