Skip to content

Instantly share code, notes, and snippets.

@Tosainu
Last active September 13, 2020 09:09
Show Gist options
  • Save Tosainu/b9d2c84b32e2e5bf668d to your computer and use it in GitHub Desktop.
Save Tosainu/b9d2c84b32e2e5bf668d to your computer and use it in GitHub Desktop.
My Vim PKGBUILD.
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Anatol Pomozov <[email protected]>
# Contributor: Thomas Dziedzic <[email protected]>
# Contributor: Jan "heftig" Steffens <[email protected]>
# Contributor: tobias [ tobias at archlinux org ]
# Contributor: Daniel J Griffiths <[email protected]>
# Contributor: Christian Hesse <[email protected]>
# Contributor: Eli Schwartz <[email protected]>
# Customized: Tosainu <[email protected]>
pkgbase=vim
pkgname=('vim-git' 'vim-runtime-git')
pkgver=8.2.0000
_versiondir=82
pkgrel=1
url='http://www.vim.org'
arch=('x86_64')
license=('custom:vim')
makedepends=('gawk' 'git' 'glibc' 'gpm' 'libcanberra' 'libffi' 'libgcrypt'
'libxt' 'lua' 'pcre' 'python' 'zlib')
source=('git+https://github.com/vim/vim.git'
vimdoc.hook)
sha256sums=('SKIP'
'7095cafac21df7aa42749d6864d1c0549fe65771d8edda3102c931c60782b6b9')
sha512sums=('SKIP'
'1e06e981691b17662fd0fddac5c00c87c920d1b4a1cbb6191c42d57cc40b00af12710e26b22fcfc0901bb8142b15f6a04aa65cec2d9b3bb9d5a06cb650d3ab9c')
pkgver() {
cd "${srcdir}"/vim
git describe --long --tags | sed 's/v\(.*\)/\1/;s/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare() {
cd "${srcdir}"/vim/src
autoconf
}
build() {
cd "${srcdir}"/vim
./configure \
--prefix=/usr \
--localstatedir=/var/lib/vim \
--with-compiledby=Tosainu \
--with-features=huge \
--with-x \
--disable-gui \
--disable-netbeans \
--enable-autoservername \
--enable-fail-if-missing \
--enable-multibyte \
--enable-luainterp=dynamic \
--enable-perlinterp=dynamic \
--enable-python3interp=dynamic
make
}
check() {
cd "${srcdir}"/vim
TERM=xterm make -j1 test
}
package_vim-git() {
pkgdesc='Vi Improved, a highly configurable, improved version of the vi text editor'
depends=("vim-runtime-git=${pkgver}-${pkgrel}" 'acl' 'glibc' 'gpm'
'libcanberra' 'libffi' 'libgcrypt' 'libxt' 'pcre' 'zlib')
optdepends=('lua: Lua language support'
'perl: Perl language support'
'python: Python 3 language support')
conflicts=('gvim' 'vim')
provides=('vim' 'xxd')
cd "${srcdir}"/vim
make -j1 DESTDIR="${pkgdir}" install
# provided by (n)vi in core
rm "${pkgdir}"/usr/bin/{ex,view}
# delete some manpages
find "${pkgdir}"/usr/share/man -type d -name 'man1' 2>/dev/null | \
while read _mandir; do
cd ${_mandir}
rm -f ex.1 view.1 # provided by (n)vi
rm -f evim.1 # this does not make sense if we have no GUI
done
# Runtime provided by runtime package
rm -r "${pkgdir}"/usr/share/vim
# remove gvim.desktop as not included
rm "${pkgdir}"/usr/share/applications/gvim.desktop
# license
install -Dm644 runtime/doc/uganda.txt \
"${pkgdir}"/usr/share/licenses/${pkgname}/license.txt
}
package_vim-runtime-git() {
pkgdesc+=' (shared runtime)'
optdepends=('sh: support for some tools and macros'
'python: demoserver example tool'
'gawk: mve tools upport')
conflicts=('vim-runtime')
provides=('vim-runtime')
cd "${srcdir}"/vim
make -j1 DESTDIR="${pkgdir}" install
# no executable files, desktop files, icons, and man
rm -r "${pkgdir}"/usr/bin/ "${pkgdir}"/usr/share/{applications,icons,man}
# license
install -dm755 "${pkgdir}"/usr/share/licenses/vim-runtime
ln -s /usr/share/vim/vim${_versiondir}/doc/uganda.txt \
"${pkgdir}"/usr/share/licenses/vim-runtime/license.txt
# pacman hook for documentation helptags
install -Dm 644 "${srcdir}"/vimdoc.hook "${pkgdir}"/usr/share/libalpm/hooks/vimdoc.hook
}
# vim:set sw=2 sts=2 et:
[Trigger]
Operation = Install
Operation = Upgrade
Operation= Remove
Type = File
Target = usr/share/vim/vimfiles/doc/
[Action]
Description = Updating Vim help tags...
Exec = /usr/bin/vim -es --cmd ":helptags /usr/share/vim/vimfiles/doc" --cmd ":q"
When = PostTransaction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment