aboutsummaryrefslogtreecommitdiffstats
path: root/main/vim/APKBUILD
blob: 2a645de2f1e056fcda0f803ae18c0b0925f1782c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
# Contributor: Sergei Lukin <sergej.lukin@gmail.com>
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=vim
pkgver=9.1.0414
pkgrel=0
pkgdesc="Improved vi-style text editor"
url="https://www.vim.org/"
arch="all"
license="Vim"
options="!check"  # some tests are failing
makedepends="
	gtk+3.0-dev
	libx11-dev
	libxt-dev
	lua5.4-dev
	ncurses-dev
	python3-dev
	ruby-dev
	"
subpackages="
	$pkgname-doc
	${pkgname}diff
	$pkgname-tutor
	$pkgname-common
	gvim
	xxd
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/vim/vim/archive/refs/tags/v$pkgver.tar.gz
	vimrc
	"

# secfixes:
#   9.0.2127-r0:
#     - CVE-2023-48706
#   9.0.2112-r0:
#     - CVE-2023-48231
#   9.0.2073-r0:
#     - CVE-2023-5535
#   9.0.1994-r0:
#     - CVE-2023-5344
#   9.0.1888-r0:
#     - CVE-2023-4733
#     - CVE-2023-4734
#     - CVE-2023-4735
#     - CVE-2023-4736
#     - CVE-2023-4738
#     - CVE-2023-4750
#     - CVE-2023-4752
#     - CVE-2023-4781
#   9.0.1413-r0:
#     - CVE-2023-1264
#   9.0.1395-r0:
#     - CVE-2023-1127
#     - CVE-2023-1170
#     - CVE-2023-1175
#     - CVE-2023-1355
#   9.0.1251-r0:
#     - CVE-2023-0433
#     - CVE-2023-0512
#   9.0.1198-r0:
#     - CVE-2023-0288
#   9.0.1167-r0:
#     - CVE-2023-0049
#     - CVE-2023-0051
#     - CVE-2023-0054
#   9.0.0999-r0:
#     - CVE-2022-4141
#     - CVE-2022-4292
#     - CVE-2022-4293
#     - CVE-2022-47024
#   9.0.0815-r0:
#     - CVE-2022-3705
#   9.0.0636-r0:
#     - CVE-2022-3352
#   9.0.0598-r0:
#     - CVE-2022-3234
#     - CVE-2022-3235
#     - CVE-2022-3256
#     - CVE-2022-3278
#   9.0.0437-r0:
#     - CVE-2022-3134
#   9.0.0369-r0:
#     - CVE-2022-2980
#     - CVE-2022-2982
#     - CVE-2022-3016
#     - CVE-2022-3037
#     - CVE-2022-3099
#   9.0.0270-r0:
#     - CVE-2022-2923
#     - CVE-2022-2946
#   9.0.0224-r0:
#     - CVE-2022-2816
#     - CVE-2022-2817
#     - CVE-2022-2819
#   9.0.0050-r0:
#     - CVE-2022-2264
#     - CVE-2022-2284
#     - CVE-2022-2285
#     - CVE-2022-2286
#     - CVE-2022-2287
#     - CVE-2022-2288
#     - CVE-2022-2289
#     - CVE-2022-2304
#   8.2.5170-r0:
#     - CVE-2022-2124
#     - CVE-2022-2125
#     - CVE-2022-2126
#     - CVE-2022-2129
#   8.2.5055-r0:
#     - CVE-2022-1851
#     - CVE-2022-1886
#     - CVE-2022-1898
#   8.2.5000-r0:
#     - CVE-2022-1796
#   8.2.4969-r0:
#     - CVE-2022-1619
#     - CVE-2022-1620
#     - CVE-2022-1621
#     - CVE-2022-1629
#   8.2.4836-r0:
#     - CVE-2022-1381
#   8.2.4708-r0:
#     - CVE-2022-1154
#     - CVE-2022-1160
#   8.2.4619-r0:
#     - CVE-2022-0943
#   8.2.4542-r0:
#     - CVE-2022-0572
#     - CVE-2022-0629
#     - CVE-2022-0685
#     - CVE-2022-0696
#     - CVE-2022-0714
#     - CVE-2022-0729
#   8.2.4350-r0:
#     - CVE-2022-0359
#     - CVE-2022-0361
#     - CVE-2022-0368
#     - CVE-2022-0392
#     - CVE-2022-0393
#     - CVE-2022-0407
#     - CVE-2022-0408
#     - CVE-2022-0413
#     - CVE-2022-0417
#     - CVE-2022-0443
#   8.2.4173-r0:
#     - CVE-2021-4069
#     - CVE-2021-4136
#     - CVE-2021-4166
#     - CVE-2021-4173
#     - CVE-2021-4187
#     - CVE-2021-4192
#     - CVE-2021-4193
#     - CVE-2021-46059
#     - CVE-2022-0128
#     - CVE-2022-0156
#     - CVE-2022-0158
#     - CVE-2022-0213
#   8.2.3779-r0:
#     - CVE-2021-4019
#   8.2.3650-r0:
#     - CVE-2021-3927
#     - CVE-2021-3928
#     - CVE-2021-3968
#     - CVE-2021-3973
#     - CVE-2021-3974
#     - CVE-2021-3984
#   8.2.3567-r0:
#     - CVE-2021-3903
#   8.2.3500-r0:
#     - CVE-2021-3875
#   8.2.3437-r0:
#     - CVE-2021-3770
#     - CVE-2021-3778
#     - CVE-2021-3796
#   8.1.1365-r0:
#     - CVE-2019-12735
#   8.0.1521-r0:
#     - CVE-2017-6350
#     - CVE-2017-6349
#   8.0.0329-r0:
#     - CVE-2017-5953
#   8.0.0056-r0:
#     - CVE-2016-1248

