void-packages/srcpkgs/vim/template

215 lines
5.9 KiB
Bash

# Template file for 'vim'
pkgname=vim
version=9.0.1903
revision=3
create_wrksrc=required
hostmakedepends="gettext glib-devel pkg-config"
makedepends="acl-devel ncurses-devel
$(vopt_if x11 libXt-devel)
$(vopt_if gtk3 gtk+3-devel)
$(vopt_if huge 'lua53-devel perl python3-devel ruby-devel')"
depends="vim-common>=${version}"
checkdepends="libtool ncurses-base"
short_desc="Vim editor (vi clone)"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="Vim"
homepage="https://www.vim.org"
distfiles="https://github.com/vim/vim/archive/v${version}.tar.gz"
checksum=ba769f8513f2f75d71518f817f945809a5cb1310fd58cd86daca96e658cccf7d
python_version=3
build_options="x11 gtk3 huge"
desc_option_huge="Enable support for many language interpreters"
build_options_default="x11 gtk3"
# XXX vim-huge cannot be cross compiled for now.
if [ -z "$CROSS_BUILD" ]; then
build_options_default+=" huge"
fi
subpackages="xxd vim-common $(vopt_if x11 vim-x11) $(vopt_if gtk3 gvim)
$(vopt_if huge "vim-huge vim-huge-python3 $(vopt_if gtk3 gvim-huge)")"
_subdirs="$(vopt_if x11 vim-x11) $(vopt_if gtk3 gvim)
$(vopt_if huge "vim-huge $(vopt_if gtk3 gvim-huge)")"
alternatives="vim:vim:/usr/bin/vim-normal"
pre_configure() {
local f
for f in vim-normal ${_subdirs}; do
rm -rf ${f}
cp -r vim-${version} ${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-netbeans --disable-gpm"
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/vim-normal
./configure ${configure_args} ${args} ${nohuge_args} --disable-xim --enable-gui=no --with-x=no
# X11 version.
if [ "$build_option_x11" ]; then
cd $wrksrc/vim-x11
./configure ${configure_args} ${args} ${nohuge_args} --enable-gui=no --with-x
fi
# GTK+ version.
if [ "$build_option_gtk3" ]; then
cd $wrksrc/gvim
./configure ${configure_args} ${args} ${nohuge_args} --enable-gui=gtk3 --with-x --with-vim-name=gvim
fi
# Huge versions
if [ "$build_option_huge" ]; then
cd $wrksrc/vim-huge
./configure ${configure_args} ${args} --with-x=yes --enable-gui=no \
--with-features=huge --enable-perlinterp --enable-python3interp \
--enable-rubyinterp --enable-luainterp --enable-terminal \
--with-python3-stable-abi=3.12
if [ "$build_option_gtk3" ]; then
cd $wrksrc/gvim-huge
./configure ${configure_args} ${args} \
--enable-gui=gtk3 --with-x \
--with-vim-name=gvim-huge --with-features=huge \
--enable-perlinterp --enable-python3interp \
--enable-rubyinterp --enable-luainterp \
--enable-terminal --with-python3-stable-abi=3.12
fi
fi
}
do_build() {
for f in vim-normal ${_subdirs}; do
cd $wrksrc/$f
make ${makejobs}
done
}
do_check() {
cd $wrksrc/vim-normal
TERM=xterm make test
}
do_install() {
cd $wrksrc/vim-normal
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
if [ "$build_option_gtk3" ]; then
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
fi
}
vim-common_package() {
short_desc+=" - common files"
depends="xxd"
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="python3 vim-common-${version}_${revision} desktop-file-utils hicolor-icon-theme"
provides="vim-${version}_${revision}"
short_desc+=" - GTK+ GUI - Huge (all features enabled)"
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="python3 vim-common-${version}_${revision}"
short_desc+=" - Huge (all features enabled)"
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="vim-huge"
short_desc+=" - transitional package"
build_style=meta
}
xxd_package() {
short_desc="Make a hexdump or do the reverse"
pkg_install() {
vmove usr/bin/xxd
vmove usr/share/man/man1/xxd.1
}
}