kumquat-buildroot/package/vim/vim.mk
Thomas Petazzoni f7a07f42f7 vim: be more careful when removing the documentation
The current VIM_REMOVE_DOCS hook removes all .txt files from
/usr/share/vim. Unfortunately, this also removes the rgb.txt file,
which is needed at runtime for vim, as reported in bug #9466.

This commit changes VIM_REMOVE_DOCS to remove only
/usr/share/vim/vim*/doc/. Size-wise, it's equivalent because:

 - We are no longer removing a few README.txt in other directories,
   taking more space.

 - We are now removing the /usr/share/vim/vim*/doc/ folder entirely,
   which contained a few files not named *.txt

So overall, the size of /usr/share/vim/ before and after this patch is
still 11MB.

Fixes bug #9466.

Reported-by: Mateusz Furdyna <sir.ferdek@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-12-05 22:55:36 +01:00

79 lines
2.1 KiB
Makefile

################################################################################
#
# vim
#
################################################################################
VIM_VERSION = v8.0.0001
VIM_SITE = $(call github,vim,vim,$(VIM_VERSION))
# Win over busybox vi since vim is more feature-rich
VIM_DEPENDENCIES = \
ncurses $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext) \
$(if $(BR2_PACKAGE_BUSYBOX),busybox)
VIM_SUBDIR = src
VIM_CONF_ENV = \
vim_cv_toupper_broken=no \
vim_cv_terminfo=yes \
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 = README.txt
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
define VIM_INSTALL_TARGET_CMDS
cd $(@D)/src; \
$(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(TARGET_DIR) installvimbin; \
$(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(TARGET_DIR) installtools; \
$(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(TARGET_DIR) installlinks
endef
define VIM_INSTALL_RUNTIME_CMDS
cd $(@D)/src; \
$(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(TARGET_DIR) installrtbase; \
$(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(TARGET_DIR) installmacros
endef
define VIM_REMOVE_DOCS
$(RM) -rf $(TARGET_DIR)/usr/share/vim/vim*/doc/
endef
# Avoid oopses with vipw/vigr, lack of $EDITOR and 'vi' command expectation
define VIM_INSTALL_VI_SYMLINK
ln -sf /usr/bin/vim $(TARGET_DIR)/bin/vi
endef
VIM_POST_INSTALL_TARGET_HOOKS += VIM_INSTALL_VI_SYMLINK
ifeq ($(BR2_PACKAGE_VIM_RUNTIME),y)
VIM_POST_INSTALL_TARGET_HOOKS += VIM_INSTALL_RUNTIME_CMDS
VIM_POST_INSTALL_TARGET_HOOKS += VIM_REMOVE_DOCS
endif
$(eval $(autotools-package))