From a99d0c681008a2c1c694780a8685cceda35662eb Mon Sep 17 00:00:00 2001 From: phanium <91544758+phanen@users.noreply.github.com> Date: Sat, 25 Jul 2026 01:55:36 +0800 Subject: [PATCH] build: support variant builds via env-var and cpack overrides #40947 Problem: scripts/genappimage.sh runs `make` with no extra flags and emits a fixed nvim-linux-.appimage filename, so packaging a variant build (e.g. with the bundled PUC-Rio Lua interpreter) requires editing the Makefile or post-renaming the AppImage, which breaks the AppImage zsync URL. Solution: forward DEPS_CMAKE_FLAGS and CMAKE_EXTRA_FLAGS to `make`, accept OUTPUT so the AppImage (and its zsync Filename:) follows the caller's chosen name, and mark CPACK_PACKAGE_FILE_NAME as CACHE STRING on Linux so the resulting tarball/deb follow as well. Default behavior is unchanged when none of these env vars are set. --- cmake.packaging/CMakeLists.txt | 2 +- scripts/genappimage.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake.packaging/CMakeLists.txt b/cmake.packaging/CMakeLists.txt index 584db2b85e..a02668b2ae 100644 --- a/cmake.packaging/CMakeLists.txt +++ b/cmake.packaging/CMakeLists.txt @@ -61,7 +61,7 @@ elseif(APPLE) set(CPACK_GENERATOR TGZ) set(CPACK_PACKAGE_ICON ${CMAKE_CURRENT_LIST_DIR}/neovim.icns) elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") - set(CPACK_PACKAGE_FILE_NAME "nvim-linux-${CMAKE_SYSTEM_PROCESSOR}") + set(CPACK_PACKAGE_FILE_NAME "nvim-linux-${CMAKE_SYSTEM_PROCESSOR}" CACHE STRING "Base filename for cpack output (no extension)") set(CPACK_GENERATOR TGZ DEB) set(CPACK_DEBIAN_PACKAGE_NAME "Neovim") # required set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Neovim.io") # required diff --git a/scripts/genappimage.sh b/scripts/genappimage.sh index 38129d090b..711bf491ef 100755 --- a/scripts/genappimage.sh +++ b/scripts/genappimage.sh @@ -27,7 +27,7 @@ APP_DIR="$APP.AppDir" ######################################################################## # Build and install nvim into the AppImage -make CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" +make CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS:-}" CMAKE_EXTRA_FLAGS="${CMAKE_EXTRA_FLAGS:-}" cmake --install build --prefix="$APP_BUILD_DIR/${APP_DIR}/usr" ######################################################################## @@ -82,11 +82,11 @@ if [[ "$ARCH_OUTPUT" == 'aarch64' ]]; then fi # Set the name of the file generated by appimage -export OUTPUT=nvim-linux-"$ARCH_OUTPUT".appimage +export OUTPUT="${OUTPUT:-nvim-linux-$ARCH_OUTPUT.appimage}" # If it's a release generate the zsync file if [ -n "$TAG" ]; then - export UPDATE_INFORMATION="gh-releases-zsync|neovim|neovim|$TAG|nvim-linux-$ARCH_OUTPUT.appimage.zsync" + export UPDATE_INFORMATION="gh-releases-zsync|neovim|neovim|$TAG|${OUTPUT}.zsync" fi # Generate AppImage. @@ -99,6 +99,6 @@ fi # Moving the final executable to a different folder so it isn't in the # way for a subsequent build. -mv "$ROOT_DIR"/build/nvim-linux-"$ARCH_OUTPUT".appimage* "$ROOT_DIR"/build/bin +mv "$ROOT_DIR/build/${OUTPUT:-nvim-linux-$ARCH_OUTPUT.appimage}"* "$ROOT_DIR/build/bin" echo 'genappimage.sh: finished'