name: neovide # you probably want to 'snapcraft register ' base: core20 # the base snap is the execution environment for this snap version: "0.8.0+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: stable # 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 branch="$(git tag -l --sort=refname | awk '/v[0-9\.]/{print $0}' | tail -1)" git checkout tags/${branch} -b ${branch} 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="v$major.$minor.$patch" snapcraftctl set-version "${VERSION}" plugin: make 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/icons/hicolor/128x128/apps/nvim.png|' \ ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/nvim.desktop build-packages: - ninja-build - libtool - libtool-bin - autoconf - automake - cmake - gawk - g++ - git - gettext - pkg-config - 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 - libxcb-composite0-dev stage-packages: - libxkbcommon0 - libxkbcommon-x11-0 - libegl1-mesa - libgl1-mesa-glx - fontconfig - fonts-noto - libfontconfig1 - libibus-1.0-5 - libpng16-16 - libx11-6 - libx11-xcb1 - libxcursor1 - libxi6 - libxrandr2 - locales-all - xdg-user-dirs apps: neovide: command: bin/neovide plugs: - desktop - desktop-legacy - wayland - unity7 - opengl - x11 command-chain: - bin/desktop-launch