summaryrefslogtreecommitdiff
path: root/main/aom/APKBUILD
blob: 0bb000197190ea2bc1d9e73e6a378ff825adf0f1 (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
# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=aom
pkgver=3.6.0
pkgrel=0
pkgdesc="Alliance for Open Media (AOM) AV1 codec SDK"
url="https://aomedia.org/"
arch="all"
license="BSD-2-Clause AND custom"
options="!check" # tests run for 5+ hours
makedepends="cmake perl python3 yasm samurai"
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
source="$pkgname-$pkgver.tar.gz::https://aomedia.googlesource.com/aom/+archive/v$pkgver.tar.gz
	fix-stack-size-e53da0b.patch
	posix-implicit.patch
	"

case "$CARCH" in
	ppc64le) makedepends="$makedepends linux-headers" ;;
esac

# secfixes:
#   3.1.1-r0:
#     - CVE-2021-30473
#     - CVE-2021-30474
#     - CVE-2021-30475

build() {
	local _neon_opt=
	case "$CARCH" in
		armhf) _neon_opt="-DENABLE_NEON=OFF" ;;
		armv7) _neon_opt="-DAOM_NEON_INTRIN_FLAG=-mfpu=neon" ;;
	esac

	cmake -B build -G Ninja \
		$_neon_opt \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=Release \
		-DENABLE_TESTS="$(want_check && echo ON || echo OFF)"
	ninja -C build
}

check() {
	local _testdata="$builddir"/test_data
	mkdir -p $_testdata
	export LIBAOM_TEST_DATA_PATH=$_testdata
	ninja -C build testdata
	ninja -C build runtests
}

package() {
	DESTDIR="$pkgdir" ninja -C build install

	install -Dm 644 -t "$pkgdir"/usr/share/doc/"$pkgname"/ README.md
	install -Dm 644 -t "$pkgdir"/usr/share/doc/"$pkgname"/ LICENSE
	install -Dm 644 -t "$pkgdir"/usr/share/doc/"$pkgname"/ PATENTS
}

unpack() {
	mkdir -p "$builddir"

	tar -xf "$srcdir/$pkgname-$pkgver.tar.gz" \
		-C "$builddir" > /dev/null
}

sha512sums="
5127f4dfea7786f35d7c7fe42b5146895f2d5f37511e84ddc99ce0f7251d34d66efbc3fdb4b65f93fec41fc783d105d8201a108cc4ecaf9d8526eb43d6ba2711  aom-3.6.0.tar.gz
573a6c9cd1e9c71a0612f750fb1b69ee65ab86364d3aa78ef51b8fb20633c69b97026d0685dedeabb51f31d0dab7c651d1fe5c72e0dc9f14b8ed2704584934a9  fix-stack-size-e53da0b.patch
30cc17c38219e81f92f1f034786d5d4096a0e657c86dfe581f84d18fc201a0e34bd331e98271f92c07e5dc49740e164a983b3316fc57599b98aea2615f7cf107  posix-implicit.patch
"