aboutsummaryrefslogtreecommitdiffstats
path: root/community/x265/APKBUILD
blob: 97c259e038e7cc68bb0f8b7ebf9b08bd196db21f (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
# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=x265
pkgver=3.5
pkgrel=2
pkgdesc="Open Source H265/HEVC video encoder"
url="https://www.videolan.org/developers/x265.html"
arch="all"
license="GPL-2.0-or-later"
makedepends="cmake nasm ninja numactl-dev"
subpackages="$pkgname-dev $pkgname-libs"
source="https://bitbucket.org/multicoreware/x265_git/downloads/x265_$pkgver.tar.gz"
builddir="$srcdir/${pkgname}_$pkgver"

# See comment on CMAKE_BUILD_TYPE.
export CFLAGS=${CFLAGS/-Os/}
export CXXFLAGS=${CXXFLAGS/-Os/}

build() {
	local cmake_opts=""
	case "$CARCH" in
		# It has textrel on x86 so we disable asm.
		x86) cmake_opts="-DENABLE_ASSEMBLY=OFF";;
		ppc*) cmake_opts="-DENABLE_ALTIVEC=OFF -DCPU_POWER8=OFF";;
		# See https://bitbucket.org/multicoreware/x265_git/issues/559
		*) cmake_opts="-DCMAKE_ASM_NASM_FLAGS=-w-macro-params-legacy";;
	esac

	# CMAKE_BUILD_TYPE - Don't change to None! This is a video encoder,
	#   performance is the most important.
	cmake -B build -S source -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_VERBOSE_MAKEFILE=ON \
		$cmake_opts
	cmake --build build
}

check() {
	./build/x265 --version
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
230e683239c3e262096ba96246c6f67229a1625d163f86647a411733bb1cf349685858aee3017bce818bb6992448d0abaa9241615a5b620561ce47ecb164f997  x265_3.5.tar.gz
"