Files
buildroot/package/vim/vim.mk
Sébastien Szymanski f2919c5dcf package/vim: prevent host-vim from using host's libncurses
When configuring host-vim, the configure script looks for ncurses
without wide character support because of the "--with-tlib=ncurses"
option passed. However, host-ncurses is built with wide character
support (enabled by default on ncurses 6) so host-vim's configure script
fails to find ncurses and falls back on the host ncurses library.

It works fine one some host (i.e Buildroot docker image) but fails one
others (i.e Gentoo) with the following error:

checking for tgetent()... configure: error: NOT FOUND!
      You need to install a terminal library; for example ncurses.
      On Linux that would be the libncurses-dev package.
      Or specify the name of the library with --with-tlib.

On the Buildroot docker image, libncurses.so is a linker script that
contains "INPUT(libncurses.so.6 -ltinfo)". It automatically links
libtinfo (which contains tgetent).

On the Gentoo host, libtinfo is not automatically linked hence the
failure.

Fix this by passing "--with-tlib=ncursesw" option to the host-vim
configure script so it finds and uses libncurses built by Buildroot.

Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2026-11-14 10:42:28 +01:00

87 lines
2.1 KiB
Makefile

################################################################################
#
# vim
#
################################################################################
VIM_VERSION = 9.2.0943
VIM_SITE = $(call github,vim,vim,v$(VIM_VERSION))
VIM_DEPENDENCIES = ncurses $(TARGET_NLS_DEPENDENCIES)
VIM_SUBDIR = src
VIM_CONF_ENV = \
vim_cv_toupper_broken=no \
vim_cv_terminfo=yes \
vim_cv_tgetent=zero \
vim_cv_tty_group=world \
vim_cv_tty_mode=0620 \
vim_cv_getcwd_broken=no \
vim_cv_stat_ignores_slash=yes \
vim_cv_memmove_handles_overlap=yes \
ac_cv_sizeof_int=4 \
ac_cv_small_wchar_t=no
# GUI/X11 headers leak from the host so forcibly disable them
VIM_CONF_OPTS = --with-tlib=ncurses --enable-gui=no --without-x
VIM_LICENSE = Charityware
VIM_LICENSE_FILES = LICENSE README.txt
VIM_CPE_ID_VENDOR = vim
ifeq ($(BR2_PACKAGE_ACL),y)
VIM_CONF_OPTS += --enable-acl
VIM_DEPENDENCIES += acl
else
VIM_CONF_OPTS += --disable-acl
endif
ifeq ($(BR2_PACKAGE_GPM),y)
VIM_CONF_OPTS += --enable-gpm
VIM_DEPENDENCIES += gpm
else
VIM_CONF_OPTS += --disable-gpm
endif
ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
VIM_CONF_OPTS += --enable-selinux
VIM_DEPENDENCIES += libselinux
else
VIM_CONF_OPTS += --disable-selinux
endif
VIM_INSTALL_TARGETS = \
installvimbin installpack \
installtools installlinks
ifeq ($(BR2_PACKAGE_VIM_RUNTIME),y)
VIM_INSTALL_TARGETS += installrtbase installmacros
endif
define VIM_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/src DESTDIR=$(TARGET_DIR) \
$(VIM_INSTALL_TARGETS)
$(RM) -rf $(TARGET_DIR)/usr/share/vim/vim*/doc/
endef
# Avoid oopses with vipw/vigr (from package shadow), lack of $EDITOR,
# or other packages expecting plain 'vi' command to exist.
ifeq ($(BR2_ROOTFS_MERGED_USR),y)
define VIM_INSTALL_VI_SYMLINK
ln -sf vim $(TARGET_DIR)/usr/bin/vi
endef
else
define VIM_INSTALL_VI_SYMLINK
ln -sf ../usr/bin/vim $(TARGET_DIR)/bin/vi
endef
endif
VIM_POST_INSTALL_TARGET_HOOKS += VIM_INSTALL_VI_SYMLINK
HOST_VIM_DEPENDENCIES = host-ncurses
HOST_VIM_CONF_OPTS = \
--with-tlib=ncursesw \
--enable-gui=no \
--without-x \
--disable-acl \
--disable-gpm \
--disable-selinux
$(eval $(autotools-package))
$(eval $(host-autotools-package))