Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 1 | SUMMARY = "Vi IMproved - enhanced vi editor" |
Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame] | 2 | DESCRIPTION = "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 Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 3 | SECTION = "console/utils" |
| 4 | |
Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame] | 5 | HOMEPAGE = "https://www.vim.org/" |
| 6 | BUGTRACKER = "https://github.com/vim/vim/issues" |
| 7 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 8 | DEPENDS = "ncurses gettext-native" |
| 9 | # vimdiff doesn't like busybox diff |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 10 | RSUGGESTS:${PN} = "diffutils" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 11 | LICENSE = "vim" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 12 | LIC_FILES_CHKSUM = "file://runtime/doc/uganda.txt;endline=287;md5=a19edd7ec70d573a005d9e509375a99a" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 13 | |
| 14 | SRC_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 Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 18 | file://no-path-adjust.patch \ |
Andrew Geissler | 9b4d8b0 | 2021-02-19 12:26:16 -0600 | [diff] [blame] | 19 | file://racefix.patch \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 20 | " |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 21 | SRCREV = "98056533b96b6b5d8849641de93185dd7bcadc44" |
| 22 | |
| 23 | # Do not consider .z in x.y.z, as that is updated with every commit |
| 24 | UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+)\.0" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 25 | |
| 26 | S = "${WORKDIR}/git" |
| 27 | |
| 28 | VIMDIR = "vim${@d.getVar('PV').split('.')[0]}${@d.getVar('PV').split('.')[1]}" |
| 29 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 30 | inherit autotools-brokensep update-alternatives mime-xdg |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 31 | |
| 32 | CLEANBROKEN = "1" |
| 33 | |
| 34 | # vim configure.in contains functions which got 'dropped' by autotools.bbclass |
| 35 | do_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 | |
| 47 | do_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 | |
Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 57 | #Available PACKAGECONFIG options are gtkgui, acl, x11, tiny selinux, elfutils, nls |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 58 | PACKAGECONFIG ??= "" |
| 59 | PACKAGECONFIG += " \ |
| 60 | ${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)} \ |
| 61 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 gtkgui', '', d)} \ |
Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 62 | nls \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 63 | " |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 64 | |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 65 | PACKAGECONFIG[gtkgui] = "--enable-gui=gtk3,--enable-gui=no,gtk+3" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 66 | PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl," |
| 67 | PACKAGECONFIG[x11] = "--with-x,--without-x,xt," |
| 68 | PACKAGECONFIG[tiny] = "--with-features=tiny,--with-features=big,," |
| 69 | PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux," |
| 70 | PACKAGECONFIG[elfutils] = "--enable-elf-check,,elfutils," |
Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 71 | PACKAGECONFIG[nls] = "--enable-nls,--disable-nls,," |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 72 | |
| 73 | EXTRA_OECONF = " \ |
| 74 | --disable-gpm \ |
| 75 | --disable-gtktest \ |
| 76 | --disable-xim \ |
| 77 | --disable-netbeans \ |
Andrew Geissler | 9b4d8b0 | 2021-02-19 12:26:16 -0600 | [diff] [blame] | 78 | --disable-desktop-database-update \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 79 | --with-tlib=ncurses \ |
| 80 | ac_cv_small_wchar_t=no \ |
Andrew Geissler | 9b4d8b0 | 2021-02-19 12:26:16 -0600 | [diff] [blame] | 81 | ac_cv_path_GLIB_COMPILE_RESOURCES=no \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 82 | vim_cv_getcwd_broken=no \ |
| 83 | vim_cv_memmove_handles_overlap=yes \ |
| 84 | vim_cv_stat_ignores_slash=no \ |
| 85 | vim_cv_terminfo=yes \ |
| 86 | vim_cv_tgetent=non-zero \ |
| 87 | vim_cv_toupper_broken=no \ |
| 88 | vim_cv_tty_group=world \ |
| 89 | STRIP=/bin/true \ |
| 90 | " |
| 91 | |
| 92 | do_install() { |
| 93 | autotools_do_install |
| 94 | |
Andrew Geissler | 5a43b43 | 2020-06-13 10:46:56 -0500 | [diff] [blame] | 95 | # Work around file-rdeps picking up csh, awk, perl or python as a dep |
| 96 | chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/vim132 |
| 97 | chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/mve.awk |
| 98 | chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/*.pl |
| 99 | chmod -x ${D}${datadir}/${BPN}/${VIMDIR}/tools/*.py |
| 100 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 101 | # Install example vimrc from runtime files |
| 102 | install -m 0644 runtime/vimrc_example.vim ${D}/${datadir}/${BPN}/vimrc |
| 103 | |
| 104 | # we use --with-features=big as default |
| 105 | mv ${D}${bindir}/${BPN} ${D}${bindir}/${BPN}.${BPN} |
| 106 | |
| 107 | if ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'true', 'false', d)}; then |
| 108 | # The mouse being autoenabled is just annoying in xfce4-terminal (mouse |
| 109 | # drag make vim go into visual mode and there is no right click menu), |
| 110 | # delete the block. |
| 111 | sed -i '/the mouse works just fine/,+4d' ${D}/${datadir}/${BPN}/vimrc |
| 112 | fi |
| 113 | } |
| 114 | |
| 115 | PARALLEL_MAKEINST = "" |
| 116 | |
| 117 | PACKAGES =+ "${PN}-common ${PN}-syntax ${PN}-help ${PN}-tutor ${PN}-vimrc ${PN}-tools" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 118 | FILES:${PN}-syntax = "${datadir}/${BPN}/${VIMDIR}/syntax" |
| 119 | FILES:${PN}-help = "${datadir}/${BPN}/${VIMDIR}/doc" |
| 120 | FILES:${PN}-tutor = "${datadir}/${BPN}/${VIMDIR}/tutor ${bindir}/${BPN}tutor" |
| 121 | FILES:${PN}-vimrc = "${datadir}/${BPN}/vimrc" |
| 122 | FILES:${PN}-data = "${datadir}/${BPN}" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 123 | |
| 124 | # We do not want to complain if perl or gawk are not on the target. |
| 125 | # |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 126 | FILES:${PN}-tools = "${datadir}/${BPN}/${VIMDIR}/tools" |
| 127 | INSANE_SKIP:${PN}-tools = "file-rdeps" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 128 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 129 | FILES:${PN}-common = " \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 130 | ${datadir}/${BPN}/${VIMDIR}/*.vim \ |
| 131 | ${datadir}/${BPN}/${VIMDIR}/autoload \ |
| 132 | ${datadir}/${BPN}/${VIMDIR}/colors \ |
| 133 | ${datadir}/${BPN}/${VIMDIR}/compiler \ |
| 134 | ${datadir}/${BPN}/${VIMDIR}/ftplugin \ |
| 135 | ${datadir}/${BPN}/${VIMDIR}/indent \ |
| 136 | ${datadir}/${BPN}/${VIMDIR}/keymap \ |
| 137 | ${datadir}/${BPN}/${VIMDIR}/lang \ |
| 138 | ${datadir}/${BPN}/${VIMDIR}/macros \ |
| 139 | ${datadir}/${BPN}/${VIMDIR}/plugin \ |
| 140 | ${datadir}/${BPN}/${VIMDIR}/print \ |
| 141 | ${datadir}/${BPN}/${VIMDIR}/spell \ |
| 142 | ${datadir}/icons \ |
| 143 | " |
| 144 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 145 | ALTERNATIVE:${PN} = "vi vim" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 146 | ALTERNATIVE_PRIORITY = "100" |
| 147 | ALTERNATIVE_TARGET = "${bindir}/${BPN}.${BPN}" |
| 148 | ALTERNATIVE_LINK_NAME[vi] = "${base_bindir}/vi" |
| 149 | ALTERNATIVE_LINK_NAME[vim] = "${bindir}/vim" |