You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
neovide/snap/snapcraft.yaml

115 lines
3.7 KiB
YAML

name: neovide # you probably want to 'snapcraft register <name>'
base: core18 # the base snap is the execution environment for this snap
version: "0.7.1+git"
summary: The snappiest vim editor you are likely to find.
description: |
This is a simple graphical user interface for Neovim. Where possible there are some graphical improvements,
but it should act functionally like the terminal UI.
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: strict # use 'strict' once you have the right plugs and slots
build-packages:
- cmake
- freeglut3-dev
- libbz2-dev
- libexpat1-dev
- libgl-dev
- libssl-dev
- libxmu-dev
- pkg-config
parts:
nvim:
source: https://github.com/neovim/neovim.git
override-pull: |
snapcraftctl pull
latest_tag="$(git tag -l --sort=refname|head -1)"
git checkout "${latest_tag}"
major="$(awk '/NVIM_VERSION_MAJOR/{gsub(")","",$2); print $2}' CMakeLists.txt)"
minor="$(awk '/NVIM_VERSION_MINOR/{gsub(")","",$2); print $2}' CMakeLists.txt)"
patch="$(awk '/NVIM_VERSION_PATCH/{gsub(")","",$2); print $2}' CMakeLists.txt)"
version_prefix="v$major.$minor.$patch"
git_described="$(git describe --first-parent --dirty 2> /dev/null | perl -lpe 's/v\d.\d.\d-//g')"
git_described="${git_described:-$(git describe --first-parent --tags --always --dirty)}"
if [ "${version_prefix}" != "${git_described}" ]; then
VERSION="${version_prefix}-${git_described}-${latest_tag}"
else
VERSION="${version_prefix}-${latest_tag}"
fi
snapcraftctl set-version "${VERSION}"
plugin: make
make-parameters:
- CMAKE_BUILD_TYPE=RelWithDebInfo
- CMAKE_INSTALL_PREFIX=/usr
- CMAKE_FLAGS=-DPREFER_LUA=ON
- DEPS_CMAKE_FLAGS="-DUSE_BUNDLED_LUA=ON -DUSE_BUNDLED_LUAJIT=OFF"
override-build: |
echo "Building on $SNAP_ARCH"
set -x
case "$SNAP_ARCH" in
"arm64" | "ppc64el" | "s390x")
make -j"${SNAPCRAFT_PARALLEL_BUILD_COUNT}" \
CMAKE_BUILD_TYPE=RelWithDebInfo \
CMAKE_INSTALL_PREFIX=/usr \
CMAKE_FLAGS=-DPREFER_LUA=ON \
DEPS_CMAKE_FLAGS="-DUSE_BUNDLED_LUA=ON -DUSE_BUNDLED_LUAJIT=OFF"
;;
*)
make -j"${SNAPCRAFT_PARALLEL_BUILD_COUNT}" \
CMAKE_BUILD_TYPE=RelWithDebInfo \
CMAKE_INSTALL_PREFIX=/usr
;;
esac
make DESTDIR="$SNAPCRAFT_PART_INSTALL" install
# Fix Desktop file
sed -i 's|^Exec=nvim|Exec=/snap/bin/nvim.nvim|' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/nvim.desktop
sed -i 's|^TryExec=nvim|TryExec=/snap/bin/nvim.nvim|' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/nvim.desktop
sed -i 's|^Icon=.*|Icon=${SNAP}/usr/share/pixmaps/nvim.png|' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/nvim.desktop
build-packages:
- ninja-build
- libtool
- libtool-bin
- autoconf
- automake
- gawk
- g++
- git
- gettext
- unzip
- wget
prime:
- -usr/share/man
desktop-glib-only:
plugin: make
source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
source-subdir: glib-only
neovide:
plugin: rust
source: .
build-packages:
- fontconfig
- libfontconfig1-dev
- libfreetype6-dev
stage-packages:
- fontconfig
- fonts-noto
- libfontconfig1
- libibus-1.0-5
- libpng16-16
- libx11-dev
- libx11-xcb1
- libxcursor1
- libxi-dev
- libxrandr-dev
- locales-all
- xdg-user-dirs
apps:
neovide:
command: bin/neovide
plugs:
- desktop
- desktop-legacy
command-chain:
- bin/desktop-launch