aboutsummaryrefslogtreecommitdiffstats
path: root/main/gettext/APKBUILD
blob: 4b560c232ae0d31d4ca12a6c99175b156f09053a (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
# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=gettext
pkgver=0.21.1
pkgrel=7
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
	libintl
	$pkgname-asprintf
	$pkgname-libs
	"
source="https://ftp.gnu.org/gnu/gettext/gettext-$pkgver.tar.xz
	skip-tests-musl.patch
	skip-tests-libunistring-1.0.patch
	musl-realpath.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
}

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="
61e93bc9876effd3ca1c4e64ff6ba5bd84b24951ec2cc6f40a0e3248410e60f887552f29ca1f70541fb5524f6a4e8191fed288713c3e280e18922dd5bff1a2c9  gettext-0.21.1.tar.xz
9fae1898eaf7a871876d2eaeffdf6ab759455bc8062fc232992526d697752d864b6079eb3c1053aea08d3a41892008b201566564fa62275d0ced5cfa6088a4c0  skip-tests-musl.patch
4f65c3ea09cf3b3be2fac560a820eeab5687e93bfdf4693343d756734144ec351fbf34e4671a4b89df07b47848905aba4099711ba0151d69fc56a954140b4325  skip-tests-libunistring-1.0.patch
593615f1d3a75e0fff1561b11e6363aacdc44045adf19c765e27360f256149e442643f40ef1ed781d4175e02dd9719871019e16b0c1393a124a8a87ef0cf75b0  musl-realpath.patch
"