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.

233 lines
5.3 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:=8.0.586
  10. PKG_RELEASE:=1
  11. VIMVER:=80
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  13. PKG_SOURCE_URL:=ftp://ftp.vim.org/pub/vim/unix/
  14. PKG_HASH:=08bd0d1dd30ece3cb9905ccd48b82b2f81c861696377508021265177dc153a61
  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-fuller
  36. $(call Package/vim/Default)
  37. TITLE+= (Big)
  38. endef
  39. define Package/vim-runtime
  40. $(call Package/vim/Default)
  41. TITLE+= (runtime files)
  42. endef
  43. define Package/vim-help
  44. $(call Package/vim/Default)
  45. TITLE+= (help files)
  46. endef
  47. define Package/xxd
  48. SECTION:=utils
  49. CATEGORY:=Utilities
  50. TITLE:=make a hexdump or do the reverse
  51. URL:=http://www.vim.org/
  52. endef
  53. define Package/vim-full/conffiles
  54. /usr/share/vim/vimrc
  55. /root/.vimrc
  56. endef
  57. define Package/vim/conffiles
  58. /usr/share/vim/vimrc
  59. /root/.vimrc
  60. endef
  61. define Package/vim/description
  62. Vim is an almost compatible version of the UNIX editor Vi.
  63. (Tiny build)
  64. endef
  65. define Package/vim-full/description
  66. Vim is an almost compatible version of the UNIX editor Vi.
  67. (Normal build)
  68. endef
  69. define Package/vim-fuller/description
  70. Vim is an almost compatible version of the UNIX editor Vi.
  71. (Big build)
  72. endef
  73. define Package/vim-runtime/description
  74. Vim is an almost compatible version of the UNIX editor Vi.
  75. (Runtime files)
  76. endef
  77. define Package/vim-help/description
  78. Vim is an almost compatible version of the UNIX editor Vi.
  79. (Help files)
  80. endef
  81. define Package/xxd/description
  82. xxd creates a hex dump of a given file or standard input, it can also convert
  83. a hex dump back to its original binary form.
  84. endef
  85. CONFIGURE_ARGS += \
  86. --disable-gui \
  87. --disable-gtktest \
  88. --disable-xim \
  89. --without-x \
  90. --disable-netbeans \
  91. --disable-cscope \
  92. --disable-gpm \
  93. --disable-acl \
  94. --with-tlib=ncurses
  95. CONFIGURE_VARS += \
  96. vim_cv_getcwd_broken=no \
  97. vim_cv_memmove_handles_overlap=yes \
  98. vim_cv_stat_ignores_slash=yes \
  99. vim_cv_tgetent=zero \
  100. vim_cv_terminfo=yes \
  101. vim_cv_toupper_broken=no \
  102. vim_cv_tty_group=root \
  103. vim_cv_tty_mode=0620
  104. ifneq ($(CONFIG_PACKAGE_vim),)
  105. define Build/Compile/vim
  106. $(call Build/Configure/Default, \
  107. --with-features=tiny \
  108. --disable-multibyte \
  109. )
  110. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  111. DESTDIR="$(PKG_INSTALL_DIR)" all
  112. $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_tiny
  113. endef
  114. endif
  115. ifneq ($(CONFIG_PACKAGE_vim-full),)
  116. define Build/Compile/vim-full
  117. $(call Build/Configure/Default, \
  118. --with-features=normal \
  119. --enable-multibyte \
  120. )
  121. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  122. DESTDIR="$(PKG_INSTALL_DIR)" all
  123. $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_normal
  124. endef
  125. endif
  126. ifneq ($(CONFIG_PACKAGE_vim-fuller),)
  127. define Build/Compile/vim-fuller
  128. $(call Build/Configure/Default, \
  129. --with-features=big \
  130. --enable-multibyte \
  131. )
  132. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  133. DESTDIR="$(PKG_INSTALL_DIR)" all
  134. $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_big
  135. endef
  136. endif
  137. ifneq ($(CONFIG_PACKAGE_xxd),)
  138. define Build/Compile/xxd
  139. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  140. DESTDIR="$(PKG_INSTALL_DIR)" all
  141. endef
  142. endif
  143. define Build/Compile/vim-runtime
  144. $(MAKE) -C $(PKG_BUILD_DIR)/src DESTDIR="$(PKG_INSTALL_DIR)" installrtbase
  145. (cd $(PKG_INSTALL_DIR) && tar -cf $(PKG_BUILD_DIR)/docs.tar ./usr/share/vim/vim$(VIMVER)/doc)
  146. rm -rf $(PKG_INSTALL_DIR)/usr/share/vim/vim$(VIMVER)/doc
  147. rm -rf $(PKG_INSTALL_DIR)/usr/man
  148. endef
  149. define Build/Compile
  150. $(call Build/Compile/vim)
  151. $(call Build/Compile/vim-full)
  152. $(call Build/Compile/vim-fuller)
  153. $(call Build/Compile/vim-runtime)
  154. $(call Build/Compile/xxd)
  155. endef
  156. define Package/vim/install
  157. $(INSTALL_DIR) $(1)/usr/bin
  158. $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_tiny $(1)/usr/bin/vim
  159. $(INSTALL_DIR) $(1)/usr/share/vim
  160. $(INSTALL_CONF) ./files/vimrc $(1)/usr/share/vim/
  161. endef
  162. define Package/vim-full/install
  163. $(INSTALL_DIR) $(1)/usr/bin
  164. $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_normal $(1)/usr/bin/vim
  165. $(INSTALL_DIR) $(1)/usr/share/vim
  166. $(INSTALL_CONF) ./files/vimrc.full $(1)/usr/share/vim/vimrc
  167. endef
  168. define Package/vim-fuller/install
  169. $(INSTALL_DIR) $(1)/usr/bin
  170. $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_big $(1)/usr/bin/vim
  171. $(INSTALL_DIR) $(1)/usr/share/vim
  172. $(CP) -r $(PKG_INSTALL_DIR)/usr/share/vim/vim$(VIMVER) $(1)/usr/share/vim
  173. $(INSTALL_CONF) ./files/vimrc.full $(1)/usr/share/vim/vimrc
  174. endef
  175. define Package/vim-runtime/install
  176. $(CP) $(PKG_INSTALL_DIR)/* $(1)
  177. rm -rf $(1)/usr/share/vim/vim$(VIMVER)/doc
  178. endef
  179. define Package/vim-help/install
  180. tar -C $(1) -xf $(PKG_BUILD_DIR)/docs.tar
  181. endef
  182. define Package/xxd/install
  183. $(INSTALL_DIR) $(1)/usr/bin
  184. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/xxd/xxd $(1)/usr/bin
  185. endef
  186. $(eval $(call BuildPackage,vim))
  187. $(eval $(call BuildPackage,vim-full))
  188. $(eval $(call BuildPackage,vim-fuller))
  189. $(eval $(call BuildPackage,vim-runtime))
  190. $(eval $(call BuildPackage,vim-help))
  191. $(eval $(call BuildPackage,xxd))