blob: 9f3dc080276bfb2cf9a865179c119c89a76b423b [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
Brad Bishopc342db32019-05-15 21:57:59 -040086 # Install example vimrc from runtime files
87 install -m 0644 runtime/vimrc_example.vim ${D}/${datadir}/${BPN}/vimrc
88
89 # we use --with-features=big as default
90 mv ${D}${bindir}/${BPN} ${D}${bindir}/${BPN}.${BPN}
91
92 if ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'true', 'false', d)}; then
93 # The mouse being autoenabled is just annoying in xfce4-terminal (mouse
94 # drag make vim go into visual mode and there is no right click menu),
95 # delete the block.
96 sed -i '/the mouse works just fine/,+4d' ${D}/${datadir}/${BPN}/vimrc
97 fi
98}
99
100PARALLEL_MAKEINST = ""
101
102PACKAGES =+ "${PN}-common ${PN}-syntax ${PN}-help ${PN}-tutor ${PN}-vimrc ${PN}-tools"
103FILES_${PN}-syntax = "${datadir}/${BPN}/${VIMDIR}/syntax"
104FILES_${PN}-help = "${datadir}/${BPN}/${VIMDIR}/doc"
105FILES_${PN}-tutor = "${datadir}/${BPN}/${VIMDIR}/tutor ${bindir}/${BPN}tutor"
106FILES_${PN}-vimrc = "${datadir}/${BPN}/vimrc"
107FILES_${PN}-data = "${datadir}/${BPN}"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500108
109# We do not want to complain if perl or gawk are not on the target.
110#
Brad Bishopc342db32019-05-15 21:57:59 -0400111FILES_${PN}-tools = "${datadir}/${BPN}/${VIMDIR}/tools"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500112INSANE_SKIP_${PN}-tools = "file-rdeps"
113
Brad Bishopc342db32019-05-15 21:57:59 -0400114FILES_${PN}-common = " \
115 ${datadir}/${BPN}/${VIMDIR}/*.vim \
116 ${datadir}/${BPN}/${VIMDIR}/autoload \
117 ${datadir}/${BPN}/${VIMDIR}/colors \
118 ${datadir}/${BPN}/${VIMDIR}/compiler \
119 ${datadir}/${BPN}/${VIMDIR}/ftplugin \
120 ${datadir}/${BPN}/${VIMDIR}/indent \
121 ${datadir}/${BPN}/${VIMDIR}/keymap \
122 ${datadir}/${BPN}/${VIMDIR}/lang \
123 ${datadir}/${BPN}/${VIMDIR}/macros \
124 ${datadir}/${BPN}/${VIMDIR}/plugin \
125 ${datadir}/${BPN}/${VIMDIR}/print \
126 ${datadir}/${BPN}/${VIMDIR}/spell \
127 ${datadir}/icons \
128"
129
130RDEPENDS_${BPN} = "ncurses-terminfo-base"
131# Recommend that runtime data is installed along with vim
132RRECOMMENDS_${BPN} = "${PN}-syntax ${PN}-help ${PN}-tutor ${PN}-vimrc ${PN}-common"
133
Brad Bishop15ae2502019-06-18 21:44:24 -0400134ALTERNATIVE_${PN} = "vi vim"
Brad Bishopc342db32019-05-15 21:57:59 -0400135ALTERNATIVE_PRIORITY = "100"
136ALTERNATIVE_TARGET = "${bindir}/${BPN}.${BPN}"
137ALTERNATIVE_LINK_NAME[vi] = "${base_bindir}/vi"
138ALTERNATIVE_LINK_NAME[vim] = "${bindir}/vim"