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