203 lines
5.8 KiB
Bash
203 lines
5.8 KiB
Bash
# Template file for 'vim'
|
|
pkgname=vim
|
|
version=8.1.2291
|
|
revision=1
|
|
hostmakedepends="glib-devel pkg-config"
|
|
makedepends="acl-devel gtk+3-devel libXt-devel lua-devel ncurses-devel
|
|
perl python-devel python3-devel ruby-devel"
|
|
depends="vim-common>=${version}"
|
|
short_desc="Vim editor (vi clone)"
|
|
maintainer="Nathan Owens <ndowens04@gmail.com>"
|
|
license="Vim"
|
|
homepage="https://www.vim.org"
|
|
distfiles="https://github.com/vim/vim/archive/v${version}.tar.gz"
|
|
checksum=fa8b7e9e8ff428d7fcbdb05a0d4b4a31f173194f08872d78a74b6b4c9d894c51
|
|
|
|
subpackages="xxd vim-common vim-x11 gvim"
|
|
# XXX vim-huge cannot be cross compiled for now.
|
|
if [ -z "$CROSS_BUILD" ]; then
|
|
subpackages+=" vim-huge vim-huge-python3 gvim-huge"
|
|
fi
|
|
|
|
alternatives="vim:vim:/usr/bin/vim-normal"
|
|
|
|
pre_configure() {
|
|
for f in ${subpackages/xxd vim-common/}; do
|
|
mkdir -p /tmp/${f}
|
|
cp -a $wrksrc/* /tmp/${f}
|
|
mv /tmp/${f} $wrksrc/${f}
|
|
done
|
|
}
|
|
|
|
do_configure() {
|
|
args="--enable-cscope --enable-multibyte --with-tlib=ncursesw
|
|
--with-ex-name=vim-ex --with-view-name=vim-view"
|
|
|
|
nohuge_args="--disable-perlinterp --disable-pythoninterp
|
|
--disable-rubyinterp --disable-workshop
|
|
--disable-netbeans --disable-gpm
|
|
--disable-hangulinput"
|
|
|
|
if [ "$CROSS_BUILD" ]; then
|
|
configure_args+="
|
|
--host=${XBPS_CROSS_TRIPLET}
|
|
vim_cv_toupper_broken=no vim_cv_terminfo=yes
|
|
vim_cv_tty_group=world vim_cv_getcwd_broken=no
|
|
vim_cv_stat_ignores_slash=yes
|
|
vim_cv_memmove_handles_overlap=yes
|
|
vim_cv_tgetent=zero
|
|
ac_cv_small_wchar_t=no"
|
|
fi
|
|
|
|
# Normal version.
|
|
cd $wrksrc
|
|
./configure ${configure_args} ${args} ${nohuge_args} --disable-xim --enable-gui=no --with-x=no
|
|
|
|
# X11 version.
|
|
cd $wrksrc/vim-x11
|
|
./configure ${configure_args} ${args} ${nohuge_args} --enable-gui=no --with-x
|
|
|
|
# GTK+ version.
|
|
cd $wrksrc/gvim
|
|
./configure ${configure_args} ${args} ${nohuge_args} --enable-gui=gtk3 --with-x --with-vim-name=gvim
|
|
|
|
# Huge versions
|
|
if [ -z "$CROSS_BUILD" ]; then
|
|
cd $wrksrc/vim-huge
|
|
./configure ${configure_args} ${args} --with-x=yes --enable-gui=no \
|
|
--with-features=huge --enable-perlinterp --enable-pythoninterp \
|
|
--enable-rubyinterp --enable-luainterp --enable-terminal
|
|
|
|
cd $wrksrc/vim-huge-python3
|
|
./configure ${configure_args} ${args} --with-x=yes --enable-gui=no \
|
|
--with-features=huge --enable-perlinterp \
|
|
--disable-pythoninterp --enable-python3interp \
|
|
--enable-rubyinterp --enable-luainterp \
|
|
--enable-terminal
|
|
|
|
cd $wrksrc/gvim-huge
|
|
./configure ${configure_args} ${args} \
|
|
--enable-gui=gtk3 --with-x --with-vim-name=gvim-huge \
|
|
--with-features=huge --enable-perlinterp --enable-pythoninterp \
|
|
--enable-rubyinterp --enable-luainterp --enable-terminal
|
|
fi
|
|
}
|
|
|
|
do_build() {
|
|
cd $wrksrc
|
|
make ${makejobs}
|
|
|
|
for f in ${subpackages/xxd vim-common/}; do
|
|
cd $wrksrc/$f
|
|
make ${makejobs}
|
|
done
|
|
|
|
}
|
|
|
|
do_install() {
|
|
make DESTDIR=$DESTDIR install
|
|
vlicense runtime/doc/uganda.txt LICENSE
|
|
|
|
mv ${DESTDIR}/usr/bin/vim ${DESTDIR}/usr/bin/vim-normal
|
|
|
|
# Create vim-ex symlink.
|
|
cd ${DESTDIR}/usr/bin
|
|
ln -sf vim vim-ex
|
|
rm -f ${DESTDIR}/usr/bin/{ex,view}
|
|
|
|
# install gvim icons
|
|
cd ${wrksrc}/gvim
|
|
sed -i "s|/locolor|/hicolor|g" src/Makefile
|
|
for d in 16 32 48; do
|
|
vmkdir usr/share/icons/hicolor/${d}x${d}/apps
|
|
done
|
|
make -C src DESTDIR=${DESTDIR} install-icons
|
|
rm -rf $DESTDIR/usr/share/applications
|
|
}
|
|
|
|
vim-common_package() {
|
|
short_desc+=" - common files"
|
|
depends="xxd"
|
|
archs=noarch
|
|
alternatives="
|
|
vi:ex:/usr/bin/vim
|
|
vi:ex.1:/usr/share/man/man1/vim.1
|
|
vi:vi:/usr/bin/vim
|
|
vi:vi.1:/usr/share/man/man1/vim.1
|
|
vi:view:/usr/bin/vim
|
|
vi:view.1:/usr/share/man/man1/vim.1
|
|
"
|
|
pkg_install() {
|
|
vmove usr/share/icons
|
|
vmove usr/bin/rvim
|
|
vmove usr/bin/vim-ex
|
|
vmove usr/bin/vimdiff
|
|
vmove usr/bin/vimtutor
|
|
vmove usr/bin/*view
|
|
vmove "usr/share/man/man1/*vim*"
|
|
vmove usr/share/licenses
|
|
vmove usr/share/vim
|
|
vinstall ${FILESDIR}/vimrc 644 usr/share/vim
|
|
}
|
|
}
|
|
vim-x11_package() {
|
|
depends="vim-common-${version}_${revision}"
|
|
provides="vim-${version}_${revision}"
|
|
short_desc+=" - with access to X11 selection"
|
|
alternatives="vim:vim:/usr/bin/vim-x11"
|
|
pkg_install() {
|
|
vbin $wrksrc/vim-x11/src/vim vim-x11
|
|
}
|
|
}
|
|
gvim_package() {
|
|
depends="vim-common-${version}_${revision} desktop-file-utils hicolor-icon-theme"
|
|
provides="vim-${version}_${revision}"
|
|
short_desc+=" - GTK+ GUI"
|
|
alternatives="vim:vim:/usr/bin/gvim"
|
|
pkg_install() {
|
|
cd $wrksrc/gvim
|
|
make -C src DESTDIR=${PKGDESTDIR} installvimbin install-icons
|
|
rm -f ${PKGDESTDIR}/usr/share/applications/vim.desktop
|
|
rm -rf ${PKGDESTDIR}/usr/share/icons
|
|
}
|
|
}
|
|
gvim-huge_package() {
|
|
depends="python vim-common-${version}_${revision} desktop-file-utils hicolor-icon-theme"
|
|
provides="vim-${version}_${revision}"
|
|
short_desc+=" - GTK+ GUI - Huge (all features enabled, using Python 2)"
|
|
alternatives="vim:vim:/usr/bin/gvim-huge"
|
|
pkg_install() {
|
|
cd $wrksrc/gvim-huge
|
|
make -C src DESTDIR=${PKGDESTDIR} installvimbin install-icons
|
|
rm -f ${PKGDESTDIR}/usr/share/applications/vim.desktop
|
|
mv ${PKGDESTDIR}/usr/share/applications/{gvim,gvim-huge}.desktop
|
|
vsed -i 's,Exec=gvim,Exec=gvim-huge,g' ${PKGDESTDIR}/usr/share/applications/gvim-huge.desktop
|
|
rm -rf ${PKGDESTDIR}/usr/share/icons
|
|
}
|
|
}
|
|
vim-huge_package() {
|
|
depends="python vim-common-${version}_${revision}"
|
|
short_desc+=" - Huge (all features enabled, using Python 2)"
|
|
provides="vim-${version}_${revision}"
|
|
alternatives="vim:vim:/usr/bin/vim-huge"
|
|
pkg_install() {
|
|
vbin $wrksrc/vim-huge/src/vim vim-huge
|
|
}
|
|
}
|
|
vim-huge-python3_package() {
|
|
depends="python3 vim-common-${version}_${revision}"
|
|
short_desc+=" - Huge (all features enabled, using Python 3)"
|
|
provides="vim-${version}_${revision}"
|
|
alternatives="vim:vim:/usr/bin/vim-huge-python3"
|
|
pkg_install() {
|
|
vbin $wrksrc/vim-huge-python3/src/vim vim-huge-python3
|
|
}
|
|
}
|
|
xxd_package() {
|
|
short_desc="Make a hexdump or do the reverse"
|
|
pkg_install() {
|
|
vmove usr/bin/xxd
|
|
vmove usr/share/man/man1/xxd.1
|
|
}
|
|
}
|