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.

258 lines
5.9 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:=1
  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. 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. )
  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_tiny
  134. endef
  135. endif
  136. ifneq ($(CONFIG_PACKAGE_vim-full),)
  137. define Build/Compile/vim-full
  138. $(call Build/Configure/Default, \
  139. --with-features=normal \
  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_normal
  144. endef
  145. endif
  146. ifneq ($(CONFIG_PACKAGE_vim-fuller),)
  147. define Build/Compile/vim-fuller
  148. $(call Build/Configure/Default, \
  149. --with-features=big \
  150. )
  151. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  152. DESTDIR="$(PKG_INSTALL_DIR)" all
  153. $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_big
  154. endef
  155. endif
  156. ifneq ($(CONFIG_PACKAGE_xxd),)
  157. define Build/Compile/xxd
  158. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  159. DESTDIR="$(PKG_INSTALL_DIR)" all
  160. endef
  161. endif
  162. define Build/Compile/vim-runtime
  163. $(MAKE) -C $(PKG_BUILD_DIR)/src DESTDIR="$(PKG_INSTALL_DIR)" installrtbase
  164. (cd $(PKG_INSTALL_DIR) && tar -cf $(PKG_BUILD_DIR)/docs.tar ./usr/share/vim/vim$(VIMVER)/doc)
  165. rm -rf $(PKG_INSTALL_DIR)/usr/share/vim/vim$(VIMVER)/doc
  166. rm -rf $(PKG_INSTALL_DIR)/usr/man
  167. endef
  168. define Build/Compile
  169. $(call Build/Compile/vim)
  170. $(call Build/Compile/vim-full)
  171. $(call Build/Compile/vim-fuller)
  172. $(call Build/Compile/vim-runtime)
  173. $(call Build/Compile/xxd)
  174. endef
  175. define Package/vim/install
  176. $(INSTALL_DIR) $(1)/usr/bin
  177. $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_tiny $(1)/usr/bin/vim
  178. $(INSTALL_DIR) $(1)/usr/share/vim
  179. $(INSTALL_CONF) ./files/vimrc $(1)/usr/share/vim/
  180. endef
  181. define Package/vim-full/install
  182. $(INSTALL_DIR) $(1)/usr/bin
  183. $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_normal $(1)/usr/bin/vim
  184. $(INSTALL_DIR) $(1)/usr/share/vim
  185. $(INSTALL_CONF) ./files/vimrc.full $(1)/usr/share/vim/vimrc
  186. endef
  187. define Package/vim-fuller/install
  188. $(INSTALL_DIR) $(1)/usr/bin
  189. $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_big $(1)/usr/bin/vim
  190. $(INSTALL_DIR) $(1)/usr/share/vim
  191. $(LN) vim $(1)/usr/bin/vimdiff
  192. $(CP) $(PKG_INSTALL_DIR)/usr/share/vim/vim$(VIMVER) $(1)/usr/share/vim
  193. $(INSTALL_CONF) ./files/vimrc.full $(1)/usr/share/vim/vimrc
  194. endef
  195. define Package/vim-runtime/install
  196. $(CP) $(PKG_INSTALL_DIR)/* $(1)
  197. rm -rf $(1)/usr/share/vim/vim$(VIMVER)/doc
  198. endef
  199. define Package/vim-help/install
  200. tar -C $(1) -xf $(PKG_BUILD_DIR)/docs.tar
  201. endef
  202. define Package/xxd/install
  203. $(INSTALL_DIR) $(1)/usr/bin
  204. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/xxd/xxd $(1)/usr/bin
  205. endef
  206. $(eval $(call BuildPackage,vim))
  207. $(eval $(call BuildPackage,vim-full))
  208. $(eval $(call BuildPackage,vim-fuller))
  209. $(eval $(call BuildPackage,vim-runtime))
  210. $(eval $(call BuildPackage,vim-help))
  211. $(eval $(call BuildPackage,xxd))
  212. $(eval $(call HostBuild))