blob: b22e8016abb5e2643a24216446f150a6b718ad9d [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"
13LIC_FILES_CHKSUM = "file://LICENSE;md5=6b30ea4fa660c483b619924bc709ef99 \
Patrick Williamsde0582f2022-04-08 10:23:27 -050014 file://runtime/doc/uganda.txt;md5=daf48235bb824c77fe8ae88d5f575f74"
Andrew Geissler595f6302022-01-24 19:11:47 +000015
16SRC_URI = "git://github.com/vim/vim.git;branch=master;protocol=https \
Brad Bishopc342db32019-05-15 21:57:59 -040017 file://disable_acl_header_check.patch \
18 file://vim-add-knob-whether-elf.h-are-checked.patch \
19 file://0001-src-Makefile-improve-reproducibility.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050020 file://no-path-adjust.patch \
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060021 file://racefix.patch \
Andrew Geissler595f6302022-01-24 19:11:47 +000022 "
Andrew Geissler5199d832021-09-24 16:47:35 -050023
Andrew Geissler78b72792022-06-14 06:47:25 -050024PV .= ".5034"
25SRCREV = "5a6ec10cc80ab02eeff644ab19b82312630ea855"
Andrew Geissler595f6302022-01-24 19:11:47 +000026
27# Remove when 8.3 is out
28UPSTREAM_VERSION_UNKNOWN = "1"
Andrew Geissler82c905d2020-04-13 13:39:40 -050029
30# Do not consider .z in x.y.z, as that is updated with every commit
31UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+)\.0"
Brad Bishopc342db32019-05-15 21:57:59 -040032
33S = "${WORKDIR}/git"
34
35VIMDIR = "vim${@d.getVar('PV').split('.')[0]}${@d.getVar('PV').split('.')[1]}"
36
Andrew Geissler82c905d2020-04-13 13:39:40 -050037inherit autotools-brokensep update-alternatives mime-xdg
Brad Bishopc342db32019-05-15 21:57:59 -040038
39CLEANBROKEN = "1"
40
41# vim configure.in contains functions which got 'dropped' by autotools.bbclass
42do_configure () {
43 cd src
44 rm -f auto/*
45 touch auto/config.mk
46 aclocal
47 autoconf
48 cd ..
49 oe_runconf
50 touch src/auto/configure
51 touch src/auto/config.mk src/auto/config.h
52}
53
54do_compile() {
55 # We do not support fully / correctly the following locales. Attempting
56 # to use these with msgfmt in order to update the ".desktop" files exposes
57 # this problem and leads to the compile failing.
58 for LOCALE in cs fr ko pl sk zh_CN zh_TW;do
59 echo -n > src/po/${LOCALE}.po
60 done
61 autotools_do_compile
62}
63
Andrew Geissler595f6302022-01-24 19:11:47 +000064PACKAGECONFIG ??= "\
Brad Bishopc342db32019-05-15 21:57:59 -040065 ${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)} \
66 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 gtkgui', '', d)} \
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050067 nls \
Brad Bishopc342db32019-05-15 21:57:59 -040068"
Brad Bishopc342db32019-05-15 21:57:59 -040069
Brad Bishop15ae2502019-06-18 21:44:24 -040070PACKAGECONFIG[gtkgui] = "--enable-gui=gtk3,--enable-gui=no,gtk+3"
Brad Bishopc342db32019-05-15 21:57:59 -040071PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
72PACKAGECONFIG[x11] = "--with-x,--without-x,xt,"
73PACKAGECONFIG[tiny] = "--with-features=tiny,--with-features=big,,"
74PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,"
75PACKAGECONFIG[elfutils] = "--enable-elf-check,,elfutils,"
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050076PACKAGECONFIG[nls] = "--enable-nls,--disable-nls,,"
Andrew Geissler5199d832021-09-24 16:47:35 -050077PACKAGECONFIG[sound] = "--enable-canberra,--disable-canberra,canberra,"
Brad Bishopc342db32019-05-15 21:57:59 -040078
79EXTRA_OECONF = " \
80 --disable-gpm \
81 --disable-gtktest \
82 --disable-xim \
83 --disable-netbeans \
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060084 --disable-desktop-database-update \
Brad Bishopc342db32019-05-15 21:57:59 -040085 --with-tlib=ncurses \
86 ac_cv_small_wchar_t=no \
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060087 ac_cv_path_GLIB_COMPILE_RESOURCES=no \
Brad Bishopc342db32019-05-15 21:57:59 -040088 vim_cv_getcwd_broken=no \
89 vim_cv_memmove_handles_overlap=yes \
90 vim_cv_stat_ignores_slash=no \
91 vim_cv_terminfo=yes \
92 vim_cv_tgetent=non-zero \
93 vim_cv_toupper_broken=no \
94 vim_cv_tty_group=world \
95 STRIP=/bin/true \
96"
97
98do_install() {
99 autotools_do_install
100
Andrew Geissler5a43b432020-06-13 10:46:56 -0500101 # Work around file-rdeps picking up csh, awk, perl or python as a dep
102 chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/vim132
103 chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/mve.awk
104 chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/*.pl
105 chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/*.py
106
Brad Bishopc342db32019-05-15 21:57:59 -0400107 # Install example vimrc from runtime files
108 install -m 0644 runtime/vimrc_example.vim ${D}/${datadir}/${BPN}/vimrc
109
110 # we use --with-features=big as default
111 mv ${D}${bindir}/${BPN} ${D}${bindir}/${BPN}.${BPN}
112
113 if ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'true', 'false', d)}; then
114 # The mouse being autoenabled is just annoying in xfce4-terminal (mouse
115 # drag make vim go into visual mode and there is no right click menu),
116 # delete the block.
117 sed -i '/the mouse works just fine/,+4d' ${D}/${datadir}/${BPN}/vimrc
118 fi
119}
120
121PARALLEL_MAKEINST = ""
122
123PACKAGES =+ "${PN}-common ${PN}-syntax ${PN}-help ${PN}-tutor ${PN}-vimrc ${PN}-tools"
Patrick Williams213cb262021-08-07 19:21:33 -0500124FILES:${PN}-syntax = "${datadir}/${BPN}/${VIMDIR}/syntax"
125FILES:${PN}-help = "${datadir}/${BPN}/${VIMDIR}/doc"
126FILES:${PN}-tutor = "${datadir}/${BPN}/${VIMDIR}/tutor ${bindir}/${BPN}tutor"
127FILES:${PN}-vimrc = "${datadir}/${BPN}/vimrc"
128FILES:${PN}-data = "${datadir}/${BPN}"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500129
130# We do not want to complain if perl or gawk are not on the target.
131#
Patrick Williams213cb262021-08-07 19:21:33 -0500132FILES:${PN}-tools = "${datadir}/${BPN}/${VIMDIR}/tools"
133INSANE_SKIP:${PN}-tools = "file-rdeps"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500134
Patrick Williams213cb262021-08-07 19:21:33 -0500135FILES:${PN}-common = " \
Brad Bishopc342db32019-05-15 21:57:59 -0400136 ${datadir}/${BPN}/${VIMDIR}/*.vim \
137 ${datadir}/${BPN}/${VIMDIR}/autoload \
138 ${datadir}/${BPN}/${VIMDIR}/colors \
139 ${datadir}/${BPN}/${VIMDIR}/compiler \
140 ${datadir}/${BPN}/${VIMDIR}/ftplugin \
141 ${datadir}/${BPN}/${VIMDIR}/indent \
142 ${datadir}/${BPN}/${VIMDIR}/keymap \
143 ${datadir}/${BPN}/${VIMDIR}/lang \
144 ${datadir}/${BPN}/${VIMDIR}/macros \
145 ${datadir}/${BPN}/${VIMDIR}/plugin \
146 ${datadir}/${BPN}/${VIMDIR}/print \
147 ${datadir}/${BPN}/${VIMDIR}/spell \
148 ${datadir}/icons \
149"
150
Patrick Williams213cb262021-08-07 19:21:33 -0500151ALTERNATIVE:${PN} = "vi vim"
Brad Bishopc342db32019-05-15 21:57:59 -0400152ALTERNATIVE_PRIORITY = "100"
153ALTERNATIVE_TARGET = "${bindir}/${BPN}.${BPN}"
154ALTERNATIVE_LINK_NAME[vi] = "${base_bindir}/vi"
155ALTERNATIVE_LINK_NAME[vim] = "${bindir}/vim"