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.

239 lines
5.5 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:=2
  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. --with-compiledby="non-existent-hostname-compiled"
  96. CONFIGURE_VARS += \
  97. vim_cv_getcwd_broken=no \
  98. vim_cv_memmove_handles_overlap=yes \
  99. vim_cv_stat_ignores_slash=yes \
  100. vim_cv_tgetent=zero \
  101. vim_cv_terminfo=yes \
  102. vim_cv_toupper_broken=no \
  103. vim_cv_tty_group=root \
  104. vim_cv_tty_mode=0620
  105. define Build/Prepare
  106. $(call Build/Prepare/Default)
  107. $(MAKE) -C $(PKG_BUILD_DIR)/src autoconf
  108. endef
  109. ifneq ($(CONFIG_PACKAGE_vim),)
  110. define Build/Compile/vim
  111. $(call Build/Configure/Default, \
  112. --with-features=tiny \
  113. --disable-multibyte \
  114. )
  115. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  116. DESTDIR="$(PKG_INSTALL_DIR)" all
  117. $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_tiny
  118. endef
  119. endif
  120. ifneq ($(CONFIG_PACKAGE_vim-full),)
  121. define Build/Compile/vim-full
  122. $(call Build/Configure/Default, \
  123. --with-features=normal \
  124. --enable-multibyte \
  125. )
  126. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  127. DESTDIR="$(PKG_INSTALL_DIR)" all
  128. $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_normal
  129. endef
  130. endif
  131. ifneq ($(CONFIG_PACKAGE_vim-fuller),)
  132. define Build/Compile/vim-fuller
  133. $(call Build/Configure/Default, \
  134. --with-features=big \
  135. --enable-multibyte \
  136. )
  137. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  138. DESTDIR="$(PKG_INSTALL_DIR)" all
  139. $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_big
  140. endef
  141. endif
  142. ifneq ($(CONFIG_PACKAGE_xxd),)
  143. define Build/Compile/xxd
  144. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  145. DESTDIR="$(PKG_INSTALL_DIR)" all
  146. endef
  147. endif
  148. define Build/Compile/vim-runtime
  149. $(MAKE) -C $(PKG_BUILD_DIR)/src DESTDIR="$(PKG_INSTALL_DIR)" installrtbase
  150. (cd $(PKG_INSTALL_DIR) && tar -cf $(PKG_BUILD_DIR)/docs.tar ./usr/share/vim/vim$(VIMVER)/doc)
  151. rm -rf $(PKG_INSTALL_DIR)/usr/share/vim/vim$(VIMVER)/doc
  152. rm -rf $(PKG_INSTALL_DIR)/usr/man
  153. endef
  154. define Build/Compile
  155. $(call Build/Compile/vim)
  156. $(call Build/Compile/vim-full)
  157. $(call Build/Compile/vim-fuller)
  158. $(call Build/Compile/vim-runtime)
  159. $(call Build/Compile/xxd)
  160. endef
  161. define Package/vim/install
  162. $(INSTALL_DIR) $(1)/usr/bin
  163. $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_tiny $(1)/usr/bin/vim
  164. $(INSTALL_DIR) $(1)/usr/share/vim
  165. $(INSTALL_CONF) ./files/vimrc $(1)/usr/share/vim/
  166. endef
  167. define Package/vim-full/install
  168. $(INSTALL_DIR) $(1)/usr/bin
  169. $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_normal $(1)/usr/bin/vim
  170. $(INSTALL_DIR) $(1)/usr/share/vim
  171. $(INSTALL_CONF) ./files/vimrc.full $(1)/usr/share/vim/vimrc
  172. endef
  173. define Package/vim-fuller/install
  174. $(INSTALL_DIR) $(1)/usr/bin
  175. $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_big $(1)/usr/bin/vim
  176. $(INSTALL_DIR) $(1)/usr/share/vim
  177. $(CP) -r $(PKG_INSTALL_DIR)/usr/share/vim/vim$(VIMVER) $(1)/usr/share/vim
  178. $(INSTALL_CONF) ./files/vimrc.full $(1)/usr/share/vim/vimrc
  179. endef
  180. define Package/vim-runtime/install
  181. $(CP) $(PKG_INSTALL_DIR)/* $(1)
  182. rm -rf $(1)/usr/share/vim/vim$(VIMVER)/doc
  183. endef
  184. define Package/vim-help/install
  185. tar -C $(1) -xf $(PKG_BUILD_DIR)/docs.tar
  186. endef
  187. define Package/xxd/install
  188. $(INSTALL_DIR) $(1)/usr/bin
  189. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/xxd/xxd $(1)/usr/bin
  190. endef
  191. $(eval $(call BuildPackage,vim))
  192. $(eval $(call BuildPackage,vim-full))
  193. $(eval $(call BuildPackage,vim-fuller))
  194. $(eval $(call BuildPackage,vim-runtime))
  195. $(eval $(call BuildPackage,vim-help))
  196. $(eval $(call BuildPackage,xxd))