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