aboutsummaryrefslogtreecommitdiffstats
path: root/testing/zimg/APKBUILD
blob: 69e461b42017b1e4af81f9d7373038408d859cee (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
# Contributor: Alexander Edland <alpine@ocv.me>
# Maintainer: Alexander Edland <alpine@ocv.me>
pkgname=zimg
pkgver=2.9.2
pkgrel=0
pkgdesc="Scaling, colorspace conversion and dithering library"
url="https://github.com/sekrit-twc/zimg"
arch="all !s390x" # Tests fail
license="WTFPL-2.0"
makedepends="autoconf automake libtool"
subpackages="$pkgname-doc $pkgname-dev"
source="zimg-$pkgver.tar.gz::https://github.com/sekrit-twc/zimg/archive/release-$pkgver.tar.gz
	zimg-gtest-1.8.0.tar.gz::https://github.com/google/googletest/archive/release-1.8.0.tar.gz"
builddir="$srcdir/zimg-release-$pkgver"
options="!check" # we run tests in the build stage

prepare() {
	default_prepare
	mkdir -p "$pkgdir"
	# googletest is required in-tree
	ln -s "$srcdir"/googletest-*/* test/extra/googletest
	autoreconf -vfi
}

build() {
	# build and run test binaries here
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-static \
		--enable-unit-test
	make
	make test/unit_test.log
	test/unit_test

	# build release binaries here without enabling tests,
	# as they make zimg slower
	make clean
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-static
	make
}

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

sha512sums="b688f8e93a2e4549f2c844cd58c6e0714e6494d6fc8c800dc1b0cdf2278fb9925a646fc332350c1b5d77cef2134bf35e18a873c24ea1979c1adce57bfef68ebe  zimg-2.9.2.tar.gz
1dbece324473e53a83a60601b02c92c089f5d314761351974e097b2cf4d24af4296f9eb8653b6b03b1e363d9c5f793897acae1f0c7ac40149216035c4d395d9d  zimg-gtest-1.8.0.tar.gz"