makedeb


neovim-git 16b0d3ae2022.04.20-2


Vim-fork focused on extensibility and usability

Click here to go back to the commit logs for neovim-git.

Commit:


Hash: 384c9e1f373634edf959450f8dc58a81abf710ee

Message: feat: Makefile,`Release` build and other minor changes - Added a Makefile with common targets to build/install pakage with `makedeb`. - Add .gitignore file - added `prepare()` : helps with cleaning up build directory, in case - splitted `package()` into `build()` and `package()` functions: - `build()` : Builds neovim with `RELEASE` optimizations. It supports cross-compilation for `arm64` architectures - `release()` : added some extra files such as a desktop icon. - `check()`: ensures the build was successful and neovim is able to run without any runtime bugs

Diff


diff --git a/.SRCINFO b/.SRCINFO
index 47ea521..1a55471 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -2,7 +2,7 @@ generated-by = makedeb-makepkg
 
 pkgbase = neovim-git
 	pkgdesc = Vim-fork focused on extensibility and usability
-	pkgver = 19130nightly.12.g655e489e92021.10.04
+	pkgver = 19846nightly.5.ga5eadbaf32022.01.01
 	pkgrel = 1
 	url = https://neovim.io/
 	arch = i686
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5dfc70b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+*
+!.gitignore
+!PKGBUILD
+!.SRCINFO
+!*.install
+!Makefile
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..5c8a26e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,26 @@
+# vim: filetype=make syntax=make textwidth=0 softtabstop=0 tabstop=4 shiftwidth=4 fileencoding=utf-8 fileformat=unix smartindent autoindent noexpandtab
+#  ────────────────────────────────────────────────────────────────────
+.PHONY: $(shell egrep -o '^[a-zA-Z_-]+:' $(MAKEFILE_LIST) | sed 's/://')
+.SILENT: $(shell egrep -o '^[a-zA-Z_-]+:' $(MAKEFILE_LIST) | sed 's/://')
+.PHONY: all
+all: help
+#  ────────────────────────────────────────────────────────────────────
+help: ## Show this help
+	@printf "$$(fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v 'fgrep' | sed -e 's/\\$$//' | sed -e 's/\s.*##//')\n"
+
+clean:
+	rm -rf neovim src pkg *.deb *.tar.gz
+
+srcinfo: ## Generate srcinfo
+	makedeb --printsrcinfo > .SRCINFO
+
+--apt-update:
+	sudo apt-get update
+
+makedeb: ## Build the package while syncing dependencies
+	makedeb -s --no-confirm
+
+install: ## Installs the package
+	makedeb --install --no-confirm
+
+build: --apt-update srcinfo makedeb ## Main target for building a fresh package
\ No newline at end of file
diff --git a/PKGBUILD b/PKGBUILD
index 012d988..da7c3af 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,13 +1,14 @@
 # Maintainer: only_vip <onlyme_vip@protonmail.com>
+# Contributor: alfador <contact@havi.dev>
 pkgname=neovim-git
 _pkgname=neovim
-pkgver=19130nightly.12.g655e489e92021.10.04
+pkgver=19846nightly.5.ga5eadbaf32022.01.01
 pkgrel=1
 pkgdesc="Vim-fork focused on extensibility and usability"
 arch=('i686' 'x86_64' 'armv7h' 'armv6h' 'aarch64')
 depends=('libluajit-5.1-2' 'libluajit-5.1-common' 'libmsgpackc2' 'libtermkey1' 'libunibilium4' 'libvterm0' 'lua-luv')
 makedepends=('ninja-build' 'gettext' 'libtool' 'libtool-bin' 'autoconf' 'automake' 'cmake' 'g++' 'pkg-config' 'unzip' 'curl' 'lua-filesystem' 'lua-cliargs' 'lua-system' 'lua-dkjson' 'lua-say' 'lua-luassert' 'lua-term' 'lua-mediator' 'lua-argparse' 'lua-coxpcall')
-optdepends=('python3-neovim: for python 3 plugin support see :help provider python' 
+optdepends=('python3-neovim: for python 3 plugin support see :help provider python'
             'ruby-neovim: for Ruby plugin support (see :help provider-ruby)'
             'xclip: for clipboard support (or xsel) (see :help provider-clipboard)'
             'xsel: for clipboard support (or xclip) (see :help provider-clipboard)'
@@ -30,11 +31,32 @@ pkgver() {
     _date=$(git log -1 --date=short --pretty=format:%cd)
     printf "%s%s%s\n" "${_commits}" "${_tag}" "${_date}" | sed -e 's:-:.:g'  -e 's:_:.:g'
 }
-
+prepare() {
+  rm -rf \
+    "${srcdir}/${_pkgname}/build" \
+    "${srcdir}/${_pkgname}/.builds" \
+    "${srcdir}/${_pkgname}/.deps"
+}
+build() {
+  CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=/usr"
+  [ "${CARCH}" == "aarch64" ] && CMAKE_EXTRA_FLAGS="${CMAKE_EXTRA_FLAGS} -DENABLE_JEMALLOC=FALSE"
+  CMAKE_BUILD_TYPE="Release"
+  CMAKE_EXTRA_FLAGS="${CMAKE_EXTRA_FLAGS}" \
+    CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
+    make -C "${srcdir}/${_pkgname}" -j"$(nproc)"
+}
+check() {
+  "${srcdir}/${_pkgname}/build/bin/nvim" --version
+  "${srcdir}/${_pkgname}/build/bin/nvim" --headless -u NONE -i NONE -c ":quit"
+}
 package() {
-  cd ${srcdir}/${_pkgname}/
-  make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=${pkgdir}/usr"
-  make install
-  cd "${srcdir}/${_pkgname}"
-  install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
+  DESTDIR="${pkgdir}/" make -C "${srcdir}/${_pkgname}" install
+  install -Dm644 "${srcdir}/${_pkgname}/LICENSE" "${pkgdir}/usr/share/doc/${_pkgname}/copyright"
+  install -Dm644 "${srcdir}/${_pkgname}/runtime/nvim.desktop" "${pkgdir}/usr/share/applications/nvim.desktop"
+  install -Dm644 "${srcdir}/${_pkgname}/runtime/nvim.png" "${pkgdir}/usr/share/pixmaps/nvim.png"
+  mkdir -p "${pkgdir}/etc/xdg/nvim"
+  mkdir -p "${pkgdir}/usr/share/vim"
+  echo '" This commented line makes apt-installed global vim packages work.' | tee "${pkgdir}/etc/xdg/nvim/sysinit.vim" >/dev/null
+  echo "set runtimepath+=/usr/share/vim/vimfiles" | tee "${pkgdir}/usr/share/nvim/debian.vim" >/dev/null
+  echo "source /usr/share/nvim/debian.vim" | tee -a "${pkgdir}/etc/xdg/nvim/sysinit.vim" >/dev/null
 }