blob: d57f784da5d4bf0218683c5ef5a7c2f54b467f78 [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"
Andrew Geissler82c905d2020-04-13 13:39:40 -05008LIC_FILES_CHKSUM = "file://runtime/doc/uganda.txt;endline=287;md5=a19edd7ec70d573a005d9e509375a99a"
Brad Bishopc342db32019-05-15 21:57:59 -04009
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 \
Andrew Geissler82c905d2020-04-13 13:39:40 -050014 file://no-path-adjust.patch \
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060015 file://racefix.patch \
Brad Bishopc342db32019-05-15 21:57:59 -040016"
Andrew Geissler82c905d2020-04-13 13:39:40 -050017SRCREV = "98056533b96b6b5d8849641de93185dd7bcadc44"
18
19# Do not consider .z in x.y.z, as that is updated with every commit
20UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+)\.0"
Brad Bishopc342db32019-05-15 21:57:59 -040021
22S = "${WORKDIR}/git"
23
24VIMDIR = "vim${@d.getVar('PV').split('.')[0]}${@d.getVar('PV').split('.')[1]}"
25
Andrew Geissler82c905d2020-04-13 13:39:40 -050026inherit autotools-brokensep update-alternatives mime-xdg
Brad Bishopc342db32019-05-15 21:57:59 -040027
28CLEANBROKEN = "1"
29
30# vim configure.in contains functions which got 'dropped' by autotools.bbclass
31do_configure () {
32 cd src
33 rm -f auto/*
34 touch auto/config.mk
35 aclocal
36 autoconf
37 cd ..
38 oe_runconf
39 touch src/auto/configure
40 touch src/auto/config.mk src/auto/config.h
41}
42
43do_compile() {
44 # We do not support fully / correctly the following locales. Attempting
45 # to use these with msgfmt in order to update the ".desktop" files exposes
46 # this problem and leads to the compile failing.
47 for LOCALE in cs fr ko pl sk zh_CN zh_TW;do
48 echo -n > src/po/${LOCALE}.po
49 done
50 autotools_do_compile
51}
52
53#Available PACKAGECONFIG options are gtkgui, acl, x11, tiny
54PACKAGECONFIG ??= ""
55PACKAGECONFIG += " \
56 ${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)} \
57 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 gtkgui', '', d)} \
58"
Brad Bishopc342db32019-05-15 21:57:59 -040059
Brad Bishop15ae2502019-06-18 21:44:24 -040060PACKAGECONFIG[gtkgui] = "--enable-gui=gtk3,--enable-gui=no,gtk+3"
Brad Bishopc342db32019-05-15 21:57:59 -040061PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
62PACKAGECONFIG[x11] = "--with-x,--without-x,xt,"
63PACKAGECONFIG[tiny] = "--with-features=tiny,--with-features=big,,"
64PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,"
65PACKAGECONFIG[elfutils] = "--enable-elf-check,,elfutils,"
66
67EXTRA_OECONF = " \
68 --disable-gpm \
69 --disable-gtktest \
70 --disable-xim \
71 --disable-netbeans \
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060072 --disable-desktop-database-update \
Brad Bishopc342db32019-05-15 21:57:59 -040073 --with-tlib=ncurses \
74 ac_cv_small_wchar_t=no \
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060075 ac_cv_path_GLIB_COMPILE_RESOURCES=no \
Brad Bishopc342db32019-05-15 21:57:59 -040076 vim_cv_getcwd_broken=no \
77 vim_cv_memmove_handles_overlap=yes \
78 vim_cv_stat_ignores_slash=no \
79 vim_cv_terminfo=yes \
80 vim_cv_tgetent=non-zero \
81 vim_cv_toupper_broken=no \
82 vim_cv_tty_group=world \
83 STRIP=/bin/true \
84"
85
86do_install() {
87 autotools_do_install
88
Andrew Geissler5a43b432020-06-13 10:46:56 -050089 # Work around file-rdeps picking up csh, awk, perl or python as a dep
90 chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/vim132
91 chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/mve.awk
92 chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/*.pl
93 chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/*.py
94
Brad Bishopc342db32019-05-15 21:57:59 -040095 # Install example vimrc from runtime files
96 install -m 0644 runtime/vimrc_example.vim ${D}/${datadir}/${BPN}/vimrc
97
98 # we use --with-features=big as default
99 mv ${D}${bindir}/${BPN} ${D}${bindir}/${BPN}.${BPN}
100
101 if ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'true', 'false', d)}; then
102 # The mouse being autoenabled is just annoying in xfce4-terminal (mouse
103 # drag make vim go into visual mode and there is no right click menu),
104 # delete the block.
105 sed -i '/the mouse works just fine/,+4d' ${D}/${datadir}/${BPN}/vimrc
106 fi
107}
108
109PARALLEL_MAKEINST = ""
110
111PACKAGES =+ "${PN}-common ${PN}-syntax ${PN}-help ${PN}-tutor ${PN}-vimrc ${PN}-tools"
112FILES_${PN}-syntax = "${datadir}/${BPN}/${VIMDIR}/syntax"
113FILES_${PN}-help = "${datadir}/${BPN}/${VIMDIR}/doc"
114FILES_${PN}-tutor = "${datadir}/${BPN}/${VIMDIR}/tutor ${bindir}/${BPN}tutor"
115FILES_${PN}-vimrc = "${datadir}/${BPN}/vimrc"
116FILES_${PN}-data = "${datadir}/${BPN}"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500117
118# We do not want to complain if perl or gawk are not on the target.
119#
Brad Bishopc342db32019-05-15 21:57:59 -0400120FILES_${PN}-tools = "${datadir}/${BPN}/${VIMDIR}/tools"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500121INSANE_SKIP_${PN}-tools = "file-rdeps"
122
Brad Bishopc342db32019-05-15 21:57:59 -0400123FILES_${PN}-common = " \
124 ${datadir}/${BPN}/${VIMDIR}/*.vim \
125 ${datadir}/${BPN}/${VIMDIR}/autoload \
126 ${datadir}/${BPN}/${VIMDIR}/colors \
127 ${datadir}/${BPN}/${VIMDIR}/compiler \
128 ${datadir}/${BPN}/${VIMDIR}/ftplugin \
129 ${datadir}/${BPN}/${VIMDIR}/indent \
130 ${datadir}/${BPN}/${VIMDIR}/keymap \
131 ${datadir}/${BPN}/${VIMDIR}/lang \
132 ${datadir}/${BPN}/${VIMDIR}/macros \
133 ${datadir}/${BPN}/${VIMDIR}/plugin \
134 ${datadir}/${BPN}/${VIMDIR}/print \
135 ${datadir}/${BPN}/${VIMDIR}/spell \
136 ${datadir}/icons \
137"
138
139RDEPENDS_${BPN} = "ncurses-terminfo-base"
140# Recommend that runtime data is installed along with vim
141RRECOMMENDS_${BPN} = "${PN}-syntax ${PN}-help ${PN}-tutor ${PN}-vimrc ${PN}-common"
142
Brad Bishop15ae2502019-06-18 21:44:24 -0400143ALTERNATIVE_${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"