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.

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