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