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.

194 lines
4.4 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:=7.4
  10. PKG_RELEASE:=3
  11. VIMVER:=74
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  13. PKG_SOURCE_URL:=ftp://ftp.vim.org/pub/vim/unix/
  14. PKG_MD5SUM:=607e135c559be642f210094ad023dc65
  15. PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
  16. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)$(VIMVER)
  17. PKG_BUILD_PARALLEL:=1
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/vim/Default
  20. SECTION:=utils
  21. CATEGORY:=Utilities
  22. DEPENDS:=+libncurses
  23. TITLE:=Vi IMproved - enhanced vi editor
  24. URL:=http://www.vim.org/
  25. SUBMENU:=Editors
  26. endef
  27. define Package/vim
  28. $(call Package/vim/Default)
  29. TITLE+= (Tiny)
  30. endef
  31. define Package/vim-full
  32. $(call Package/vim/Default)
  33. TITLE+= (Normal)
  34. endef
  35. define Package/vim-runtime
  36. $(call Package/vim/Default)
  37. TITLE+= (runtime files)
  38. endef
  39. define Package/vim-help
  40. $(call Package/vim/Default)
  41. TITLE+= (help files)
  42. endef
  43. define Package/xxd
  44. SECTION:=utils
  45. CATEGORY:=Utilities
  46. TITLE:=make a hexdump or do the reverse
  47. URL:=http://www.vim.org/
  48. endef
  49. define Package/vim-full/conffiles
  50. /usr/share/vim/vimrc
  51. /root/.vimrc
  52. endef
  53. define Package/vim/conffiles
  54. /usr/share/vim/vimrc
  55. /root/.vimrc
  56. endef
  57. define Package/vim/description
  58. Vim is an almost compatible version of the UNIX editor Vi.
  59. (Tiny build)
  60. endef
  61. define Package/vim-full/description
  62. Vim is an almost compatible version of the UNIX editor Vi.
  63. (Normal build)
  64. endef
  65. define Package/vim-runtime/description
  66. Vim is an almost compatible version of the UNIX editor Vi.
  67. (Runtime files)
  68. endef
  69. define Package/vim-help/description
  70. Vim is an almost compatible version of the UNIX editor Vi.
  71. (Help files)
  72. endef
  73. define Package/xxd/description
  74. xxd creates a hex dump of a given file or standard input, it can also convert
  75. a hex dump back to its original binary form.
  76. endef
  77. CONFIGURE_ARGS += \
  78. --disable-gui \
  79. --disable-gtktest \
  80. --disable-xim \
  81. --without-x \
  82. --disable-netbeans \
  83. --disable-cscope \
  84. --disable-gpm \
  85. --disable-acl \
  86. --with-tlib=ncurses
  87. CONFIGURE_VARS += \
  88. vim_cv_getcwd_broken=no \
  89. vim_cv_memmove_handles_overlap=yes \
  90. vim_cv_stat_ignores_slash=yes \
  91. vim_cv_tgetent=zero \
  92. vim_cv_terminfo=yes \
  93. vim_cv_toupper_broken=no \
  94. vim_cv_tty_group=root \
  95. vim_cv_tty_mode=0620
  96. ifneq ($(CONFIG_PACKAGE_vim),)
  97. define Build/Compile/vim
  98. $(call Build/Configure/Default, \
  99. --with-features=tiny \
  100. --disable-multibyte \
  101. )
  102. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  103. DESTDIR="$(PKG_INSTALL_DIR)" all
  104. $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_tiny
  105. endef
  106. endif
  107. ifneq ($(CONFIG_PACKAGE_vim-full),)
  108. define Build/Compile/vim-full
  109. $(call Build/Configure/Default, \
  110. --with-features=normal \
  111. --enable-multibyte \
  112. )
  113. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  114. DESTDIR="$(PKG_INSTALL_DIR)" all
  115. $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_normal
  116. endef
  117. endif
  118. ifneq ($(CONFIG_PACKAGE_xxd),)
  119. define Build/Compile/xxd
  120. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  121. DESTDIR="$(PKG_INSTALL_DIR)" all
  122. endef
  123. endif
  124. define Build/Compile/vim-runtime
  125. $(MAKE) -C $(PKG_BUILD_DIR)/src DESTDIR="$(PKG_INSTALL_DIR)" installrtbase
  126. (cd $(PKG_INSTALL_DIR) && tar -cf $(PKG_BUILD_DIR)/docs.tar ./usr/share/vim/vim$(VIMVER)/doc)
  127. rm -rf $(PKG_INSTALL_DIR)/usr/share/vim/vim$(VIMVER)/doc
  128. rm -rf $(PKG_INSTALL_DIR)/usr/man
  129. endef
  130. define Build/Compile
  131. $(call Build/Compile/vim)
  132. $(call Build/Compile/vim-full)
  133. $(call Build/Compile/vim-runtime)
  134. $(call Build/Compile/xxd)
  135. endef
  136. define Package/vim/install
  137. $(INSTALL_DIR) $(1)/usr/bin
  138. $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_tiny $(1)/usr/bin/vim
  139. $(INSTALL_DIR) $(1)/usr/share/vim
  140. $(INSTALL_CONF) ./files/vimrc $(1)/usr/share/vim/
  141. endef
  142. define Package/vim-full/install
  143. $(INSTALL_DIR) $(1)/usr/bin
  144. $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_normal $(1)/usr/bin/vim
  145. $(INSTALL_DIR) $(1)/usr/share/vim
  146. $(INSTALL_CONF) ./files/vimrc.full $(1)/usr/share/vim/vimrc
  147. endef
  148. define Package/vim-runtime/install
  149. $(CP) $(PKG_INSTALL_DIR)/* $(1)
  150. rm -rf $(1)/usr/share/vim/vim$(VIMVER)/doc
  151. endef
  152. define Package/vim-help/install
  153. tar -C $(1) -xf $(PKG_BUILD_DIR)/docs.tar
  154. endef
  155. define Package/xxd/install
  156. $(INSTALL_DIR) $(1)/usr/bin
  157. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/xxd/xxd $(1)/usr/bin
  158. endef
  159. $(eval $(call BuildPackage,vim))
  160. $(eval $(call BuildPackage,vim-full))
  161. $(eval $(call BuildPackage,vim-runtime))
  162. $(eval $(call BuildPackage,vim-help))
  163. $(eval $(call BuildPackage,xxd))