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