You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

193 lines
4.4 KiB

  1. #
  2. # Copyright (C) 2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=vim
  9. PKG_VERSION:=7.4
  10. PKG_RELEASE:=1
  11. VIMVER:=74
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  13. PKG_SOURCE_URL:=ftp://ftp.vim.org/pub/vim/unix/
  14. PKG_MD5SUM:=607e135c559be642f210094ad023dc65
  15. PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
  16. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)$(VIMVER)
  17. PKG_BUILD_PARALLEL:=1
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/vim/Default
  20. SECTION:=utils
  21. CATEGORY:=Utilities
  22. DEPENDS:=+libncurses
  23. TITLE:=Vi IMproved - enhanced vi editor
  24. URL:=http://www.vim.org/
  25. SUBMENU:=Editors
  26. endef
  27. define Package/vim
  28. $(call Package/vim/Default)
  29. TITLE+= (Tiny)
  30. endef
  31. define Package/vim-full
  32. $(call Package/vim/Default)
  33. TITLE+= (Normal)
  34. endef
  35. define Package/vim-runtime
  36. $(call Package/vim/Default)
  37. TITLE+= (runtime files)
  38. endef
  39. define Package/vim-help
  40. $(call Package/vim/Default)
  41. TITLE+= (help files)
  42. endef
  43. define Package/xxd
  44. SECTION:=utils
  45. CATEGORY:=Utilities
  46. TITLE:=make a hexdump or do the reverse
  47. URL:=http://www.vim.org/
  48. endef
  49. define Package/vim-full/conffiles
  50. /usr/share/vim/vimrc
  51. /root/.vimrc
  52. endef
  53. define Package/vim/conffiles
  54. /usr/share/vim/vimrc
  55. /root/.vimrc
  56. endef
  57. define Package/vim/description
  58. Vim is an almost compatible version of the UNIX editor Vi.
  59. (Tiny build)
  60. endef
  61. define Package/vim-full/description
  62. Vim is an almost compatible version of the UNIX editor Vi.
  63. (Normal build)
  64. endef
  65. define Package/vim-runtime/description
  66. Vim is an almost compatible version of the UNIX editor Vi.
  67. (Runtime files)
  68. endef
  69. define Package/vim-help/description
  70. Vim is an almost compatible version of the UNIX editor Vi.
  71. (Help files)
  72. endef
  73. define Package/xxd/description
  74. xxd creates a hex dump of a given file or standard input, it can also convert
  75. a hex dump back to its original binary form.
  76. endef
  77. CONFIGURE_ARGS += \
  78. --disable-gui \
  79. --disable-gtktest \
  80. --disable-xim \
  81. --without-x \
  82. --disable-netbeans \
  83. --disable-cscope \
  84. --disable-gpm \
  85. --with-tlib=ncurses
  86. CONFIGURE_VARS += \
  87. vim_cv_getcwd_broken=no \
  88. vim_cv_memmove_handles_overlap=yes \
  89. vim_cv_stat_ignores_slash=yes \
  90. vim_cv_tgetent=zero \
  91. vim_cv_terminfo=yes \
  92. vim_cv_toupper_broken=no \
  93. vim_cv_tty_group=root \
  94. vim_cv_tty_mode=0620
  95. ifneq ($(CONFIG_PACKAGE_vim),)
  96. define Build/Compile/vim
  97. $(call Build/Configure/Default, \
  98. --with-features=tiny \
  99. --disable-multibyte \
  100. )
  101. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  102. DESTDIR="$(PKG_INSTALL_DIR)" all
  103. $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_tiny
  104. endef
  105. endif
  106. ifneq ($(CONFIG_PACKAGE_vim-full),)
  107. define Build/Compile/vim-full
  108. $(call Build/Configure/Default, \
  109. --with-features=normal \
  110. --enable-multibyte \
  111. )
  112. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  113. DESTDIR="$(PKG_INSTALL_DIR)" all
  114. $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_normal
  115. endef
  116. endif
  117. ifneq ($(CONFIG_PACKAGE_xxd),)
  118. define Build/Compile/xxd
  119. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  120. DESTDIR="$(PKG_INSTALL_DIR)" all
  121. endef
  122. endif
  123. define Build/Compile/vim-runtime
  124. $(MAKE) -C $(PKG_BUILD_DIR)/src DESTDIR="$(PKG_INSTALL_DIR)" installrtbase
  125. (cd $(PKG_INSTALL_DIR) && tar -cf $(PKG_BUILD_DIR)/docs.tar ./usr/share/vim/vim$(VIMVER)/doc)
  126. rm -rf $(PKG_INSTALL_DIR)/usr/share/vim/vim$(VIMVER)/doc
  127. rm -rf $(PKG_INSTALL_DIR)/usr/man
  128. endef
  129. define Build/Compile
  130. $(call Build/Compile/vim)
  131. $(call Build/Compile/vim-full)
  132. $(call Build/Compile/vim-runtime)
  133. $(call Build/Compile/xxd)
  134. endef
  135. define Package/vim/install
  136. $(INSTALL_DIR) $(1)/usr/bin
  137. $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_tiny $(1)/usr/bin/vim
  138. $(INSTALL_DIR) $(1)/usr/share/vim
  139. $(INSTALL_CONF) ./files/vimrc $(1)/usr/share/vim/
  140. endef
  141. define Package/vim-full/install
  142. $(INSTALL_DIR) $(1)/usr/bin
  143. $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_normal $(1)/usr/bin/vim
  144. $(INSTALL_DIR) $(1)/usr/share/vim
  145. $(INSTALL_CONF) ./files/vimrc.full $(1)/usr/share/vim/vimrc
  146. endef
  147. define Package/vim-runtime/install
  148. $(CP) $(PKG_INSTALL_DIR)/* $(1)
  149. rm -rf $(1)/usr/share/vim/vim$(VIMVER)/doc
  150. endef
  151. define Package/vim-help/install
  152. tar -C $(1) -xf $(PKG_BUILD_DIR)/docs.tar
  153. endef
  154. define Package/xxd/install
  155. $(INSTALL_DIR) $(1)/usr/bin
  156. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/xxd/xxd $(1)/usr/bin
  157. endef
  158. $(eval $(call BuildPackage,vim))
  159. $(eval $(call BuildPackage,vim-full))
  160. $(eval $(call BuildPackage,vim-runtime))
  161. $(eval $(call BuildPackage,vim-help))
  162. $(eval $(call BuildPackage,xxd))