diff options
Diffstat (limited to 'snap/snapcraft.yaml')
-rw-r--r-- | snap/snapcraft.yaml | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 81ffb9adf3..da3e74d3e7 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,5 +1,6 @@ -name: neovim -version: git +name: nvim +base: core18 +adopt-info: nvim summary: Vim-fork focused on extensibility and agility. description: | Neovim is a project that seeks to aggressively refactor Vim in order to: @@ -9,22 +10,41 @@ description: | Enable the implementation of new/modern user interfaces without any modifications to the core source Improve extensibility with a new plugin architecture For lots more details, see the wiki! + +grade: stable # must be 'stable' to release into candidate/stable channels confinement: classic apps: - neovim: - command: usr/local/bin/nvim - plugs: [network, network-bind, x11] + nvim: + command: usr/bin/nvim environment: HOME: /home/$USER - VIM: $SNAP/usr/local/share/nvim/runtime + VIM: $SNAP/usr/share/nvim + VIMRUNTIME: $SNAP/usr/share/nvim/runtime + desktop: usr/share/applications/nvim.desktop parts: - neovim: + nvim: source: . + override-pull: | + snapcraftctl pull + 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)}" + snapcraftctl set-version "${version_prefix}-${git_described}" plugin: make make-parameters: - CMAKE_BUILD_TYPE=Release + - CMAKE_INSTALL_PREFIX=/usr + override-build: | + snapcraftctl build + # 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 @@ -33,9 +53,10 @@ parts: - automake - cmake - g++ + - git + - gettext - pkg-config - unzip - snap: - - usr/local/bin - - usr/local/share/nvim - - -usr/local/share/man + prime: + - -usr/share/man + |