aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpsykose <alice@ayaya.dev>2023-02-19 14:20:57 +0000
committerpsykose <alice@ayaya.dev>2023-02-19 15:21:47 +0100
commitb11d24f33b2c2d328a074073875f7b0b28346d30 (patch)
tree2d1c50b7fe182bbfb80f258fc1b2196311199091
parent6e2224493c5b74da091f63e1f10a40e0111a1556 (diff)
community/x265: simplify, add lto, add aarch64 asm, drop static
-rw-r--r--community/x265/APKBUILD35
1 files changed, 20 insertions, 15 deletions
diff --git a/community/x265/APKBUILD b/community/x265/APKBUILD
index e7a48dcf1ed..e6f7acd4a60 100644
--- a/community/x265/APKBUILD
+++ b/community/x265/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=x265
pkgver=3.5
-pkgrel=3
+pkgrel=4
pkgdesc="Open Source H265/HEVC video encoder"
url="https://www.videolan.org/developers/x265.html"
arch="all"
@@ -12,58 +12,61 @@ 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";;
- # Fails to build 10 and 12 bit versions
- aarch64) cmake_opts="-DENABLE_ASSEMBLY=OFF";;
# See https://bitbucket.org/multicoreware/x265_git/issues/559
*) cmake_opts="-DCMAKE_ASM_NASM_FLAGS=-w-macro-params-legacy";;
esac
+ export CFLAGS="$CFLAGS -flto=auto"
+ export CXXFLAGS="$CXXFLAGS -flto=auto"
+
# CMAKE_BUILD_TYPE - Don't change to None! This is a video encoder,
# performance is the most important.
- cmake -B build-12 -S source -G Ninja \
+ # shellcheck disable=2046
+ cmake -B build-12 -S source -G Ninja -Wno-dev \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
- -DCMAKE_VERBOSE_MAKEFILE=ON \
-DHIGH_BIT_DEPTH=TRUE \
-DMAIN12=TRUE \
-DEXPORT_C_API=FALSE \
-DENABLE_CLI=FALSE \
-DENABLE_SHARED=FALSE \
+ $([ "$CARCH" = "aarch64" ] && echo "-DENABLE_ASSEMBLY=OFF") \
+ -DCMAKE_ASM_NASM_FLAGS=-w-macro-params-legacy \
$cmake_opts
cmake --build build-12
- cmake -B build-10 -S source -G Ninja \
+ # shellcheck disable=2046
+ cmake -B build-10 -S source -G Ninja -Wno-dev \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
- -DCMAKE_VERBOSE_MAKEFILE=ON \
-DHIGH_BIT_DEPTH=TRUE \
-DEXPORT_C_API=FALSE \
-DENABLE_CLI=FALSE \
-DENABLE_SHARED=FALSE \
+ $([ "$CARCH" = "aarch64" ] && echo "-DENABLE_ASSEMBLY=OFF") \
+ -DCMAKE_ASM_NASM_FLAGS=-w-macro-params-legacy \
$cmake_opts
cmake --build build-10
- cmake -B build -S source -G Ninja \
+ ln -s ../build-10/libx265.a build/libx265_main10.a
+ ln -s ../build-12/libx265.a build/libx265_main12.a
+
+ cmake -B build -S source -G Ninja -Wno-dev \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
- -DCMAKE_VERBOSE_MAKEFILE=ON \
-DEXTRA_LIB='x265_main10.a;x265_main12.a' \
-DEXTRA_LINK_FLAGS='-L.' \
-DLINKED_10BIT=TRUE \
-DLINKED_12BIT=TRUE \
+ -DCMAKE_ASM_NASM_FLAGS=-w-macro-params-legacy \
$cmake_opts
- ln -s ../build-10/libx265.a build/libx265_main10.a
- ln -s ../build-12/libx265.a build/libx265_main12.a
+
cmake --build build
}
@@ -73,6 +76,8 @@ check() {
package() {
DESTDIR="$pkgdir" cmake --install build
+
+ rm -fv "$pkgdir"/usr/lib/libx265.a
}
sha512sums="