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.

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