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.

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