snapcraft.yaml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. name: nvim
  2. base: core18
  3. adopt-info: nvim
  4. summary: Vim-fork focused on extensibility and agility.
  5. description: |
  6. Neovim is a project that seeks to aggressively refactor Vim in order to:
  7. Simplify maintenance and encourage contributions
  8. Split the work between multiple developers
  9. Enable the implementation of new/modern user interfaces without any modifications to the core source
  10. Improve extensibility with a new plugin architecture
  11. For lots more details, see the wiki!
  12. grade: stable # must be 'stable' to release into candidate/stable channels
  13. confinement: classic
  14. apps:
  15. nvim:
  16. command: usr/bin/nvim
  17. environment:
  18. HOME: /home/$USER
  19. VIM: $SNAP/usr/share/nvim
  20. VIMRUNTIME: $SNAP/usr/share/nvim/runtime
  21. desktop: usr/share/applications/nvim.desktop
  22. parts:
  23. nvim:
  24. source: https://github.com/neovim/neovim.git
  25. override-pull: |
  26. snapcraftctl pull
  27. latest_tag="$(git tag -l --sort=refname|head -1)"
  28. git checkout "${latest_tag}"
  29. major="$(awk '/NVIM_VERSION_MAJOR/{gsub(")","",$2); print $2}' CMakeLists.txt)"
  30. minor="$(awk '/NVIM_VERSION_MINOR/{gsub(")","",$2); print $2}' CMakeLists.txt)"
  31. patch="$(awk '/NVIM_VERSION_PATCH/{gsub(")","",$2); print $2}' CMakeLists.txt)"
  32. version_prefix="v$major.$minor.$patch"
  33. git_described="$(git describe --first-parent --dirty 2> /dev/null | perl -lpe 's/v\d.\d.\d-//g')"
  34. git_described="${git_described:-$(git describe --first-parent --tags --always --dirty)}"
  35. if [ "${version_prefix}" != "${git_described}" ]; then
  36. VERSION="${version_prefix}-${git_described}-${latest_tag}"
  37. else
  38. VERSION="${version_prefix}-${latest_tag}"
  39. fi
  40. snapcraftctl set-version "${VERSION}"
  41. plugin: make
  42. make-parameters:
  43. - CMAKE_BUILD_TYPE=RelWithDebInfo
  44. - CMAKE_INSTALL_PREFIX=/usr
  45. - CMAKE_FLAGS=-DPREFER_LUA=ON
  46. - DEPS_CMAKE_FLAGS="-DUSE_BUNDLED_LUA=ON -DUSE_BUNDLED_LUAJIT=OFF"
  47. override-build: |
  48. echo "Building on $SNAP_ARCH"
  49. set -x
  50. case "$SNAP_ARCH" in
  51. "arm64" | "ppc64el" | "s390x")
  52. make -j"${SNAPCRAFT_PARALLEL_BUILD_COUNT}" \
  53. CMAKE_BUILD_TYPE=RelWithDebInfo \
  54. CMAKE_INSTALL_PREFIX=/usr \
  55. CMAKE_FLAGS=-DPREFER_LUA=ON \
  56. DEPS_CMAKE_FLAGS="-DUSE_BUNDLED_LUA=ON -DUSE_BUNDLED_LUAJIT=OFF"
  57. ;;
  58. *)
  59. make -j"${SNAPCRAFT_PARALLEL_BUILD_COUNT}" \
  60. CMAKE_BUILD_TYPE=RelWithDebInfo \
  61. CMAKE_INSTALL_PREFIX=/usr
  62. ;;
  63. esac
  64. make DESTDIR="$SNAPCRAFT_PART_INSTALL" install
  65. # Fix Desktop file
  66. sed -i 's|^Exec=nvim|Exec=/snap/bin/nvim.nvim|' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/nvim.desktop
  67. sed -i 's|^TryExec=nvim|TryExec=/snap/bin/nvim.nvim|' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/nvim.desktop
  68. sed -i 's|^Icon=.*|Icon=${SNAP}/usr/share/icons/hicolor/128x128/apps/nvim.png|' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/nvim.desktop
  69. build-packages:
  70. - ninja-build
  71. - libtool
  72. - libtool-bin
  73. - autoconf
  74. - automake
  75. - cmake
  76. - gawk
  77. - g++
  78. - git
  79. - gettext
  80. - pkg-config
  81. - unzip
  82. - wget
  83. prime:
  84. - -usr/share/man