diff options
-rwxr-xr-x | scripts/genappimage.sh | 52 | ||||
-rw-r--r-- | src/nvim/lib/kbtree.h | 3 |
2 files changed, 28 insertions, 27 deletions
diff --git a/scripts/genappimage.sh b/scripts/genappimage.sh index c0ef2a8591..cc88ab5559 100755 --- a/scripts/genappimage.sh +++ b/scripts/genappimage.sh @@ -37,29 +37,24 @@ VERSION=$("$ROOT_DIR"/build/bin/nvim --version | head -n 1 | grep -o 'v.*') cd "$APP_BUILD_DIR" -curl -Lo "$APP_BUILD_DIR"/appimage_functions.sh https://github.com/AppImage/AppImages/raw/master/functions.sh -. ./appimage_functions.sh - -# Copy desktop and icon file to AppDir for AppRun to pick them up. -# get_apprun -# get_desktop -cp "$ROOT_DIR/runtime/nvim.desktop" "$APP_DIR/" -cp "$ROOT_DIR/runtime/nvim.png" "$APP_DIR/" +# Only downloads linuxdeploy if the remote file is different from local +if [ -e "$APP_BUILD_DIR"/linuxdeploy-x86_64.AppImage ]; then + curl -Lo "$APP_BUILD_DIR"/linuxdeploy-x86_64.AppImage \ + -z "$APP_BUILD_DIR"/linuxdeploy-x86_64.AppImage \ + https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage +else + curl -Lo "$APP_BUILD_DIR"/linuxdeploy-x86_64.AppImage \ + https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage +fi + +chmod +x "$APP_BUILD_DIR"/linuxdeploy-x86_64.AppImage + +# metainfo is not packaged automatically by linuxdeploy mkdir "$APP_DIR/usr/share/metainfo/" cp "$ROOT_DIR/runtime/nvim.appdata.xml" "$APP_DIR/usr/share/metainfo/" cd "$APP_DIR" -# copy dependencies -copy_deps -# Move the libraries to usr/bin -move_lib - -# Delete stuff that should not go into the AppImage. -# Delete dangerous libraries; see -# https://github.com/AppImage/AppImages/blob/master/excludelist -delete_blacklisted - ######################################################################## # AppDir complete. Now package it as an AppImage. ######################################################################## @@ -78,21 +73,24 @@ chmod 755 AppRun cd "$APP_BUILD_DIR" # Get out of AppImage directory. +# Set the name of the file generated by appimage +export OUTPUT=nvim.appimage + +# If it's a release generate the zsync file +if [ -n "$TAG" ]; then + export UPDATE_INFORMATION="gh-releases-zsync|neovim|neovim|$TAG|nvim.appimage.zsync" +fi + # Generate AppImage. # - Expects: $ARCH, $APP, $VERSION env vars # - Expects: ./$APP.AppDir/ directory -# - Produces: ../out/$APP-$VERSION.glibc$GLIBC_NEEDED-$ARCH.AppImage -if [ -n "$TAG" ]; then - generate_type2_appimage -u "gh-releases-zsync|neovim|neovim|$TAG|nvim.appimage.zsync" -else - generate_type2_appimage -fi +# - Produces: ./nvim.appimage +./linuxdeploy-x86_64.AppImage --appdir $APP.AppDir -d $ROOT_DIR/runtime/nvim.desktop -i \ +"$ROOT_DIR/runtime/nvim.png" --output appimage # Moving the final executable to a different folder so it isn't in the # way for a subsequent build. -mv "$ROOT_DIR"/out/*.AppImage* "$ROOT_DIR"/build/bin -# Remove the (now empty) folder the AppImage was built in -rmdir "$ROOT_DIR"/out +mv "$ROOT_DIR"/build/nvim.appimage* "$ROOT_DIR"/build/bin echo 'genappimage.sh: finished' diff --git a/src/nvim/lib/kbtree.h b/src/nvim/lib/kbtree.h index ad6ff9cdb9..704aa26010 100644 --- a/src/nvim/lib/kbtree.h +++ b/src/nvim/lib/kbtree.h @@ -31,6 +31,7 @@ #include <stdlib.h> #include <string.h> #include <stdint.h> +#include <assert.h> #include "nvim/memory.h" @@ -332,6 +333,7 @@ if (itr->p == NULL) return 0; \ for (;;) { \ ++itr->p->i; \ + assert(itr->p->i <= 21); \ while (itr->p->x && itr->p->i <= itr->p->x->n) { \ itr->p[1].i = 0; \ itr->p[1].x = itr->p->x->is_internal? __KB_PTR(b, itr->p->x)[itr->p->i] : 0; \ @@ -377,6 +379,7 @@ itr->p->i = i; \ if (i >= 0 && r == 0) return 1; \ ++itr->p->i; \ + assert(itr->p->i <= 21); \ itr->p[1].x = itr->p->x->is_internal? __KB_PTR(b, itr->p->x)[i + 1] : 0; \ ++itr->p; \ } \ |