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.

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