blob: 5f55f590e65c65c60e88ef9b1e62f590ad0fd79e [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 Geissler7e0e3c02022-02-25 20:34:39 +000012LICENSE = "Vim"
Andrew Geissler220dafd2023-10-04 10:18:08 -050013LIC_FILES_CHKSUM = "file://LICENSE;md5=d1a651ab770b45d41c0f8cb5a8ca930e"
Andrew Geissler595f6302022-01-24 19:11:47 +000014
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 Geissler595f6302022-01-24 19:11:47 +000020 "
Andrew Geissler5199d832021-09-24 16:47:35 -050021
Andrew Geissler220dafd2023-10-04 10:18:08 -050022PV .= ".1894"
23SRCREV = "e5f7cd0a60d0eeab84f7aeb35c13d3af7e50072e"
Andrew Geissler82c905d2020-04-13 13:39:40 -050024
25# Do not consider .z in x.y.z, as that is updated with every commit
26UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+)\.0"
Andrew Geissler5082cc72023-09-11 08:41:39 -040027# Ignore that the upstream version .z in x.y.z is always newer
28UPSTREAM_VERSION_UNKNOWN = "1"
Brad Bishopc342db32019-05-15 21:57:59 -040029
30S = "${WORKDIR}/git"
31
32VIMDIR = "vim${@d.getVar('PV').split('.')[0]}${@d.getVar('PV').split('.')[1]}"
33
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050034inherit autotools-brokensep update-alternatives mime-xdg pkgconfig
Brad Bishopc342db32019-05-15 21:57:59 -040035
36CLEANBROKEN = "1"
37
38# vim configure.in contains functions which got 'dropped' by autotools.bbclass
39do_configure () {
40 cd src
41 rm -f auto/*
42 touch auto/config.mk
43 aclocal
44 autoconf
45 cd ..
46 oe_runconf
47 touch src/auto/configure
48 touch src/auto/config.mk src/auto/config.h
49}
50
51do_compile() {
52 # We do not support fully / correctly the following locales. Attempting
53 # to use these with msgfmt in order to update the ".desktop" files exposes
54 # this problem and leads to the compile failing.
55 for LOCALE in cs fr ko pl sk zh_CN zh_TW;do
56 echo -n > src/po/${LOCALE}.po
57 done
58 autotools_do_compile
59}
60
Andrew Geissler595f6302022-01-24 19:11:47 +000061PACKAGECONFIG ??= "\
Brad Bishopc342db32019-05-15 21:57:59 -040062 ${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)} \
63 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 gtkgui', '', d)} \
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050064 nls \
Brad Bishopc342db32019-05-15 21:57:59 -040065"
Brad Bishopc342db32019-05-15 21:57:59 -040066
Brad Bishop15ae2502019-06-18 21:44:24 -040067PACKAGECONFIG[gtkgui] = "--enable-gui=gtk3,--enable-gui=no,gtk+3"
Brad Bishopc342db32019-05-15 21:57:59 -040068PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
69PACKAGECONFIG[x11] = "--with-x,--without-x,xt,"
70PACKAGECONFIG[tiny] = "--with-features=tiny,--with-features=big,,"
71PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,"
72PACKAGECONFIG[elfutils] = "--enable-elf-check,,elfutils,"
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050073PACKAGECONFIG[nls] = "--enable-nls,--disable-nls,,"
Andrew Geissler5199d832021-09-24 16:47:35 -050074PACKAGECONFIG[sound] = "--enable-canberra,--disable-canberra,canberra,"
Brad Bishopc342db32019-05-15 21:57:59 -040075
76EXTRA_OECONF = " \
77 --disable-gpm \
78 --disable-gtktest \
79 --disable-xim \
80 --disable-netbeans \
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060081 --disable-desktop-database-update \
Brad Bishopc342db32019-05-15 21:57:59 -040082 --with-tlib=ncurses \
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050083 --with-modified-by='${MAINTAINER}' \
Brad Bishopc342db32019-05-15 21:57:59 -040084 ac_cv_small_wchar_t=no \
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060085 ac_cv_path_GLIB_COMPILE_RESOURCES=no \
Brad Bishopc342db32019-05-15 21:57:59 -040086 vim_cv_getcwd_broken=no \
87 vim_cv_memmove_handles_overlap=yes \
88 vim_cv_stat_ignores_slash=no \
89 vim_cv_terminfo=yes \
90 vim_cv_tgetent=non-zero \
91 vim_cv_toupper_broken=no \
92 vim_cv_tty_group=world \
93 STRIP=/bin/true \
94"
95
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050096# Some host distros don't have it, disable consistently
97EXTRA_OECONF:append:class-native = " vim_cv_timer_create=no"
98EXTRA_OECONF:append:class-target = " vim_cv_timer_create=yes"
99
Brad Bishopc342db32019-05-15 21:57:59 -0400100do_install() {
101 autotools_do_install
102
Andrew Geissler5a43b432020-06-13 10:46:56 -0500103 # Work around file-rdeps picking up csh, awk, perl or python as a dep
104 chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/vim132
105 chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/mve.awk
106 chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/*.pl
107 chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/*.py
108
Brad Bishopc342db32019-05-15 21:57:59 -0400109 # Install example vimrc from runtime files
110 install -m 0644 runtime/vimrc_example.vim ${D}/${datadir}/${BPN}/vimrc
111
112 # we use --with-features=big as default
113 mv ${D}${bindir}/${BPN} ${D}${bindir}/${BPN}.${BPN}
114
115 if ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'true', 'false', d)}; then
116 # The mouse being autoenabled is just annoying in xfce4-terminal (mouse
117 # drag make vim go into visual mode and there is no right click menu),
118 # delete the block.
119 sed -i '/the mouse works just fine/,+4d' ${D}/${datadir}/${BPN}/vimrc
120 fi
121}
122
123PARALLEL_MAKEINST = ""
124
125PACKAGES =+ "${PN}-common ${PN}-syntax ${PN}-help ${PN}-tutor ${PN}-vimrc ${PN}-tools"
Patrick Williams213cb262021-08-07 19:21:33 -0500126FILES:${PN}-syntax = "${datadir}/${BPN}/${VIMDIR}/syntax"
127FILES:${PN}-help = "${datadir}/${BPN}/${VIMDIR}/doc"
128FILES:${PN}-tutor = "${datadir}/${BPN}/${VIMDIR}/tutor ${bindir}/${BPN}tutor"
129FILES:${PN}-vimrc = "${datadir}/${BPN}/vimrc"
130FILES:${PN}-data = "${datadir}/${BPN}"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500131
132# We do not want to complain if perl or gawk are not on the target.
133#
Patrick Williams213cb262021-08-07 19:21:33 -0500134FILES:${PN}-tools = "${datadir}/${BPN}/${VIMDIR}/tools"
135INSANE_SKIP:${PN}-tools = "file-rdeps"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500136
Patrick Williams213cb262021-08-07 19:21:33 -0500137FILES:${PN}-common = " \
Brad Bishopc342db32019-05-15 21:57:59 -0400138 ${datadir}/${BPN}/${VIMDIR}/*.vim \
139 ${datadir}/${BPN}/${VIMDIR}/autoload \
140 ${datadir}/${BPN}/${VIMDIR}/colors \
141 ${datadir}/${BPN}/${VIMDIR}/compiler \
142 ${datadir}/${BPN}/${VIMDIR}/ftplugin \
143 ${datadir}/${BPN}/${VIMDIR}/indent \
144 ${datadir}/${BPN}/${VIMDIR}/keymap \
145 ${datadir}/${BPN}/${VIMDIR}/lang \
146 ${datadir}/${BPN}/${VIMDIR}/macros \
147 ${datadir}/${BPN}/${VIMDIR}/plugin \
148 ${datadir}/${BPN}/${VIMDIR}/print \
149 ${datadir}/${BPN}/${VIMDIR}/spell \
150 ${datadir}/icons \
151"
152
Patrick Williams213cb262021-08-07 19:21:33 -0500153ALTERNATIVE:${PN} = "vi vim"
Brad Bishopc342db32019-05-15 21:57:59 -0400154ALTERNATIVE_PRIORITY = "100"
155ALTERNATIVE_TARGET = "${bindir}/${BPN}.${BPN}"
156ALTERNATIVE_LINK_NAME[vi] = "${base_bindir}/vi"
157ALTERNATIVE_LINK_NAME[vim] = "${bindir}/vim"