prepare() {
	# Read vimrc from /etc/vim
	echo '#define SYS_VIMRC_FILE "/etc/vim/vimrc"' >> src/feature.h

	cp -r "$builddir" "$builddir"-gvim
	default_prepare
}

build() {
	export CFLAGS="$CFLAGS -flto=auto"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--enable-luainterp=dynamic \
		--enable-python3interp=dynamic \
		--enable-rubyinterp=dynamic \
		--without-x \
		--disable-nls \
		--enable-acl \
		--enable-multibyte \
		--enable-gui=no \
		--with-lua-prefix=/usr/lua5.4 \
		--with-compiledby="Alpine Linux"
	make
	cd "$builddir"-gvim
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--enable-luainterp=dynamic \
		--enable-python3interp=dynamic \
		--enable-rubyinterp=dynamic \
		--with-x \
		--disable-nls \
		--enable-acl \
		--enable-multibyte \
		--enable-gui=gtk3 \
		--with-lua-prefix=/usr/lua5.4 \
		--with-compiledby="Alpine Linux"
	make
}

check() {
	make test
}

package() {
	depends="vim-common=$pkgver-r$pkgrel xxd=$pkgver-r$pkgrel"
	provider_priority=10
	replaces="gvim"

	make -j1 DESTDIR="$pkgdir" install

	install -Dm644 runtime/doc/uganda.txt \
		"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
	install -Dm644 "$srcdir"/vimrc "$pkgdir"/etc/vim/vimrc

	# only relevant to gvim
	rm -r "$pkgdir"/usr/share/icons/
	rm -r "$pkgdir"/usr/share/applications/
}

common() {
	replaces="vim gvim"
	arch="noarch"
	amove etc/vim/vimrc
	amove usr/share/vim
}

gvim() {
	pkgdesc="advanced text editor, with GUI"
	depends="vim-common=$pkgver-r$pkgrel xxd=$pkgver-r$pkgrel"
	provides="vim=$pkgver-r$pkgrel"
	provider_priority=1
	replaces="vim"

	make -C "$builddir"-gvim -j1 DESTDIR="$subpkgdir" install

	rm "$subpkgdir"/usr/bin/vimdiff
	rm "$subpkgdir"/usr/bin/vimtutor
	rm -r "$subpkgdir"/usr/share/man
	rm -r "$subpkgdir"/usr/share/vim
	rm "$subpkgdir"/usr/bin/xxd
}

vimdiff() {
	pkgdesc="view file diffs in vim"
	depends="diffutils vim=$pkgver-r$pkgrel"
	replaces="vim gvim"
	arch="noarch"
	options="!tracedeps"
	provides="cmd:vimdiff=$pkgver-r$pkgrel"

	amove usr/bin/vimdiff
}

tutor() {
	pkgdesc="vim tutor and tutor files"
	depends="vim=$pkgver-r$pkgrel"
	replaces="gvim vim"
	arch="noarch"

	amove usr/bin/vimtutor
	amove usr/share/vim/vim*/tutor
}

xxd() {
	pkgdesc="tool to make (or reverse) a hex dump"
	depends=""
	replaces="gvim vim"

	amove usr/bin/xxd
}

sha512sums="
df45288cbc79283e41dac191b4b6b1e9439feba0ac319935baf41327cd0a60239e23dc5f769c67c48514cdca0e7d4671670a84aa989562264e0d8f14dc838d99  vim-9.1.0414.tar.gz
bb4ac5bd2862754e741e63d7b521fd9e0cb1ac19769b952672928fd26471e9486182cd8a46a7e6f25e5b87759106e642293534c5e90c3c3958308291acb26875  vimrc
"