Skip to content

Instantly share code, notes, and snippets.

@bendavis78
Created August 22, 2014 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bendavis78/25b8c9cfba06d18e26fb to your computer and use it in GitHub Desktop.
Save bendavis78/25b8c9cfba06d18e26fb to your computer and use it in GitHub Desktop.
gvim-pythonsix/PKGBUILD
# Maintainer: Thomas Dziedzic <gostrc@gmail.com>
# Contributor: Jan "heftig" Steffens <jan.steffens@gmail.com>
# Contributor: tobias [ tobias at archlinux org ]
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
pkgbase=vim
pkgname=('gvim-pythonsix')
_topver=7.4
_patchlevel=410
__hgrev=4aa63564dd3f
_versiondir="vim${_topver//./}"
pkgver=${_topver}.${_patchlevel}
pkgrel=1
arch=('i686' 'x86_64')
license=('custom:vim')
url="http://www.vim.org"
makedepends=('gpm' 'python2' 'python' 'ruby' 'libxt' 'desktop-file-utils' 'gtk2' 'lua')
source=("ftp://ftp.archlinux.org/other/vim/vim-${pkgver}.tar.xz"
"ftp://ftp.archlinux.org/other/vim/vim-${pkgver}.tar.xz.sig"
'vimrc'
'archlinux.vim'
'gvim.desktop')
md5sums=('8e9722fbd9ddc3c05d21210939c23f23'
'SKIP'
'b9d4dcb9d3ee2e151dc4be1e94934f6a'
'10353a61aadc3f276692d0e17db1478e'
'd90413bd21f400313a785bb4010120cd')
# source PKGBUILD && mksource
mksource() {
[[ -x /usr/bin/hg ]] || (echo "hg not found. Install mercurial." && return 1)
__hgroot='http://vim.googlecode.com/hg/'
__hgrepo='vim'
__hgbranch='default'
hg clone -b ${__hgbranch} -u ${__hgrev} "${__hgroot}${__hgrepo}" ${__hgrepo}
pushd ${__hgrepo}
if (( $(hg id -n) < $(hg id -nr ${__hgbranch}) )); then
printf 'You are not building the latest revision!\n'
printf "Consider updating __hgrev to $(hg id -r ${__hgbranch}).\n"
fi
popd
mv vim ${pkgname}-${pkgver}
find ${pkgname}-${pkgver} -depth -type d -name .hg -exec rm -rf {} \;
rm ${pkgname}-${pkgver}/{.hgignore,.hgtags}
tar -cJf ${pkgname}-${pkgver}.tar.xz ${pkgname}-${pkgver}/*
rm -r ${pkgname}-${pkgver}
gpg --detach-sign ${pkgname}-${pkgver}.tar.xz
scp ${pkgname}-${pkgver}.tar.xz nym:/srv/ftp/other/vim/
scp ${pkgname}-${pkgver}.tar.xz.sig nym:/srv/ftp/other/vim/
}
build() {
cp -a vim-${pkgver} vim-build
# define the place for the global (g)vimrc file (set to /etc/vimrc)
sed -i 's|^.*\(#define SYS_.*VIMRC_FILE.*"\) .*$|\1|' \
vim-build/src/feature.h
sed -i 's|^.*\(#define VIMRC_FILE.*"\) .*$|\1|' \
vim-build/src/feature.h
(cd vim-build/src && autoconf)
cd "${srcdir}"/vim-build
./configure \
--prefix=/usr \
--localstatedir=/var/lib/vim \
--with-features=huge \
--with-compiledby='Arch Linux' \
--enable-gpm \
--enable-acl \
--with-x=yes \
--enable-gui=gtk2 \
--enable-multibyte \
--enable-cscope \
--enable-netbeans \
--enable-perlinterp \
--enable-pythoninterp=yes \
--enable-python3interp=yes \
--enable-rubyinterp \
--enable-luainterp
make
}
check() {
# disable tests because they seem to freeze
cd "${srcdir}"/vim-build
#make test
}
package_gvim-pythonsix() {
pkgdesc='Vi Improved, a highly configurable, improved version of the vi text editor (with advanced features, such as a GUI) with python 3 support'
depends=("vim-runtime=${pkgver}-${pkgrel}" 'gpm' 'ruby' 'libxt'
'desktop-file-utils' 'gtk2' 'lua' 'python')
provides=("vim=${pkgver}-${pkgrel}"
"gvim=${pkgver}-${pkgrel}")
conflicts=('vim' 'gvim' 'gvim-python3')
install=gvim.install
cd "${srcdir}"/vim-build
make -j1 VIMRCLOC=/etc 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
done
# need to remove since this is provided by vim-runtime
rm -rf "${pkgdir}"/usr/share/vim
# freedesktop links
install -Dm644 "${srcdir}"/gvim.desktop \
"${pkgdir}"/usr/share/applications/gvim.desktop
install -Dm644 runtime/vim48x48.png "${pkgdir}"/usr/share/pixmaps/gvim.png
# license
install -Dm644 "${srcdir}"/vim-${pkgver}/runtime/doc/uganda.txt \
"${pkgdir}"/usr/share/licenses/${pkgname}/license.txt
}
# vim:set sw=2 sts=2 et:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment