Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 1 | SUMMARY = "Vi IMproved - enhanced vi editor" |
| 2 | SECTION = "console/utils" |
| 3 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 4 | DEPENDS = "ncurses gettext-native" |
| 5 | # vimdiff doesn't like busybox diff |
| 6 | RSUGGESTS_${PN} = "diffutils" |
| 7 | LICENSE = "vim" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 8 | LIC_FILES_CHKSUM = "file://runtime/doc/uganda.txt;endline=287;md5=a19edd7ec70d573a005d9e509375a99a" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 9 | |
| 10 | SRC_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 Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 14 | file://no-path-adjust.patch \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 15 | " |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 16 | SRCREV = "98056533b96b6b5d8849641de93185dd7bcadc44" |
| 17 | |
| 18 | # Do not consider .z in x.y.z, as that is updated with every commit |
| 19 | UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+)\.0" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 20 | |
| 21 | S = "${WORKDIR}/git" |
| 22 | |
| 23 | VIMDIR = "vim${@d.getVar('PV').split('.')[0]}${@d.getVar('PV').split('.')[1]}" |
| 24 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 25 | inherit autotools-brokensep update-alternatives mime-xdg |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 26 | |
| 27 | CLEANBROKEN = "1" |
| 28 | |
| 29 | # vim configure.in contains functions which got 'dropped' by autotools.bbclass |
| 30 | do_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 | |
| 42 | do_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 |
| 53 | PACKAGECONFIG ??= "" |
| 54 | PACKAGECONFIG += " \ |
| 55 | ${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)} \ |
| 56 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 gtkgui', '', d)} \ |
| 57 | " |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 58 | |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 59 | PACKAGECONFIG[gtkgui] = "--enable-gui=gtk3,--enable-gui=no,gtk+3" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 60 | PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl," |
| 61 | PACKAGECONFIG[x11] = "--with-x,--without-x,xt," |
| 62 | PACKAGECONFIG[tiny] = "--with-features=tiny,--with-features=big,," |
| 63 | PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux," |
| 64 | PACKAGECONFIG[elfutils] = "--enable-elf-check,,elfutils," |
| 65 | |
| 66 | EXTRA_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 | |
| 83 | do_install() { |
| 84 | autotools_do_install |
| 85 | |
Andrew Geissler | 5a43b43 | 2020-06-13 10:46:56 -0500 | [diff] [blame^] | 86 | # 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 Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 92 | # 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 | |
| 106 | PARALLEL_MAKEINST = "" |
| 107 | |
| 108 | PACKAGES =+ "${PN}-common ${PN}-syntax ${PN}-help ${PN}-tutor ${PN}-vimrc ${PN}-tools" |
| 109 | FILES_${PN}-syntax = "${datadir}/${BPN}/${VIMDIR}/syntax" |
| 110 | FILES_${PN}-help = "${datadir}/${BPN}/${VIMDIR}/doc" |
| 111 | FILES_${PN}-tutor = "${datadir}/${BPN}/${VIMDIR}/tutor ${bindir}/${BPN}tutor" |
| 112 | FILES_${PN}-vimrc = "${datadir}/${BPN}/vimrc" |
| 113 | FILES_${PN}-data = "${datadir}/${BPN}" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 114 | |
| 115 | # We do not want to complain if perl or gawk are not on the target. |
| 116 | # |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 117 | FILES_${PN}-tools = "${datadir}/${BPN}/${VIMDIR}/tools" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 118 | INSANE_SKIP_${PN}-tools = "file-rdeps" |
| 119 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 120 | FILES_${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 | |
| 136 | RDEPENDS_${BPN} = "ncurses-terminfo-base" |
| 137 | # Recommend that runtime data is installed along with vim |
| 138 | RRECOMMENDS_${BPN} = "${PN}-syntax ${PN}-help ${PN}-tutor ${PN}-vimrc ${PN}-common" |
| 139 | |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 140 | ALTERNATIVE_${PN} = "vi vim" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 141 | ALTERNATIVE_PRIORITY = "100" |
| 142 | ALTERNATIVE_TARGET = "${bindir}/${BPN}.${BPN}" |
| 143 | ALTERNATIVE_LINK_NAME[vi] = "${base_bindir}/vi" |
| 144 | ALTERNATIVE_LINK_NAME[vim] = "${bindir}/vim" |