blob: 0a31e68cb7ccd86034365107a317beaf2060f16d [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001SUMMARY = "Vi IMproved - enhanced vi editor"
2SECTION = "console/utils"
3
Brad Bishopc342db32019-05-15 21:57:59 -04004DEPENDS = "ncurses gettext-native"
5# vimdiff doesn't like busybox diff
6RSUGGESTS_${PN} = "diffutils"
7LICENSE = "vim"
8LIC_FILES_CHKSUM = "file://runtime/doc/uganda.txt;endline=287;md5=f1f82b42360005c70b8c19b0ef493f72"
9
10SRC_URI = "git://github.com/vim/vim.git \
11 file://disable_acl_header_check.patch \
12 file://vim-add-knob-whether-elf.h-are-checked.patch \
13 file://0001-src-Makefile-improve-reproducibility.patch \
14"
Brad Bishop15ae2502019-06-18 21:44:24 -040015SRCREV = "202d982b36d87cf91d992bd7e30d3223bdc72cd9"
Brad Bishopc342db32019-05-15 21:57:59 -040016
17S = "${WORKDIR}/git"
18
19VIMDIR = "vim${@d.getVar('PV').split('.')[0]}${@d.getVar('PV').split('.')[1]}"
20
21inherit autotools-brokensep update-alternatives
22
23CLEANBROKEN = "1"
24
25# vim configure.in contains functions which got 'dropped' by autotools.bbclass
26do_configure () {
27 cd src
28 rm -f auto/*
29 touch auto/config.mk
30 aclocal
31 autoconf
32 cd ..
33 oe_runconf
34 touch src/auto/configure
35 touch src/auto/config.mk src/auto/config.h
36}
37
38do_compile() {
39 # We do not support fully / correctly the following locales. Attempting
40 # to use these with msgfmt in order to update the ".desktop" files exposes
41 # this problem and leads to the compile failing.
42 for LOCALE in cs fr ko pl sk zh_CN zh_TW;do
43 echo -n > src/po/${LOCALE}.po
44 done
45 autotools_do_compile
46}
47
48#Available PACKAGECONFIG options are gtkgui, acl, x11, tiny
49PACKAGECONFIG ??= ""
50PACKAGECONFIG += " \
51 ${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)} \
52 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 gtkgui', '', d)} \
53"
Brad Bishopc342db32019-05-15 21:57:59 -040054
Brad Bishop15ae2502019-06-18 21:44:24 -040055PACKAGECONFIG[gtkgui] = "--enable-gui=gtk3,--enable-gui=no,gtk+3"
Brad Bishopc342db32019-05-15 21:57:59 -040056PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
57PACKAGECONFIG[x11] = "--with-x,--without-x,xt,"
58PACKAGECONFIG[tiny] = "--with-features=tiny,--with-features=big,,"
59PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,"
60PACKAGECONFIG[elfutils] = "--enable-elf-check,,elfutils,"
61
62EXTRA_OECONF = " \
63 --disable-gpm \
64 --disable-gtktest \
65 --disable-xim \
66 --disable-netbeans \
67 --with-tlib=ncurses \
68 ac_cv_small_wchar_t=no \
69 vim_cv_getcwd_broken=no \
70 vim_cv_memmove_handles_overlap=yes \
71 vim_cv_stat_ignores_slash=no \
72 vim_cv_terminfo=yes \
73 vim_cv_tgetent=non-zero \
74 vim_cv_toupper_broken=no \
75 vim_cv_tty_group=world \
76 STRIP=/bin/true \
77"
78
79do_install() {
80 autotools_do_install
81
82 # Work around file-rdeps picking up csh, awk, perl or python as a dep
83 chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/vim132
84 chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/mve.awk
85 chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/*.pl
86 chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/*.py
87
88 # Install example vimrc from runtime files
89 install -m 0644 runtime/vimrc_example.vim ${D}/${datadir}/${BPN}/vimrc
90
91 # we use --with-features=big as default
92 mv ${D}${bindir}/${BPN} ${D}${bindir}/${BPN}.${BPN}
93
94 if ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'true', 'false', d)}; then
95 # The mouse being autoenabled is just annoying in xfce4-terminal (mouse
96 # drag make vim go into visual mode and there is no right click menu),
97 # delete the block.
98 sed -i '/the mouse works just fine/,+4d' ${D}/${datadir}/${BPN}/vimrc
99 fi
100}
101
102PARALLEL_MAKEINST = ""
103
104PACKAGES =+ "${PN}-common ${PN}-syntax ${PN}-help ${PN}-tutor ${PN}-vimrc ${PN}-tools"
105FILES_${PN}-syntax = "${datadir}/${BPN}/${VIMDIR}/syntax"
106FILES_${PN}-help = "${datadir}/${BPN}/${VIMDIR}/doc"
107FILES_${PN}-tutor = "${datadir}/${BPN}/${VIMDIR}/tutor ${bindir}/${BPN}tutor"
108FILES_${PN}-vimrc = "${datadir}/${BPN}/vimrc"
109FILES_${PN}-data = "${datadir}/${BPN}"
110FILES_${PN}-tools = "${datadir}/${BPN}/${VIMDIR}/tools"
111FILES_${PN}-common = " \
112 ${datadir}/${BPN}/${VIMDIR}/*.vim \
113 ${datadir}/${BPN}/${VIMDIR}/autoload \
114 ${datadir}/${BPN}/${VIMDIR}/colors \
115 ${datadir}/${BPN}/${VIMDIR}/compiler \
116 ${datadir}/${BPN}/${VIMDIR}/ftplugin \
117 ${datadir}/${BPN}/${VIMDIR}/indent \
118 ${datadir}/${BPN}/${VIMDIR}/keymap \
119 ${datadir}/${BPN}/${VIMDIR}/lang \
120 ${datadir}/${BPN}/${VIMDIR}/macros \
121 ${datadir}/${BPN}/${VIMDIR}/plugin \
122 ${datadir}/${BPN}/${VIMDIR}/print \
123 ${datadir}/${BPN}/${VIMDIR}/spell \
124 ${datadir}/icons \
125"
126
127RDEPENDS_${BPN} = "ncurses-terminfo-base"
128# Recommend that runtime data is installed along with vim
129RRECOMMENDS_${BPN} = "${PN}-syntax ${PN}-help ${PN}-tutor ${PN}-vimrc ${PN}-common"
130
Brad Bishop15ae2502019-06-18 21:44:24 -0400131ALTERNATIVE_${PN} = "vi vim"
Brad Bishopc342db32019-05-15 21:57:59 -0400132ALTERNATIVE_PRIORITY = "100"
133ALTERNATIVE_TARGET = "${bindir}/${BPN}.${BPN}"
134ALTERNATIVE_LINK_NAME[vi] = "${base_bindir}/vi"
135ALTERNATIVE_LINK_NAME[vim] = "${bindir}/vim"