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