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