xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-support/vim/vim.inc (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1SUMMARY = "Vi IMproved - enhanced vi editor"
2DESCRIPTION = "Vim is a greatly improved version of the good old UNIX editor Vi. Many new features have been added: multi-level undo, syntax highlighting, command line history, on-line help, spell checking, filename completion, block operations, script language, etc. There is also a Graphical User Interface (GUI) available."
3SECTION = "console/utils"
4
5HOMEPAGE = "https://www.vim.org/"
6BUGTRACKER = "https://github.com/vim/vim/issues"
7
8DEPENDS = "ncurses gettext-native"
9# vimdiff doesn't like busybox diff
10RSUGGESTS:${PN} = "diffutils"
11
12LICENSE = "Vim"
13LIC_FILES_CHKSUM = "file://LICENSE;md5=6b30ea4fa660c483b619924bc709ef99"
14
15SRC_URI = "git://github.com/vim/vim.git;branch=master;protocol=https \
16           file://disable_acl_header_check.patch \
17           file://vim-add-knob-whether-elf.h-are-checked.patch \
18           file://0001-src-Makefile-improve-reproducibility.patch \
19           file://no-path-adjust.patch \
20           "
21
22PV .= ".1429"
23SRCREV = "1a08a3e2a584889f19b84a27672134649b73da58"
24
25# Remove when 8.3 is out
26UPSTREAM_VERSION_UNKNOWN = "1"
27
28# Do not consider .z in x.y.z, as that is updated with every commit
29UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+)\.0"
30
31S = "${WORKDIR}/git"
32
33VIMDIR = "vim${@d.getVar('PV').split('.')[0]}${@d.getVar('PV').split('.')[1]}"
34
35inherit autotools-brokensep update-alternatives mime-xdg pkgconfig
36
37CLEANBROKEN = "1"
38
39# vim configure.in contains functions which got 'dropped' by autotools.bbclass
40do_configure () {
41    cd src
42    rm -f auto/*
43    touch auto/config.mk
44    aclocal
45    autoconf
46    cd ..
47    oe_runconf
48    touch src/auto/configure
49    touch src/auto/config.mk src/auto/config.h
50}
51
52do_compile() {
53    # We do not support fully / correctly the following locales.  Attempting
54    # to use these with msgfmt in order to update the ".desktop" files exposes
55    # this problem and leads to the compile failing.
56    for LOCALE in cs fr ko pl sk zh_CN zh_TW;do
57        echo -n > src/po/${LOCALE}.po
58    done
59    autotools_do_compile
60}
61
62PACKAGECONFIG ??= "\
63    ${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)} \
64    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 gtkgui', '', d)} \
65    nls \
66"
67
68PACKAGECONFIG[gtkgui] = "--enable-gui=gtk3,--enable-gui=no,gtk+3"
69PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
70PACKAGECONFIG[x11] = "--with-x,--without-x,xt,"
71PACKAGECONFIG[tiny] = "--with-features=tiny,--with-features=big,,"
72PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,"
73PACKAGECONFIG[elfutils] = "--enable-elf-check,,elfutils,"
74PACKAGECONFIG[nls] = "--enable-nls,--disable-nls,,"
75PACKAGECONFIG[sound] = "--enable-canberra,--disable-canberra,canberra,"
76
77EXTRA_OECONF = " \
78    --disable-gpm \
79    --disable-gtktest \
80    --disable-xim \
81    --disable-netbeans \
82    --disable-desktop-database-update \
83    --with-tlib=ncurses \
84    --with-modified-by='${MAINTAINER}' \
85    ac_cv_small_wchar_t=no \
86    ac_cv_path_GLIB_COMPILE_RESOURCES=no \
87    vim_cv_getcwd_broken=no \
88    vim_cv_memmove_handles_overlap=yes \
89    vim_cv_stat_ignores_slash=no \
90    vim_cv_terminfo=yes \
91    vim_cv_tgetent=non-zero \
92    vim_cv_toupper_broken=no \
93    vim_cv_tty_group=world \
94    STRIP=/bin/true \
95"
96
97# Some host distros don't have it, disable consistently
98EXTRA_OECONF:append:class-native = " vim_cv_timer_create=no"
99EXTRA_OECONF:append:class-target = " vim_cv_timer_create=yes"
100
101do_install() {
102    autotools_do_install
103
104    # Work around file-rdeps picking up csh, awk, perl or python as a dep
105    chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/vim132
106    chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/mve.awk
107    chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/*.pl
108    chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/*.py
109
110    # Install example vimrc from runtime files
111    install -m 0644 runtime/vimrc_example.vim ${D}/${datadir}/${BPN}/vimrc
112
113    # we use --with-features=big as default
114    mv ${D}${bindir}/${BPN} ${D}${bindir}/${BPN}.${BPN}
115
116    if ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'true', 'false', d)}; then
117	# The mouse being autoenabled is just annoying in xfce4-terminal (mouse
118	# drag make vim go into visual mode and there is no right click menu),
119	# delete the block.
120	sed -i '/the mouse works just fine/,+4d' ${D}/${datadir}/${BPN}/vimrc
121    fi
122}
123
124PARALLEL_MAKEINST = ""
125
126PACKAGES =+ "${PN}-common ${PN}-syntax ${PN}-help ${PN}-tutor ${PN}-vimrc ${PN}-tools"
127FILES:${PN}-syntax = "${datadir}/${BPN}/${VIMDIR}/syntax"
128FILES:${PN}-help = "${datadir}/${BPN}/${VIMDIR}/doc"
129FILES:${PN}-tutor = "${datadir}/${BPN}/${VIMDIR}/tutor ${bindir}/${BPN}tutor"
130FILES:${PN}-vimrc = "${datadir}/${BPN}/vimrc"
131FILES:${PN}-data = "${datadir}/${BPN}"
132
133# We do not want to complain if perl or gawk are not on the target.
134#
135FILES:${PN}-tools = "${datadir}/${BPN}/${VIMDIR}/tools"
136INSANE_SKIP:${PN}-tools = "file-rdeps"
137
138FILES:${PN}-common = " \
139    ${datadir}/${BPN}/${VIMDIR}/*.vim \
140    ${datadir}/${BPN}/${VIMDIR}/autoload \
141    ${datadir}/${BPN}/${VIMDIR}/colors \
142    ${datadir}/${BPN}/${VIMDIR}/compiler \
143    ${datadir}/${BPN}/${VIMDIR}/ftplugin \
144    ${datadir}/${BPN}/${VIMDIR}/indent \
145    ${datadir}/${BPN}/${VIMDIR}/keymap \
146    ${datadir}/${BPN}/${VIMDIR}/lang \
147    ${datadir}/${BPN}/${VIMDIR}/macros \
148    ${datadir}/${BPN}/${VIMDIR}/plugin \
149    ${datadir}/${BPN}/${VIMDIR}/print \
150    ${datadir}/${BPN}/${VIMDIR}/spell \
151    ${datadir}/icons \
152"
153
154ALTERNATIVE:${PN} = "vi vim"
155ALTERNATIVE_PRIORITY = "100"
156ALTERNATIVE_TARGET = "${bindir}/${BPN}.${BPN}"
157ALTERNATIVE_LINK_NAME[vi] = "${base_bindir}/vi"
158ALTERNATIVE_LINK_NAME[vim] = "${bindir}/vim"
159