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.

260 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.2
  10. PKG_RELEASE:=4
  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. --disable-selinux \
  108. --with-tlib=ncurses \
  109. --with-compiledby="non-existent-hostname-compiled"
  110. CONFIGURE_VARS += \
  111. ac_cv_header_elf_h=no \
  112. vim_cv_getcwd_broken=no \
  113. vim_cv_memmove_handles_overlap=yes \
  114. vim_cv_stat_ignores_slash=yes \
  115. vim_cv_tgetent=zero \
  116. vim_cv_terminfo=yes \
  117. vim_cv_toupper_broken=no \
  118. vim_cv_tty_group=root \
  119. vim_cv_tty_mode=0620
  120. ifneq ($(HOST_OS),Linux)
  121. TARGET_PATH_PKG:=$(CURDIR)/scripts:$(TARGET_PATH_PKG)
  122. endif
  123. define Build/Prepare
  124. $(call Build/Prepare/Default)
  125. $(MAKE) -C $(PKG_BUILD_DIR)/src autoconf
  126. endef
  127. ifneq ($(CONFIG_PACKAGE_vim),)
  128. define Build/Compile/vim
  129. $(call Build/Configure/Default, \
  130. --with-features=tiny \
  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. )
  142. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  143. DESTDIR="$(PKG_INSTALL_DIR)" all
  144. $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_normal
  145. endef
  146. endif
  147. ifneq ($(CONFIG_PACKAGE_vim-fuller),)
  148. define Build/Compile/vim-fuller
  149. $(call Build/Configure/Default, \
  150. --with-features=big \
  151. )
  152. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  153. DESTDIR="$(PKG_INSTALL_DIR)" all
  154. $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_big
  155. endef
  156. endif
  157. ifneq ($(CONFIG_PACKAGE_xxd),)
  158. define Build/Compile/xxd
  159. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  160. DESTDIR="$(PKG_INSTALL_DIR)" all
  161. endef
  162. endif
  163. define Build/Compile/vim-runtime
  164. $(MAKE) -C $(PKG_BUILD_DIR)/src DESTDIR="$(PKG_INSTALL_DIR)" installrtbase
  165. (cd $(PKG_INSTALL_DIR) && tar -cf $(PKG_BUILD_DIR)/docs.tar ./usr/share/vim/vim$(VIMVER)/doc)
  166. rm -rf $(PKG_INSTALL_DIR)/usr/share/vim/vim$(VIMVER)/doc
  167. rm -rf $(PKG_INSTALL_DIR)/usr/man
  168. endef
  169. define Build/Compile
  170. $(call Build/Compile/vim)
  171. $(call Build/Compile/vim-full)
  172. $(call Build/Compile/vim-fuller)
  173. $(call Build/Compile/vim-runtime)
  174. $(call Build/Compile/xxd)
  175. endef
  176. define Package/vim/install
  177. $(INSTALL_DIR) $(1)/usr/bin
  178. $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_tiny $(1)/usr/bin/vim
  179. $(INSTALL_DIR) $(1)/usr/share/vim
  180. $(INSTALL_CONF) ./files/vimrc $(1)/usr/share/vim/
  181. endef
  182. define Package/vim-full/install
  183. $(INSTALL_DIR) $(1)/usr/bin
  184. $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_normal $(1)/usr/bin/vim
  185. $(INSTALL_DIR) $(1)/usr/share/vim
  186. $(LN) vim $(1)/usr/bin/vimdiff
  187. $(INSTALL_CONF) ./files/vimrc.full $(1)/usr/share/vim/vimrc
  188. endef
  189. define Package/vim-fuller/install
  190. $(INSTALL_DIR) $(1)/usr/bin
  191. $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_big $(1)/usr/bin/vim
  192. $(INSTALL_DIR) $(1)/usr/share/vim
  193. $(LN) vim $(1)/usr/bin/vimdiff
  194. $(CP) $(PKG_INSTALL_DIR)/usr/share/vim/vim$(VIMVER) $(1)/usr/share/vim
  195. $(INSTALL_CONF) ./files/vimrc.full $(1)/usr/share/vim/vimrc
  196. endef
  197. define Package/vim-runtime/install
  198. $(CP) $(PKG_INSTALL_DIR)/* $(1)
  199. rm -rf $(1)/usr/share/vim/vim$(VIMVER)/doc
  200. endef
  201. define Package/vim-help/install
  202. tar -C $(1) -xf $(PKG_BUILD_DIR)/docs.tar
  203. endef
  204. define Package/xxd/install
  205. $(INSTALL_DIR) $(1)/usr/bin
  206. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/xxd/xxd $(1)/usr/bin
  207. endef
  208. $(eval $(call BuildPackage,vim))
  209. $(eval $(call BuildPackage,vim-full))
  210. $(eval $(call BuildPackage,vim-fuller))
  211. $(eval $(call BuildPackage,vim-runtime))
  212. $(eval $(call BuildPackage,vim-help))
  213. $(eval $(call BuildPackage,xxd))
  214. $(eval $(call HostBuild))