bc7df71ce8b3ba6d5129ce78d08d8e5281eb7330
[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.0.069
12 PKG_RELEASE:=4
13 VIMVER:=80
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=ftp://ftp.vim.org/pub/vim/unix/
17 PKG_HASH:=2e179182814715c3c77010c7300a4abcb964ba8a99a470640f9f2f03884b2ccb
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
45 define Package/vim-fuller
46 $(call Package/vim/Default)
47 TITLE+= (Big)
48 endef
49
50 define Package/vim-runtime
51 $(call Package/vim/Default)
52 TITLE+= (runtime files)
53 endef
54
55 define Package/vim-help
56 $(call Package/vim/Default)
57 TITLE+= (help files)
58 endef
59
60 define Package/xxd
61 SECTION:=utils
62 CATEGORY:=Utilities
63 TITLE:=make a hexdump or do the reverse
64 URL:=http://www.vim.org/
65 endef
66
67 define Package/vim-full/conffiles
68 /usr/share/vim/vimrc
69 /root/.vimrc
70 endef
71
72 define Package/vim/conffiles
73 /usr/share/vim/vimrc
74 /root/.vimrc
75 endef
76
77 define Package/vim/description
78 Vim is an almost compatible version of the UNIX editor Vi.
79 (Tiny build)
80 endef
81
82 define Package/vim-full/description
83 Vim is an almost compatible version of the UNIX editor Vi.
84 (Normal build)
85 endef
86
87
88 define Package/vim-fuller/description
89 Vim is an almost compatible version of the UNIX editor Vi.
90 (Big build)
91 endef
92
93 define Package/vim-runtime/description
94 Vim is an almost compatible version of the UNIX editor Vi.
95 (Runtime files)
96 endef
97
98 define Package/vim-help/description
99 Vim is an almost compatible version of the UNIX editor Vi.
100 (Help files)
101 endef
102
103 define Package/xxd/description
104 xxd creates a hex dump of a given file or standard input, it can also convert
105 a hex dump back to its original binary form.
106 endef
107
108 CONFIGURE_ARGS += \
109 --disable-gui \
110 --disable-gtktest \
111 --disable-xim \
112 --without-x \
113 --disable-netbeans \
114 --disable-cscope \
115 --disable-gpm \
116 --disable-acl \
117 --with-tlib=ncurses
118
119 CONFIGURE_VARS += \
120 vim_cv_getcwd_broken=no \
121 vim_cv_memmove_handles_overlap=yes \
122 vim_cv_stat_ignores_slash=yes \
123 vim_cv_tgetent=zero \
124 vim_cv_terminfo=yes \
125 vim_cv_toupper_broken=no \
126 vim_cv_tty_group=root \
127 vim_cv_tty_mode=0620
128
129 ifneq ($(CONFIG_PACKAGE_vim),)
130 define Build/Compile/vim
131 $(call Build/Configure/Default, \
132 --with-features=tiny \
133 --disable-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_tiny
138 endef
139 endif
140
141 ifneq ($(CONFIG_PACKAGE_vim-full),)
142 define Build/Compile/vim-full
143 $(call Build/Configure/Default, \
144 --with-features=normal \
145 --enable-multibyte \
146 )
147 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
148 DESTDIR="$(PKG_INSTALL_DIR)" all
149 $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_normal
150 endef
151 endif
152
153 ifneq ($(CONFIG_PACKAGE_vim-fuller),)
154 define Build/Compile/vim-fuller
155 $(call Build/Configure/Default, \
156 --with-features=big \
157 --enable-multibyte \
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_big
162 endef
163 endif
164
165
166
167 ifneq ($(CONFIG_PACKAGE_xxd),)
168 define Build/Compile/xxd
169 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
170 DESTDIR="$(PKG_INSTALL_DIR)" all
171 endef
172 endif
173
174 define Build/Compile/vim-runtime
175 $(MAKE) -C $(PKG_BUILD_DIR)/src DESTDIR="$(PKG_INSTALL_DIR)" installrtbase
176 (cd $(PKG_INSTALL_DIR) && tar -cf $(PKG_BUILD_DIR)/docs.tar ./usr/share/vim/vim$(VIMVER)/doc)
177 rm -rf $(PKG_INSTALL_DIR)/usr/share/vim/vim$(VIMVER)/doc
178 rm -rf $(PKG_INSTALL_DIR)/usr/man
179 endef
180
181 define Build/Compile
182 $(call Build/Compile/vim)
183 $(call Build/Compile/vim-full)
184 $(call Build/Compile/vim-fuller)
185 $(call Build/Compile/vim-runtime)
186 $(call Build/Compile/xxd)
187 endef
188
189 define Package/vim/install
190 $(INSTALL_DIR) $(1)/usr/bin
191 $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_tiny $(1)/usr/bin/vim
192 $(INSTALL_DIR) $(1)/usr/share/vim
193 $(INSTALL_CONF) ./files/vimrc $(1)/usr/share/vim/
194 endef
195
196 define Package/vim-full/install
197 $(INSTALL_DIR) $(1)/usr/bin
198 $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_normal $(1)/usr/bin/vim
199 $(INSTALL_DIR) $(1)/usr/share/vim
200 $(INSTALL_CONF) ./files/vimrc.full $(1)/usr/share/vim/vimrc
201 endef
202
203
204 define Package/vim-fuller/install
205 $(INSTALL_DIR) $(1)/usr/bin
206 $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_big $(1)/usr/bin/vim
207 $(INSTALL_DIR) $(1)/usr/share/vim
208 $(CP) -r $(PKG_INSTALL_DIR)/usr/share/vim/vim$(VIMVER) $(1)/usr/share/vim
209 $(INSTALL_CONF) ./files/vimrc.full $(1)/usr/share/vim/vimrc
210 endef
211
212
213
214 define Package/vim-runtime/install
215 $(CP) $(PKG_INSTALL_DIR)/* $(1)
216 rm -rf $(1)/usr/share/vim/vim$(VIMVER)/doc
217 endef
218
219 define Package/vim-help/install
220 tar -C $(1) -xf $(PKG_BUILD_DIR)/docs.tar
221 endef
222
223 define Package/xxd/install
224 $(INSTALL_DIR) $(1)/usr/bin
225 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/xxd/xxd $(1)/usr/bin
226 endef
227
228 $(eval $(call BuildPackage,vim))
229 $(eval $(call BuildPackage,vim-full))
230 $(eval $(call BuildPackage,vim-fuller))
231 $(eval $(call BuildPackage,vim-runtime))
232 $(eval $(call BuildPackage,vim-help))
233 $(eval $(call BuildPackage,xxd))