Closed mralusw closed 3 months ago
Fixes #67 (partially)
Thanks. Regarding:
currently impossible to extract GVim.appimage and symlink AppRun
Why would one need that? Isn't the whole point of the appimage to have it readily available and running without having to extract it manually?
Why would one need that? Isn't the whole point of the appimage to have it readily available and running without having to extract it manually?
Yes and no. Every appimage has a hidden --appimage-extract
flag. And if you look into apprun-hooks/linuxdeploy-plugin-gtk.sh
, it tries to take this scenario into account (but ultimately fails):
export APPDIR="${APPDIR:-"$(dirname "$(realpath "$0")")"}" # Workaround to run extracted AppImage
Some users extract the appimage to some folder ("AppDir") in the filesystem, then symlink from AppRun
to /usr/local/bin/real-app-name
. It's a good way to get a clean build of an app without incurring the
[g]vim
from vim-appimage
while still keeping vim near-instantaneous (for example as a $GIT_EDITOR
/ $EDITOR
).The problem is that for GVim.appimage
(but not Vim.appimage
), linuxdeploy
creates a "broken" AppRun
that can't be symlinked to and renames "our" AppRun
to *.wrapped
.
Now, if you never even considered extracted appimages, I wonder why the code didn't just use $APPDIR
(provided by the appimage infra) to begin with, instead of trying to compute $HERE
by itself. Taking all this into account, I would
AppRun
(which gets renamed to AppRun.wrapped
in GVim.appimage
) to be an appimage-only script (i.e. it could rely on $ARGV0
and $APPDIR
being set)AppDirRun
in the appimage for users who extract. Or AppDirRun
can be documented / uploaded elsewhere in this repository (technically, it's already quoted in an issue, but it's a bit annoying to copy/pasta every time one extracts a new appimage)okay thanks. Let me merge your changes for now. If you think it is beneficial, to further improve the AppRun
script generated, I welcome you to make those change and create a new PR. I am not planning to work further on this, since I am too busy with Vim maintenance.
appimages pass
$ARGV0
to AppRun: use it to detect vim/gvimextracting Vim.appimage to an AppDir, symlinking AppRun to vim works
currently impossible to extract GVim.appimage and symlink AppRun b/c:
dirname
/readlink
order)AppDir/**/AppRun.wrapped
directly / via symlink bypasses those hooks and thus fails to set GTK varsnotes:
$HERE
to$this_dir
, which linuxdeploy-plugin-gtk already clobbers (not explicitly exported, but might be in user's env)$0
inAppRun[.wrapped]
is pointless when run from appimage ($0
is/tmp/.mount*/AppRun[.wrapped]
).--
guard before args, thus AppDirs can't be named-...