From c48fe5e03084fbb80d06def08de252ce775ede1c Mon Sep 17 00:00:00 2001 From: Marko Ratkaj Date: Mon, 2 Mar 2015 16:52:12 +0100 Subject: [PATCH] vim: import from old packages Signed-off-by: Marko Ratkaj --- utils/vim/Makefile | 193 ++++++++++++++++++++++++++++ utils/vim/files/vimrc | 11 ++ utils/vim/files/vimrc.full | 28 ++++ utils/vim/patches/001-compile.patch | 41 ++++++ 4 files changed, 273 insertions(+) create mode 100644 utils/vim/Makefile create mode 100644 utils/vim/files/vimrc create mode 100644 utils/vim/files/vimrc.full create mode 100644 utils/vim/patches/001-compile.patch diff --git a/utils/vim/Makefile b/utils/vim/Makefile new file mode 100644 index 0000000000..9e43821723 --- /dev/null +++ b/utils/vim/Makefile @@ -0,0 +1,193 @@ +# +# Copyright (C) 2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=vim +PKG_VERSION:=7.4 +PKG_RELEASE:=1 +VIMVER:=74 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=ftp://ftp.vim.org/pub/vim/unix/ +PKG_MD5SUM:=607e135c559be642f210094ad023dc65 +PKG_MAINTAINER:=Marko Ratkaj + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)$(VIMVER) +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/vim/Default + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libncurses + TITLE:=Vi IMproved - enhanced vi editor + URL:=http://www.vim.org/ + SUBMENU:=Editors +endef + +define Package/vim + $(call Package/vim/Default) + TITLE+= (Tiny) +endef + +define Package/vim-full + $(call Package/vim/Default) + TITLE+= (Normal) +endef + +define Package/vim-runtime + $(call Package/vim/Default) + TITLE+= (runtime files) +endef + +define Package/vim-help + $(call Package/vim/Default) + TITLE+= (help files) +endef + +define Package/xxd + SECTION:=utils + CATEGORY:=Utilities + TITLE:=make a hexdump or do the reverse + URL:=http://www.vim.org/ +endef + +define Package/vim-full/conffiles +/usr/share/vim/vimrc +/root/.vimrc +endef + +define Package/vim/conffiles +/usr/share/vim/vimrc +/root/.vimrc +endef + +define Package/vim/description + Vim is an almost compatible version of the UNIX editor Vi. + (Tiny build) +endef + +define Package/vim-full/description + Vim is an almost compatible version of the UNIX editor Vi. + (Normal build) +endef + +define Package/vim-runtime/description + Vim is an almost compatible version of the UNIX editor Vi. + (Runtime files) +endef + +define Package/vim-help/description + Vim is an almost compatible version of the UNIX editor Vi. + (Help files) +endef + +define Package/xxd/description + xxd creates a hex dump of a given file or standard input, it can also convert + a hex dump back to its original binary form. +endef + +CONFIGURE_ARGS += \ + --disable-gui \ + --disable-gtktest \ + --disable-xim \ + --without-x \ + --disable-netbeans \ + --disable-cscope \ + --disable-gpm \ + --with-tlib=ncurses + +CONFIGURE_VARS += \ + vim_cv_getcwd_broken=no \ + vim_cv_memmove_handles_overlap=yes \ + vim_cv_stat_ignores_slash=yes \ + vim_cv_tgetent=zero \ + vim_cv_terminfo=yes \ + vim_cv_toupper_broken=no \ + vim_cv_tty_group=root \ + vim_cv_tty_mode=0620 + +ifneq ($(CONFIG_PACKAGE_vim),) +define Build/Compile/vim + $(call Build/Configure/Default, \ + --with-features=tiny \ + --disable-multibyte \ + ) + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" all + $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_tiny +endef +endif + +ifneq ($(CONFIG_PACKAGE_vim-full),) +define Build/Compile/vim-full + $(call Build/Configure/Default, \ + --with-features=normal \ + --enable-multibyte \ + ) + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" all + $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_normal +endef +endif + +ifneq ($(CONFIG_PACKAGE_xxd),) +define Build/Compile/xxd + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" all +endef +endif + +define Build/Compile/vim-runtime + $(MAKE) -C $(PKG_BUILD_DIR)/src DESTDIR="$(PKG_INSTALL_DIR)" installrtbase + (cd $(PKG_INSTALL_DIR) && tar -cf $(PKG_BUILD_DIR)/docs.tar ./usr/share/vim/vim$(VIMVER)/doc) + rm -rf $(PKG_INSTALL_DIR)/usr/share/vim/vim$(VIMVER)/doc + rm -rf $(PKG_INSTALL_DIR)/usr/man +endef + +define Build/Compile +$(call Build/Compile/vim) +$(call Build/Compile/vim-full) +$(call Build/Compile/vim-runtime) +$(call Build/Compile/xxd) +endef + +define Package/vim/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_tiny $(1)/usr/bin/vim + $(INSTALL_DIR) $(1)/usr/share/vim + $(INSTALL_CONF) ./files/vimrc $(1)/usr/share/vim/ +endef + +define Package/vim-full/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_normal $(1)/usr/bin/vim + $(INSTALL_DIR) $(1)/usr/share/vim + $(INSTALL_CONF) ./files/vimrc.full $(1)/usr/share/vim/vimrc +endef + +define Package/vim-runtime/install + $(CP) $(PKG_INSTALL_DIR)/* $(1) + rm -rf $(1)/usr/share/vim/vim$(VIMVER)/doc +endef + +define Package/vim-help/install + tar -C $(1) -xf $(PKG_BUILD_DIR)/docs.tar +endef + +define Package/xxd/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/xxd/xxd $(1)/usr/bin +endef + +$(eval $(call BuildPackage,vim)) +$(eval $(call BuildPackage,vim-full)) +$(eval $(call BuildPackage,vim-runtime)) +$(eval $(call BuildPackage,vim-help)) +$(eval $(call BuildPackage,xxd)) diff --git a/utils/vim/files/vimrc b/utils/vim/files/vimrc new file mode 100644 index 0000000000..2622b773bc --- /dev/null +++ b/utils/vim/files/vimrc @@ -0,0 +1,11 @@ +set showcmd " show (partial) command in status line +set showmatch " show matching brackets +set incsearch " incremental search +set autowrite " automatically save before commands like :next and :make +set nocompatible " use vim defaults instead of 100% vi compatibility +set backspace=indent,eol,start " more powerful backspacing +set autoindent " always set autoindenting on +set linebreak " don't wrap words by default +set textwidth=0 " don't wrap lines by default +set ruler " show the cursor position all the time + diff --git a/utils/vim/files/vimrc.full b/utils/vim/files/vimrc.full new file mode 100644 index 0000000000..56305c1527 --- /dev/null +++ b/utils/vim/files/vimrc.full @@ -0,0 +1,28 @@ +set showcmd " show (partial) command in status line +set showmatch " show matching brackets +set incsearch " incremental search +set autowrite " automatically save before commands like :next and :make +set nocompatible " use Vim defaults instead of 100% vi compatibility +set backspace=indent,eol,start " more powerful backspacing +set autoindent " always set autoindenting on +set linebreak " don't wrap words by default +set textwidth=0 " don't wrap lines by default +set ruler " show the cursor position all the time + +if filereadable(expand("$VIMRUNTIME/syntax/synload.vim")) + syntax on +endif +if has("syntax") && &term =~ "xterm" + set t_Co=8 + if has("terminfo") + set t_Sf=[3%p1%dm + set t_Sb=[4%p1%dm + else + set t_Sf=[3%dm + set t_Sb=[4%dm + endif +endif + +" Uncomment out for line and/or relative numberig +" set number +" set rnu diff --git a/utils/vim/patches/001-compile.patch b/utils/vim/patches/001-compile.patch new file mode 100644 index 0000000000..6740f1a8e4 --- /dev/null +++ b/utils/vim/patches/001-compile.patch @@ -0,0 +1,41 @@ +--- a/src/auto/configure ++++ b/src/auto/configure +@@ -12294,37 +12294,8 @@ _ACEOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking uint32_t is 32 bits" >&5 + $as_echo_n "checking uint32_t is 32 bits... " >&6; } +-if test "$cross_compiling" = yes; then : +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check uint32_t when cross-compiling." >&5 +-$as_echo "$as_me: WARNING: cannot check uint32_t when cross-compiling." >&2;} +-else +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +- +-#ifdef HAVE_STDINT_H +-# include +-#endif +-#ifdef HAVE_INTTYPES_H +-# include +-#endif +-main() { +- uint32_t nr1 = (uint32_t)-1; +- uint32_t nr2 = (uint32_t)0xffffffffUL; +- if (sizeof(uint32_t) != 4 || nr1 != 0xffffffffUL || nr2 + 1 != 0) exit(1); +- exit(0); +-} +-_ACEOF +-if ac_fn_c_try_run "$LINENO"; then : +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming ok" >&5 + $as_echo "ok" >&6; } +-else +- as_fn_error "WRONG! uint32_t not defined correctly." "$LINENO" 5 +-fi +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ +- conftest.$ac_objext conftest.beam conftest.$ac_ext +-fi +- +- + + bcopy_test_prog=' + #include "confdefs.h" -- 2.30.2