aboutsummaryrefslogtreecommitdiff
path: root/snap/snapcraft.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'snap/snapcraft.yaml')
-rw-r--r--snap/snapcraft.yaml35
1 files changed, 31 insertions, 4 deletions
diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
index da3e74d3e7..57bcb72d5d 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -25,22 +25,47 @@ apps:
parts:
nvim:
- source: .
+ 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)}"
- snapcraftctl set-version "${version_prefix}-${git_described}"
+ 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=Release
+ - 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: |
- snapcraftctl 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
@@ -52,11 +77,13 @@ parts:
- autoconf
- automake
- cmake
+ - gawk
- g++
- git
- gettext
- pkg-config
- unzip
+ - wget
prime:
- -usr/share/man