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.

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