-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
[RFC] Appimage #6638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Appimage #6638
Conversation
scripts/genappimage.sh
Outdated
export ARCH="$(arch)" | ||
fi | ||
|
||
APP=NVim |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not remember Neovim being named NVim. Why not Neovim?
scripts/genappimage.sh
Outdated
# get_desktopintegration "$LOWERAPP" | ||
|
||
######################################################################## | ||
# Determine the version of the app; also include needed glibc version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is “needed glibc version”?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I need to change that comment. It used to add glibc to the version string twice - once there and once in the generate_appimage function in https://github.com/probonopd/AppImages/blob/master/functions.sh
scripts/genappimage.sh
Outdated
@@ -0,0 +1,143 @@ | |||
#!/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are using sh scripts/genappimage.sh
in Makefile. This can’t be #!/bin/bash
in this case, sh is not bash in Ubuntu, it is dash.
scripts/genappimage.sh
Outdated
fi | ||
|
||
APP=NVim | ||
LOWERAPP="${APP,,}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to use weird bash features here, can simply hardcode a string. Though I guess this needs to be nvim and not tolower($APP).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also looks like the only place you need bash, except that I do not know what appimage_functions.sh requires.
scripts/genappimage.sh
Outdated
#get_apprun | ||
|
||
# get_desktop | ||
find "${ROOT_DIR}" -name "${LOWERAPP}.desktop" -xdev -exec cp {} "${LOWERAPP}.desktop" \; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can hardly understand what find
is doing here. Why not simply use a path?
scripts/genappimage.sh
Outdated
|
||
# Since neovim increments versions slower than vim, using | ||
# the commit's date makes more sense. | ||
VIM_VER="$(date -d "@$(git log -1 --format=%ct)" "+%F")" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be NVIM_VER. And why not first include a base version (like 0.2.0) and then a date and not only a date? Also git
knows how to format a date: git show --no-patch --date='format:%F' --format='%cd'
.
scripts/genappimage.sh
Outdated
|
||
cd "$APP_BUILD_DIR" | ||
|
||
wget -q https://github.com/probonopd/AppImages/raw/master/functions.sh -O ./appimage_functions.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our other scripts all use curl. Though most portable would be using cmake -DURL=https://github.com/probonopd/AppImages/raw/master/functions.sh -DFILE=./appimage_functions.sh cmake/Download.cmake
, but it overly verbose.
scripts/genappimage.sh
Outdated
#sed -i -e "s|/usr/local/|$APPDIR/usr/|g" usr/bin/nvim | ||
#sed -i -e "s|/usr/share/doc/vim/|$APPDIR/usr/share/doc/vim/|g" usr/bin/nvim | ||
|
||
patch_strings_in_file "$APP_DIR"/usr/bin/nvim '/usr/local/nvim' '$APPDIR/usr/nvim' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks hacky, can’t you use some defines for that? CMAKE_INSTALL_PREFIX is defined via make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=…"
if you want to use top-level Makefile.
scripts/genappimage.sh
Outdated
# Now packaging it as an AppImage | ||
######################################################################## | ||
|
||
find "${ROOT_DIR}" -name "nvim.apprun" -xdev -exec cp {} "$APP_DIR/AppRun" \; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, why find and not exact path?
appimage/nvim.apprun
Outdated
# I don't believe this line is needed since the referenced directories are empty. | ||
# Uncomment if this changes. | ||
# Value taken from https://github.com/probonopd/AppImageKit/blob/appimagetool/master/AppRun.c | ||
# export LD_LIBRARY_PATH="$(printf "LD_LIBRARY_PATH=%s/usr/lib/:%s/usr/lib/i386-linux-gnu/:%s/usr/lib/x86_64-linux-gnu/:%s/usr/lib32/:%s/usr/lib64/:%s/lib/:%s/lib/i386-linux-gnu/:%s/lib/x86_64-linux-gnu/:%s/lib32/:%s/lib64/:%s" "$APPIMAGEDIR" "$APPIMAGEDIR" "$APPIMAGEDIR" "$APPIMAGEDIR" "$APPIMAGEDIR" "$APPIMAGEDIR" "$APPIMAGEDIR" "$APPIMAGEDIR" "$APPIMAGEDIR" "$APPIMAGEDIR" "$LD_LIBRARY_PATH")" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect, see AppImage/AppImageKit#391.
appimage/nvim.apprun
Outdated
#!/bin/sh | ||
|
||
# This script is a replacement for the standard AppRun binary. | ||
# The problem is that AppRun normally appends to PYTHONPATH. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not append, it prepends.
Changed generated executable name format. It is now: NeoVim-Nightly-${COMMIT_DATE}-${NEOVIM_VERSION}-glibc${GLIBC_VERSION}-${ARCHITECTURE}.AppImage Use the nvim.desktop file already in the runtime directory. Use symlinks to the nvim executable instead of a wrapper script for AppRun. Use paths when moving needed files instead of `find`ing them first. `make install` to the build directory instead of using `DESTDIR` then moving them. User `curl` instead of `wget`. Script now shebangs to `/bin/sh` instead of `/bin/bash`.
scripts/genappimage.sh
Outdated
export ARCH="$(arch)" | ||
fi | ||
|
||
APP=NeoVim |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Official variant is Neovim. One capital.
scripts/genappimage.sh
Outdated
|
||
cd "$APP_DIR" | ||
# No need for a fancy script. AppRun can just be a symlink to nvim. | ||
ln -s ./usr/bin/nvim AppRun |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ln -s
does not really care whether path symlink points to exist. So may just as well be ln -s usr/bin/nvim "$APP_DIR/AppRun"
, without any cd
s.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After failing so many symlinks due to using relative paths, I should have realized that by now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cd is necessary in an interactive session: not because ln will start to care, but because tab completion will be enabled and you have less probability of error. This does not apply in scripts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, except that I am not familiar with appimage.
I decided to test this on The generated AppImage ran properly and still worked when ran on |
@AdnoC The docker is good for such tests, there are also ubuntu and archlinux images. And travis docker images in https://quay.io/organization/travisci. Unless you are going to mess up with kernel (which is shared with the host) it would normally be faster then whatever you could use iso images for. |
@AdnoC Why merging with master? AFAIK after last policy review you are supposed to
|
eh? |
oh! oops. So thats what "Update branch" does. My bad. I'll force push to remove the merge. |
RE: Docker I hadn't realized that you could run Linux containers on Windows. TIL |
scripts/genappimage.sh
Outdated
# Determine the version of the app; For use in file filename | ||
######################################################################## | ||
|
||
VERSION="Nightly-$COMMIT_DATE-$VIM_VER" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove Nightly-
please. The version is enough, and for tagged versions we don't want "nightly" in the file name.
scripts/genappimage.sh
Outdated
# rm -rf ./usr/share/doc || true | ||
#rm -rf ./usr/bin/vim || true | ||
# remove unneded links | ||
# find ./usr/bin -type l \! -name "gvim" -delete || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is left over from vim's script? Is this a TODO or can we just delete this section?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was from vim's script and can be deleted
scripts/genappimage.sh
Outdated
# #for package in *.deb; do | ||
# # dpkg -x $package . | ||
# #done | ||
# #rm -f *.deb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete this section starting from line 41
scripts/genappimage.sh
Outdated
#!/bin/sh | ||
|
||
######################################################################## | ||
# Package the baries built on Travis-CI as an AppImage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
Removed "Nightly-" from final executable name. Removed unused and commented out lines from the original vim-appimage script. Removed unneeded `mv` from `usr/local` to `usr`. We install directly to `usr` now. Fixed spelling mistake.
This is really cool, I tried one of your release images. But when I run (on ubuntu 14.04)
I'm trying to gather all the steps needed to automate this on CI. |
The
|
The |
scripts/genappimage.sh produces an executable: Neovim-${COMMIT_DATE}-${NEOVIM_VERSION}-glibc${GLIBC_VERSION}-${ARCHITECTURE}.AppImage - Use the nvim.desktop file already in the runtime directory. - Use symlinks to the nvim executable instead of a wrapper script for AppRun. - Use paths when moving needed files instead of `find`ing them first. `make install` to the build directory instead of using `DESTDIR` then moving them. - Install directly to usr/. Closes neovim#6083
scripts/genappimage.sh produces an executable: Neovim-${COMMIT_DATE}-${NEOVIM_VERSION}-glibc${GLIBC_VERSION}-${ARCHITECTURE}.AppImage - Use the nvim.desktop file already in the runtime directory. - Use symlinks to the nvim executable instead of a wrapper script for AppRun. - Use paths when moving needed files instead of `find`ing them first. `make install` to the build directory instead of using `DESTDIR` then moving them. - Install directly to usr/. Closes neovim#6083
scripts/genappimage.sh produces an executable: nvim-${NVIM_VERSION}-glibc${GLIBC_VERSION}-${ARCHITECTURE}.AppImage Closes #6083
Merged. Thank you @AdnoC and @ZyX-I. And thanks to @probonopd -- I'm really impressed by AppImage! |
I'm not sure why it would say |
Handles #6083
Command to build the AppImage executable is
make appimage
.Executable is placed in
build/bin
with naming format.NVim-Nightly-${COMMIT_DATE}-git${GIT_HASH_SUMMARY}.glibc${GLIBC_VERSION}-${ARCHITECTURE}.AppImage
Name format is now
Neovim-${COMMIT_DATE}-${NEOVIM_VERSION}-glibc${GLIBC_VERSION}-${ARCHITECTURE}.AppImage
.You can find pre-build executables to test here.