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.

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