aboutsummaryrefslogtreecommitdiffstats
path: root/main/gettext/APKBUILD
blob: 8633837b3d98465542a1e4d8a9d9fe992cc6baa1 (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
# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=gettext
pkgver=0.22.5
pkgrel=0
pkgdesc="GNU locale utilities"
url="https://www.gnu.org/software/gettext/gettext.html"
arch="all"
license="GPL-3.0-or-later AND LGPL-2.1-or-later AND MIT"
# do _not_ add the optional dependencies on libcroco or glib
# they depend on gettext and would introduce cyclic dependencies
# xz for autopoint autoreconf
depends_dev="!musl-libintl xz"
makedepends="perl ncurses-dev libxml2-dev libunistring-dev"
checkdepends="coreutils"
subpackages="
	$pkgname-dbg
	$pkgname-doc
	$pkgname-static
	$pkgname-dev
	$pkgname-lang
	$pkgname-envsubst:_envsubst
	libintl
	$pkgname-asprintf
	$pkgname-libs
	"
source="https://ftp.gnu.org/gnu/gettext/gettext-$pkgver.tar.xz
	cwd.patch
	musl-realpath.patch
	skip-tests-musl.patch
	"

# secfixes:
#   0.20.1-r0:
#     - CVE-2018-18751

build() {
	# force using system posix complaint printf
	# the test is broken and fails with ash
	gt_cv_func_printf_posix=yes \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--enable-threads=posix \
		--disable-java \
		--enable-static
	make
}

check() {
	# test-verify fails if run in parallel
	make -j1 check
}

package() {
	depends="$pkgname-envsubst=$pkgver-r$pkgrel"
	make -j1 DESTDIR="$pkgdir" install

	# nothing in here is particularly useful, mostly just hello world examples in
	# every single programming language for using gettext
	rm -r "$pkgdir"/usr/share/doc
}

libintl() {
	pkgdesc="GNU gettext runtime library"
	license="LGPL-2.1-or-later"

	amove usr/lib/libintl.so.*
	chmod +x "$subpkgdir"/usr/lib/libintl.so.*
}

asprintf() {
	pkgdesc="GNU gettext asprintf library"
	license="LGPL-2.1-or-later"

	amove usr/lib/libasprintf.so.*
}

_envsubst() {
	pkgdesc="GNU gettext envsubst binary"
	provides="envsubst"
	provider_priority=100 # highest (other provider of cmd:envsubst is testing/envsubst)

	amove usr/bin/envsubst
}

sha512sums="
a60999bb9d09441f138214d87acb7e59aab81e765bb9253a77c54902681c5de164a5a04de2a9778dfb479dbdefaab2d5de1fbaf6095c555c43e7e9fd7a1c09bd  gettext-0.22.5.tar.xz
31796534e40c1569b08cf48e25375ca1d0f439df8aa0d24283769d52a290e28522760128f11f5bd04217605974ae1fdee9557ec189ed32b11b2a45b4af3b0f4a  cwd.patch
c423b7f5610f03af63ed5327801be47fecc1d3de66cb018b32d05179a62889156cefb6d302686e9ecd81421951a5aa5e4c5a7d911823fc41d4c52ad2387e0719  musl-realpath.patch
a16963f804ce4abe8480da211228f7b24a0715d6ef3ff7d5e5c58a1387d6c4260ee237864081b05b164f082ef199a592494ce691dd0c96c61978e4c451707c7a  skip-tests-musl.patch
"