blob: 17d1c24a7cc7bead334c4284e734487e8a3e0cfb [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 -040011LICENSE = "vim"
Andrew Geissler82c905d2020-04-13 13:39:40 -050012LIC_FILES_CHKSUM = "file://runtime/doc/uganda.txt;endline=287;md5=a19edd7ec70d573a005d9e509375a99a"
Brad Bishopc342db32019-05-15 21:57:59 -040013
14SRC_URI = "git://github.com/vim/vim.git \
15 file://disable_acl_header_check.patch \
16 file://vim-add-knob-whether-elf.h-are-checked.patch \
17 file://0001-src-Makefile-improve-reproducibility.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050018 file://no-path-adjust.patch \
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060019 file://racefix.patch \
Brad Bishopc342db32019-05-15 21:57:59 -040020"
Andrew Geissler82c905d2020-04-13 13:39:40 -050021SRCREV = "98056533b96b6b5d8849641de93185dd7bcadc44"
22
23# Do not consider .z in x.y.z, as that is updated with every commit
24UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+)\.0"
Brad Bishopc342db32019-05-15 21:57:59 -040025
26S = "${WORKDIR}/git"
27
28VIMDIR = "vim${@d.getVar('PV').split('.')[0]}${@d.getVar('PV').split('.')[1]}"
29
Andrew Geissler82c905d2020-04-13 13:39:40 -050030inherit autotools-brokensep update-alternatives mime-xdg
Brad Bishopc342db32019-05-15 21:57:59 -040031
32CLEANBROKEN = "1"
33
34# vim configure.in contains functions which got 'dropped' by autotools.bbclass
35do_configure () {
36 cd src
37 rm -f auto/*
38 touch auto/config.mk
39 aclocal
40 autoconf
41 cd ..
42 oe_runconf
43 touch src/auto/configure
44 touch src/auto/config.mk src/auto/config.h
45}
46
47do_compile() {
48 # We do not support fully / correctly the following locales. Attempting
49 # to use these with msgfmt in order to update the ".desktop" files exposes
50 # this problem and leads to the compile failing.
51 for LOCALE in cs fr ko pl sk zh_CN zh_TW;do
52 echo -n > src/po/${LOCALE}.po
53 done
54 autotools_do_compile
55}
56
57#Available PACKAGECONFIG options are gtkgui, acl, x11, tiny
58PACKAGECONFIG ??= ""
59PACKAGECONFIG += " \
60 ${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)} \
61 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 gtkgui', '', d)} \
62"
Brad Bishopc342db32019-05-15 21:57:59 -040063
Brad Bishop15ae2502019-06-18 21:44:24 -040064PACKAGECONFIG[gtkgui] = "--enable-gui=gtk3,--enable-gui=no,gtk+3"
Brad Bishopc342db32019-05-15 21:57:59 -040065PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
66PACKAGECONFIG[x11] = "--with-x,--without-x,xt,"
67PACKAGECONFIG[tiny] = "--with-features=tiny,--with-features=big,,"
68PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,"
69PACKAGECONFIG[elfutils] = "--enable-elf-check,,elfutils,"
70
71EXTRA_OECONF = " \
72 --disable-gpm \
73 --disable-gtktest \
74 --disable-xim \
75 --disable-netbeans \
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060076 --disable-desktop-database-update \
Brad Bishopc342db32019-05-15 21:57:59 -040077 --with-tlib=ncurses \
78 ac_cv_small_wchar_t=no \
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060079 ac_cv_path_GLIB_COMPILE_RESOURCES=no \
Brad Bishopc342db32019-05-15 21:57:59 -040080 vim_cv_getcwd_broken=no \
81 vim_cv_memmove_handles_overlap=yes \
82 vim_cv_stat_ignores_slash=no \
83 vim_cv_terminfo=yes \
84 vim_cv_tgetent=non-zero \
85 vim_cv_toupper_broken=no \
86 vim_cv_tty_group=world \
87 STRIP=/bin/true \
88"
89
90do_install() {
91 autotools_do_install
92
Andrew Geissler5a43b432020-06-13 10:46:56 -050093 # Work around file-rdeps picking up csh, awk, perl or python as a dep
94 chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/vim132
95 chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/mve.awk
96 chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/*.pl
97 chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/*.py
98
Brad Bishopc342db32019-05-15 21:57:59 -040099 # Install example vimrc from runtime files
100 install -m 0644 runtime/vimrc_example.vim ${D}/${datadir}/${BPN}/vimrc
101
102 # we use --with-features=big as default
103 mv ${D}${bindir}/${BPN} ${D}${bindir}/${BPN}.${BPN}
104
105 if ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'true', 'false', d)}; then
106 # The mouse being autoenabled is just annoying in xfce4-terminal (mouse
107 # drag make vim go into visual mode and there is no right click menu),
108 # delete the block.
109 sed -i '/the mouse works just fine/,+4d' ${D}/${datadir}/${BPN}/vimrc
110 fi
111}
112
113PARALLEL_MAKEINST = ""
114
115PACKAGES =+ "${PN}-common ${PN}-syntax ${PN}-help ${PN}-tutor ${PN}-vimrc ${PN}-tools"
Patrick Williams213cb262021-08-07 19:21:33 -0500116FILES:${PN}-syntax = "${datadir}/${BPN}/${VIMDIR}/syntax"
117FILES:${PN}-help = "${datadir}/${BPN}/${VIMDIR}/doc"
118FILES:${PN}-tutor = "${datadir}/${BPN}/${VIMDIR}/tutor ${bindir}/${BPN}tutor"
119FILES:${PN}-vimrc = "${datadir}/${BPN}/vimrc"
120FILES:${PN}-data = "${datadir}/${BPN}"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500121
122# We do not want to complain if perl or gawk are not on the target.
123#
Patrick Williams213cb262021-08-07 19:21:33 -0500124FILES:${PN}-tools = "${datadir}/${BPN}/${VIMDIR}/tools"
125INSANE_SKIP:${PN}-tools = "file-rdeps"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500126
Patrick Williams213cb262021-08-07 19:21:33 -0500127FILES:${PN}-common = " \
Brad Bishopc342db32019-05-15 21:57:59 -0400128 ${datadir}/${BPN}/${VIMDIR}/*.vim \
129 ${datadir}/${BPN}/${VIMDIR}/autoload \
130 ${datadir}/${BPN}/${VIMDIR}/colors \
131 ${datadir}/${BPN}/${VIMDIR}/compiler \
132 ${datadir}/${BPN}/${VIMDIR}/ftplugin \
133 ${datadir}/${BPN}/${VIMDIR}/indent \
134 ${datadir}/${BPN}/${VIMDIR}/keymap \
135 ${datadir}/${BPN}/${VIMDIR}/lang \
136 ${datadir}/${BPN}/${VIMDIR}/macros \
137 ${datadir}/${BPN}/${VIMDIR}/plugin \
138 ${datadir}/${BPN}/${VIMDIR}/print \
139 ${datadir}/${BPN}/${VIMDIR}/spell \
140 ${datadir}/icons \
141"
142
Patrick Williams213cb262021-08-07 19:21:33 -0500143ALTERNATIVE:${PN} = "vi vim"
Brad Bishopc342db32019-05-15 21:57:59 -0400144ALTERNATIVE_PRIORITY = "100"
145ALTERNATIVE_TARGET = "${bindir}/${BPN}.${BPN}"
146ALTERNATIVE_LINK_NAME[vi] = "${base_bindir}/vi"
147ALTERNATIVE_LINK_NAME[vim] = "${bindir}/vim"