makedeb


neovim-git 16b0d3ae2022.04.20-2


Vim-fork focused on extensibility and usability

Viewing /PKGBUILD.

View raw.

Click here to go back to the Git tree for neovim-git.

# Maintainer: only_vip <onlyme_vip@protonmail.com>
# Contributor: alfador <contact@havi.dev>
pkgname=neovim-git
_pkgname=neovim
pkgver=16b0d3ae2022.04.20
pkgrel=2
pkgdesc="Vim-fork focused on extensibility and usability"
arch=('i686' 'amd64' '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'
            '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)'
            'wl-clipboard: for clipboard support on wayland (see :help clipboard)')
url="https://neovim.io/"
license=('custom:neovim')
source=("${_pkgname}::git+https://github.com/neovim/neovim.git"
         "sysinit.vim"
         "debian.vim"
)
sha512sums=("SKIP"
            "50cb5a922afc0efee7930c389e73fc3f2704a6deb57c8a11c21bcd32702bd8a22837ed4b7e5eb6c2a1489c2bd4261c57c38c065a5d39583b47f77b74f9490c2f"
            "4f137db93be2d14fb22e6a155335de91ac4627ac8999ebc833f646089670bcbeffc4b074f43f7536a935e2efa8e120fcb4dc571cb232f7ed68de07c2947f50db"
)
provides=('neovim')
conflicts=('neovim')
# replaces=('neovim' 'vim')
options=(!strip)
#post_install=
MAKEFLAGS="-j$(nproc)"

pkgver() {
    cd "${srcdir}/${_pkgname}"
    _always=$(git describe --always | sed -e 's:-:.:g' -e 's:v::') # always is mobile, and switches between numbers and letters, can't use it for versioning
    _commits=$(git rev-list --count HEAD | sed 's:-:.:g') # total commits is the most sane way of getting incremental pkgver
    _date=$(git log -1 --date=short --pretty=format:%cd)
    printf "%s%s%s\n" "${_commits}" "${_always}" "${_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() {
  DESTDIR="${pkgdir}/" make -C "${srcdir}/${_pkgname}" install
  install -Dm644 "${srcdir}/${_pkgname}/LICENSE.txt" "${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"
  install -d "${pkgdir}/usr/share/vim"
  install -Dm644 "sysinit.vim" "${pkgdir}/etc/xdg/nvim/sysinit.vim"
  install -Dm644 "debian.vim" "${pkgdir}/usr/share/nvim/debian.vim"

  #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
}