APKBUILD 1.88 KB
Newer Older
1
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
2
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
Carlo Landmeter's avatar
Carlo Landmeter committed
3
pkgname=libpng
Leo's avatar
Leo committed
4
pkgver=1.6.37
5
pkgrel=0
Carlo Landmeter's avatar
Carlo Landmeter committed
6
pkgdesc="Portable Network Graphics library"
7
url="http://www.libpng.org"
8
arch="all"
9
license="Libpng"
Leo's avatar
Leo committed
10 11
makedepends="zlib-dev gawk autoconf automake libtool"
subpackages="$pkgname-doc $pkgname-static $pkgname-dev $pkgname-utils"
12 13
source="https://downloads.sourceforge.net/libpng/$pkgname-$pkgver.tar.gz
	https://downloads.sourceforge.net/sourceforge/libpng-apng/$pkgname-$pkgver-apng.patch.gz
Carlo Landmeter's avatar
Carlo Landmeter committed
14
	libpng-fix-arm-neon.patch
15
	"
16
builddir="$srcdir/$pkgname-$pkgver"
Carlo Landmeter's avatar
Carlo Landmeter committed
17

Leo's avatar
Leo committed
18 19 20 21 22 23
# secfixes:
#   1.6.37-r0:
#     - CVE-2019-7317
#     - CVE-2018-14048
#     - CVE-2018-14550

24
prepare() {
Carlo Landmeter's avatar
Carlo Landmeter committed
25
	cd "$builddir"
tmpfile's avatar
tmpfile committed
26 27
	gunzip -c "$srcdir"/$pkgname-$pkgver-apng.patch.gz | patch -p1
	default_prepare
28 29
	# libpng-fix-arm-neon.patch modifies configure.ac
	autoreconf -vif
30
}
31

Carlo Landmeter's avatar
Carlo Landmeter committed
32
build() {
Carlo Landmeter's avatar
Carlo Landmeter committed
33
	cd "$builddir"
34 35 36 37
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
38 39
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
tmpfile's avatar
tmpfile committed
40 41
		--localstatedir=/var
	make
42 43
}

44
check() {
45 46
	cd "$builddir"
	make check
47 48
}

49
package() {
Carlo Landmeter's avatar
Carlo Landmeter committed
50
	cd "$builddir"
tmpfile's avatar
tmpfile committed
51
	make DESTDIR="$pkgdir" install
52
	rm -f "$pkgdir"/usr/lib/*.la
Carlo Landmeter's avatar
Carlo Landmeter committed
53 54
}

55 56 57 58 59 60
utils() {
	pkgdesc="$pkgdesc (pngfix utils)"
	mkdir -p "$subpkgdir"/usr
	mv "$pkgdir"/usr/bin "$subpkgdir"/usr
}

Leo's avatar
Leo committed
61 62 63 64 65 66 67 68 69 70
static() {
	depends=""
	pkgdesc="$pkgdesc (static library)"

	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/*.a "$subpkgdir"/usr/lib
}

sha512sums="2ce2b855af307ca92a6e053f521f5d262c36eb836b4810cb53c809aa3ea2dcc08f834aee0ffd66137768a54397e28e92804534a74abb6fc9f6f3127f14c9c338  libpng-1.6.37.tar.gz
226adcb3a8c60f2267fe2976ab531329ae43c2603dab4d0cf8f16217d64069936b879f3d6516b75d259c47d6f5c5b1f24f887602206c8e46abde0fb7f5c7946b  libpng-1.6.37-apng.patch.gz
tmpfile's avatar
tmpfile committed
71
e3fae918f14bc34e7c126892f69527c6e1b4d72593835ece839d9a28cff55a886b2030f877cf9e29b2c97abf2e47bbb5ba54584828edd2a841c2556f330b9c7e  libpng-fix-arm-neon.patch"