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.

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