aboutsummaryrefslogtreecommitdiffstats
path: root/main/gd/APKBUILD
blob: b8e62e87030bab58c553becb287fcb47a4877796 (plain) (blame)
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
# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=gd
pkgver=2.3.2
pkgrel=1
_pkgreal=lib$pkgname
pkgdesc="Library for the dynamic creation of images by programmers"
url="https://libgd.github.io/"
arch="all"
license="custom"
makedepends="
	libjpeg-turbo-dev
	libpng-dev
	libwebp-dev
	freetype-dev
	zlib-dev
	"
subpackages="$pkgname-dev $_pkgreal:libs"
source="https://github.com/$_pkgreal/$_pkgreal/releases/download/gd-$pkgver/$_pkgreal-$pkgver.tar.xz
	CVE-2021-38115.patch
	CVE-2021-40145.patch
	"
builddir="$srcdir/$_pkgreal-$pkgver"

case "$CARCH" in
	# https://github.com/libgd/libgd/issues/359
	aarch64|mips*|ppc64le|riscv64|s390x|x86) options="!check";;
esac

# secfixes:
#   2.3.0-r1:
#     - CVE-2021-38115
#     - CVE-2021-40145
#   2.3.0-r0:
#     - CVE-2019-11038
#     - CVE-2018-14553
#     - CVE-2017-6363
#   2.2.5-r2:
#     - CVE-2018-5711
#     - CVE-2019-6977
#     - CVE-2019-6978
#   2.2.5-r1:
#     - CVE-2018-1000222

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--without-fontconfig \
		--disable-werror
	make
}

check() {
	make check
}

package() {
	DESTDIR="$pkgdir" make install
}

dev() {
	default_dev
	depends="$pkgname perl"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/bdftogd "$subpkgdir"/usr/bin/
}

sha512sums="
a31c6dbb64e7b725b63f3b400f7bebc289e2d776bdca0595af23006841660dc93a56c2247b98f8a584438a826f9e9ff0bea17d0b3900e48e281580b1308794d2  libgd-2.3.2.tar.xz
cf455c3487dd3ef074abb0d89c2763e5652b11273a63eb050212dbed911e6fe9b65bf26c2de8ac9dc32d8225c096389075f518296280c3109c19612daafdb043  CVE-2021-38115.patch
778ec72d6bcccd5fac032bb165f198cd588bc59e8358cb0933fe2e7e688416d693c517b0c2afd1c3b682619404a94bb4f0babbdf895774e83c869a34f191f84a  CVE-2021-40145.patch
"