blob: 3a5eca41114f33769d48feb4c6fcb7e6e2beb77a [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001SUMMARY = "Vi IMproved - enhanced vi editor"
Andrew Geissler90fd73c2021-03-05 15:25:55 -06002DESCRIPTION = "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."
Brad Bishopc342db32019-05-15 21:57:59 -04003SECTION = "console/utils"
4
Andrew Geissler90fd73c2021-03-05 15:25:55 -06005HOMEPAGE = "https://www.vim.org/"
6BUGTRACKER = "https://github.com/vim/vim/issues"
7
Brad Bishopc342db32019-05-15 21:57:59 -04008DEPENDS = "ncurses gettext-native"
9# vimdiff doesn't like busybox diff
Patrick Williams213cb262021-08-07 19:21:33 -050010RSUGGESTS:${PN} = "diffutils"
Brad Bishopc342db32019-05-15 21:57:59 -040011
Andrew Geissler595f6302022-01-24 19:11:47 +000012LICENSE = "vim"
13LIC_FILES_CHKSUM = "file://runtime/doc/uganda.txt;endline=287;md5=909f1394892b7e0f9c2a95306c0c552b"
14
15SRC_URI = "git://github.com/vim/vim.git;branch=master;protocol=https \
Brad Bishopc342db32019-05-15 21:57:59 -040016 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 \
Andrew Geissler82c905d2020-04-13 13:39:40 -050019 file://no-path-adjust.patch \
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060020 file://racefix.patch \
Andrew Geissler595f6302022-01-24 19:11:47 +000021 "
Andrew Geissler5199d832021-09-24 16:47:35 -050022
Andrew Geissler595f6302022-01-24 19:11:47 +000023PV .= ".4118"
24SRCREV = "0023f82a76cf43a12b41e71f97a2e860d0444e1b"
25
26# Remove when 8.3 is out
27UPSTREAM_VERSION_UNKNOWN = "1"
Andrew Geissler82c905d2020-04-13 13:39:40 -050028
29# Do not consider .z in x.y.z, as that is updated with every commit
30UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+)\.0"
Brad Bishopc342db32019-05-15 21:57:59 -040031
32S = "${WORKDIR}/git"
33
34VIMDIR = "vim${@d.getVar('PV').split('.')[0]}${@d.getVar('PV').split('.')[1]}"
35
Andrew Geissler82c905d2020-04-13 13:39:40 -050036inherit autotools-brokensep update-alternatives mime-xdg
Brad Bishopc342db32019-05-15 21:57:59 -040037
38CLEANBROKEN = "1"
39
40# vim configure.in contains functions which got 'dropped' by autotools.bbclass
41do_configure () {
42 cd src
43 rm -f auto/*
44 touch auto/config.mk
45 aclocal
46 autoconf
47 cd ..
48 oe_runconf
49 touch src/auto/configure
50 touch src/auto/config.mk src/auto/config.h
51}
52
53do_compile() {
54 # We do not support fully / correctly the following locales. Attempting
55 # to use these with msgfmt in order to update the ".desktop" files exposes
56 # this problem and leads to the compile failing.
57 for LOCALE in cs fr ko pl sk zh_CN zh_TW;do
58 echo -n > src/po/${LOCALE}.po
59 done
60 autotools_do_compile
61}
62
Andrew Geissler595f6302022-01-24 19:11:47 +000063PACKAGECONFIG ??= "\
Brad Bishopc342db32019-05-15 21:57:59 -040064 ${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)} \
65 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 gtkgui', '', d)} \
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050066 nls \
Brad Bishopc342db32019-05-15 21:57:59 -040067"
Brad Bishopc342db32019-05-15 21:57:59 -040068
Brad Bishop15ae2502019-06-18 21:44:24 -040069PACKAGECONFIG[gtkgui] = "--enable-gui=gtk3,--enable-gui=no,gtk+3"
Brad Bishopc342db32019-05-15 21:57:59 -040070PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
71PACKAGECONFIG[x11] = "--with-x,--without-x,xt,"
72PACKAGECONFIG[tiny] = "--with-features=tiny,--with-features=big,,"
73PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,"
74PACKAGECONFIG[elfutils] = "--enable-elf-check,,elfutils,"
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050075PACKAGECONFIG[nls] = "--enable-nls,--disable-nls,,"
Andrew Geissler5199d832021-09-24 16:47:35 -050076PACKAGECONFIG[sound] = "--enable-canberra,--disable-canberra,canberra,"
Brad Bishopc342db32019-05-15 21:57:59 -040077
78EXTRA_OECONF = " \
79 --disable-gpm \
80 --disable-gtktest \
81 --disable-xim \
82 --disable-netbeans \
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060083 --disable-desktop-database-update \
Brad Bishopc342db32019-05-15 21:57:59 -040084 --with-tlib=ncurses \
85 ac_cv_small_wchar_t=no \
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060086 ac_cv_path_GLIB_COMPILE_RESOURCES=no \
Brad Bishopc342db32019-05-15 21:57:59 -040087 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
97do_install() {
98 autotools_do_install
99
Andrew Geissler5a43b432020-06-13 10:46:56 -0500100 # Work around file-rdeps picking up csh, awk, perl or python as a dep
101 chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/vim132
102 chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/mve.awk
103 chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/*.pl
104 chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/*.py
105
Brad Bishopc342db32019-05-15 21:57:59 -0400106 # Install example vimrc from runtime files
107 install -m 0644 runtime/vimrc_example.vim ${D}/${datadir}/${BPN}/vimrc
108
109 # we use --with-features=big as default
110 mv ${D}${bindir}/${BPN} ${D}${bindir}/${BPN}.${BPN}
111
112 if ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'true', 'false', d)}; then
113 # The mouse being autoenabled is just annoying in xfce4-terminal (mouse
114 # drag make vim go into visual mode and there is no right click menu),
115 # delete the block.
116 sed -i '/the mouse works just fine/,+4d' ${D}/${datadir}/${BPN}/vimrc
117 fi
118}
119
120PARALLEL_MAKEINST = ""
121
122PACKAGES =+ "${PN}-common ${PN}-syntax ${PN}-help ${PN}-tutor ${PN}-vimrc ${PN}-tools"
Patrick Williams213cb262021-08-07 19:21:33 -0500123FILES:${PN}-syntax = "${datadir}/${BPN}/${VIMDIR}/syntax"
124FILES:${PN}-help = "${datadir}/${BPN}/${VIMDIR}/doc"
125FILES:${PN}-tutor = "${datadir}/${BPN}/${VIMDIR}/tutor ${bindir}/${BPN}tutor"
126FILES:${PN}-vimrc = "${datadir}/${BPN}/vimrc"
127FILES:${PN}-data = "${datadir}/${BPN}"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500128
129# We do not want to complain if perl or gawk are not on the target.
130#
Patrick Williams213cb262021-08-07 19:21:33 -0500131FILES:${PN}-tools = "${datadir}/${BPN}/${VIMDIR}/tools"
132INSANE_SKIP:${PN}-tools = "file-rdeps"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500133
Patrick Williams213cb262021-08-07 19:21:33 -0500134FILES:${PN}-common = " \
Brad Bishopc342db32019-05-15 21:57:59 -0400135 ${datadir}/${BPN}/${VIMDIR}/*.vim \
136 ${datadir}/${BPN}/${VIMDIR}/autoload \
137 ${datadir}/${BPN}/${VIMDIR}/colors \
138 ${datadir}/${BPN}/${VIMDIR}/compiler \
139 ${datadir}/${BPN}/${VIMDIR}/ftplugin \
140 ${datadir}/${BPN}/${VIMDIR}/indent \
141 ${datadir}/${BPN}/${VIMDIR}/keymap \
142 ${datadir}/${BPN}/${VIMDIR}/lang \
143 ${datadir}/${BPN}/${VIMDIR}/macros \
144 ${datadir}/${BPN}/${VIMDIR}/plugin \
145 ${datadir}/${BPN}/${VIMDIR}/print \
146 ${datadir}/${BPN}/${VIMDIR}/spell \
147 ${datadir}/icons \
148"
149
Patrick Williams213cb262021-08-07 19:21:33 -0500150ALTERNATIVE:${PN} = "vi vim"
Brad Bishopc342db32019-05-15 21:57:59 -0400151ALTERNATIVE_PRIORITY = "100"
152ALTERNATIVE_TARGET = "${bindir}/${BPN}.${BPN}"
153ALTERNATIVE_LINK_NAME[vi] = "${base_bindir}/vi"
154ALTERNATIVE_LINK_NAME[vim] = "${bindir}/vim"