Merge pull request #19372 from cotequeiroz/libgd
[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:=9.0
12 PKG_RELEASE:=1
13 VIMVER:=90
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=http://ftp.vim.org/pub/vim/unix
17 PKG_HASH:=a6456bc154999d83d0c20d968ac7ba6e7df0d02f3cb6427fb248660bacfb336e
18 PKG_MAINTAINER:=Marko Ratkaj <markoratkaj@gmail.com>
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 PROVIDES:=vim
45 CONFLICTS:=vim
46 endef
47
48
49 define Package/vim-fuller
50 $(call Package/vim/Default)
51 TITLE+= (Big)
52 PROVIDES:=vim vim-full
53 CONFLICTS:=vim vim-full
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 CONFIGURE_ARGS += \
115 --disable-gui \
116 --disable-gtktest \
117 --disable-xim \
118 --without-x \
119 --disable-netbeans \
120 --disable-cscope \
121 --disable-gpm \
122 --disable-acl \
123 --disable-libsodium \
124 --disable-selinux \
125 --with-tlib=ncurses \
126 --with-compiledby="non-existent-hostname-compiled"
127
128 CONFIGURE_VARS += \
129 ac_cv_header_elf_h=no \
130 vim_cv_getcwd_broken=no \
131 vim_cv_memmove_handles_overlap=yes \
132 vim_cv_stat_ignores_slash=yes \
133 vim_cv_tgetent=zero \
134 vim_cv_terminfo=yes \
135 vim_cv_toupper_broken=no \
136 vim_cv_tty_group=root \
137 vim_cv_tty_mode=0620
138
139 ifneq ($(HOST_OS),Linux)
140 TARGET_PATH_PKG:=$(CURDIR)/scripts:$(TARGET_PATH_PKG)
141 endif
142
143 define Build/Prepare
144 $(call Build/Prepare/Default)
145 $(MAKE) -C $(PKG_BUILD_DIR)/src autoconf
146 endef
147
148 ifneq ($(CONFIG_PACKAGE_vim),)
149 define Build/Compile/vim
150 $(call Build/Configure/Default, \
151 --with-features=tiny \
152 )
153 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
154 DESTDIR="$(PKG_INSTALL_DIR)" all
155 $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_tiny
156 endef
157 endif
158
159 ifneq ($(CONFIG_PACKAGE_vim-full),)
160 define Build/Compile/vim-full
161 $(call Build/Configure/Default, \
162 --with-features=normal \
163 )
164 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
165 DESTDIR="$(PKG_INSTALL_DIR)" all
166 $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_normal
167 endef
168 endif
169
170 ifneq ($(CONFIG_PACKAGE_vim-fuller),)
171 define Build/Compile/vim-fuller
172 $(call Build/Configure/Default, \
173 --with-features=big \
174 )
175 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
176 DESTDIR="$(PKG_INSTALL_DIR)" all
177 $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_big
178 endef
179 endif
180
181
182
183 ifneq ($(CONFIG_PACKAGE_xxd),)
184 define Build/Compile/xxd
185 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
186 DESTDIR="$(PKG_INSTALL_DIR)" all
187 endef
188 endif
189
190 define Build/Compile/vim-runtime
191 $(MAKE) -C $(PKG_BUILD_DIR)/src DESTDIR="$(PKG_INSTALL_DIR)" installrtbase
192 (cd $(PKG_INSTALL_DIR) && tar -cf $(PKG_BUILD_DIR)/docs.tar ./usr/share/vim/vim$(VIMVER)/doc)
193 rm -rf $(PKG_INSTALL_DIR)/usr/share/vim/vim$(VIMVER)/doc
194 rm -rf $(PKG_INSTALL_DIR)/usr/man
195 endef
196
197 define Build/Compile
198 $(call Build/Compile/vim)
199 $(call Build/Compile/vim-full)
200 $(call Build/Compile/vim-fuller)
201 $(call Build/Compile/vim-runtime)
202 $(call Build/Compile/xxd)
203 endef
204
205 define Package/vim/install
206 $(INSTALL_DIR) $(1)/usr/bin
207 $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_tiny $(1)/usr/bin/vim
208 $(INSTALL_DIR) $(1)/usr/share/vim
209 $(INSTALL_CONF) ./files/vimrc $(1)/usr/share/vim/
210 endef
211
212 define Package/vim-full/install
213 $(INSTALL_DIR) $(1)/usr/bin
214 $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_normal $(1)/usr/bin/vim
215 $(INSTALL_DIR) $(1)/usr/share/vim
216 $(LN) vim $(1)/usr/bin/vimdiff
217 $(INSTALL_CONF) ./files/vimrc.full $(1)/usr/share/vim/vimrc
218 endef
219
220
221 define Package/vim-fuller/install
222 $(INSTALL_DIR) $(1)/usr/bin
223 $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_big $(1)/usr/bin/vim
224 $(INSTALL_DIR) $(1)/usr/share/vim
225 $(LN) vim $(1)/usr/bin/vimdiff
226 $(CP) $(PKG_INSTALL_DIR)/usr/share/vim/vim$(VIMVER) $(1)/usr/share/vim
227 $(INSTALL_CONF) ./files/vimrc.full $(1)/usr/share/vim/vimrc
228 endef
229
230
231
232 define Package/vim-runtime/install
233 $(CP) $(PKG_INSTALL_DIR)/* $(1)
234 rm -rf $(1)/usr/share/vim/vim$(VIMVER)/doc
235 endef
236
237 define Package/vim-help/install
238 tar -C $(1) -xf $(PKG_BUILD_DIR)/docs.tar
239 endef
240
241 define Package/xxd/install
242 $(INSTALL_DIR) $(1)/usr/bin
243 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/xxd/xxd $(1)/usr/bin
244 endef
245
246 $(eval $(call BuildPackage,vim))
247 $(eval $(call BuildPackage,vim-full))
248 $(eval $(call BuildPackage,vim-fuller))
249 $(eval $(call BuildPackage,vim-runtime))
250 $(eval $(call BuildPackage,vim-help))
251 $(eval $(call BuildPackage,xxd))