extra/x265 to 3.4-1

This commit is contained in:
Kevin Mihelich 2020-06-09 18:55:00 +00:00
parent 5ae95a88a7
commit a94a09da63
2 changed files with 53 additions and 94 deletions

View file

@ -9,7 +9,7 @@
# - patch from upstream bug https://bitbucket.org/multicoreware/x265/issues/442
pkgname=x265
pkgver=3.3
pkgver=3.4
pkgrel=1
pkgdesc='Open Source H265/HEVC video encoder'
arch=(x86_64)
@ -20,12 +20,13 @@ makedepends=(
cmake
mercurial
nasm
ninja
)
provides=(libx265.so)
source=(hg+https://bitbucket.org/multicoreware/x265#tag=057215961bc4b51b6260a584ff3d506e6d65cfd6
source=(hg+https://bitbucket.org/multicoreware/x265#tag=2a65b720985096bcb1664f7cb05c3d04aeb576f5
arm.patch)
sha256sums=('SKIP'
'd292976588ea1cb12f6371a2379fe7e22b93c18a16ea0a5acd1fbebab48988f2')
'067b934ae83339deedc58608d272529a004789c3e2819b94636d66a5806fd64b')
pkgver() {
cd x265
@ -35,74 +36,20 @@ pkgver() {
prepare() {
cd x265
patch -p1 -i ../arm.patch
[[ $CARCH == "aarch64" ]] && CFLAGS+=" -fPIC" && CXXFLAGS+=" -fPIC"
[[ $CARCH != "aarch64" ]] && CONFIG="-DENABLE_ASSEMBLY=OFF"
for d in 8 $([[ $CARCH == 'aarch64' ]] && echo "10 12"); do
if [[ -d build-$d ]]; then
rm -rf build-$d
fi
mkdir build-$d
done
}
build() {
if [[ $CARCH == aarch64 ]]; then
cd x265/build-12
cmake ../source \
-DCMAKE_INSTALL_PREFIX=/usr \
-DHIGH_BIT_DEPTH=TRUE \
-DMAIN12=TRUE \
-DEXPORT_C_API=FALSE \
-DENABLE_CLI=FALSE \
-DENABLE_SHARED=FALSE
make
cd ../build-10
cmake ../source \
-DCMAKE_INSTALL_PREFIX=/usr \
-DHIGH_BIT_DEPTH=TRUE \
-DEXPORT_C_API=FALSE \
-DENABLE_CLI=FALSE \
-DENABLE_SHARED=FALSE
make
cd ../build-8
ln -s ../build-10/libx265.a libx265_main10.a
ln -s ../build-12/libx265.a libx265_main12.a
cmake ../source \
-DCMAKE_INSTALL_PREFIX=/usr \
-DENABLE_SHARED=TRUE \
-DENABLE_HDR10_PLUS=TRUE \
-DEXTRA_LIB='x265_main10.a;x265_main12.a' \
-DEXTRA_LINK_FLAGS='-L .' \
-DLINKED_10BIT=TRUE \
-DLINKED_12BIT=TRUE
make
else
cd x265/build-8
cmake ../source \
[[ $CARCH != "aarch64" ]] && CONFIG="-DENABLE_ASSEMBLY=OFF"
cmake -S x265/source -B build -G Ninja \
-DCMAKE_INSTALL_PREFIX=/usr \
-DENABLE_SHARED=TRUE \
$CONFIG
fi
ninja -C build
}
package() {
cd x265/build-8
make DESTDIR="${pkgdir}" install
DESTDIR="${pkgdir}" ninja -C build install
}
# vim: ts=2 sw=2 et:

View file

@ -1,59 +1,71 @@
Binary files a/.hg/dirstate and b/.hg/dirstate differ
diff -urN a/source/CMakeLists.txt b/source/CMakeLists.txt
--- a/source/CMakeLists.txt 2018-10-08 10:04:19.918015626 -0600
+++ b/source/CMakeLists.txt 2018-10-08 10:04:37.277342636 -0600
diff -r 2a65b7209850 source/CMakeLists.txt
--- a/source/CMakeLists.txt Fri May 29 23:09:35 2020 +0530
+++ b/source/CMakeLists.txt Tue Jun 09 12:49:19 2020 -0600
@@ -40,7 +40,7 @@
# System architecture detection
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSPROC)
set(X86_ALIASES x86 i386 i686 x86_64 amd64)
-set(ARM_ALIASES armv6l armv7l)
+set(ARM_ALIASES armv5tel armv6l armv7l)
-set(ARM_ALIASES armv6l armv7l aarch64)
+set(ARM_ALIASES armv5tel armv6l armv7l aarch64)
list(FIND X86_ALIASES "${SYSPROC}" X86MATCH)
list(FIND ARM_ALIASES "${SYSPROC}" ARMMATCH)
set(POWER_ALIASES ppc64 ppc64le)
@@ -70,9 +70,17 @@
@@ -76,8 +76,16 @@
set(ARM64 1)
add_definitions(-DX265_ARCH_ARM=1 -DX265_ARCH_ARM64=1 -DHAVE_ARMV6=0)
else()
set(CROSS_COMPILE_ARM 0)
- message(STATUS "Detected ARM target processor")
- add_definitions(-DX265_ARCH_ARM=1 -DX265_ARCH_ARM64=0 -DHAVE_ARMV6=1)
+ if(${SYSPROC} MATCHES "armv5.*")
+ message(STATUS "Detected ARMV5 system processor")
+ add_definitions(-DX265_ARCH_ARM=1 -DX265_ARCH_ARM64=0 -DHAVE_ARMV6=0 -DHAVE_NEON=0)
+ elseif(${SYSPROC} STREQUAL "armv6l")
+ message(STATUS "Detected ARMV6 system processor")
+ add_definitions(-DX265_ARCH_ARM=1 -DX265_ARCH_ARM64=0 -DHAVE_ARMV6=0 -DHAVE_NEON=0)
+ elseif(${SYSPROC} STREQUAL "armv7l")
+ message(STATUS "Detected ARMV7 system processor")
+ add_definitions(-DX265_ARCH_ARM=1 -DX265_ARCH_ARM64=0 -DHAVE_ARMV6=0 -DHAVE_NEON=0 -fPIC)
+ endif()
endif()
- message(STATUS "Detected ARM target processor")
+ if(${SYSPROC} MATCHES "armv5.*")
+ message(STATUS "Detected ARMV5 system processor")
+ add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=0 -DHAVE_NEON=0)
+ elseif(${SYSPROC} STREQUAL "armv6l")
+ message(STATUS "Detected ARMV6 system processor")
+ add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=0 -DHAVE_NEON=0)
+ elseif(${SYSPROC} STREQUAL "armv7l")
+ message(STATUS "Detected ARMV7 system processor")
+ add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=0 -DHAVE_NEON=0 -fPIC)
+ endif()
set(ARM 1)
- add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=1)
else()
message(STATUS "CMAKE_SYSTEM_PROCESSOR value `${CMAKE_SYSTEM_PROCESSOR}` is unknown")
message(STATUS "Please add this value near ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}")
@@ -227,18 +235,6 @@
@@ -238,28 +246,11 @@
endif()
endif()
endif()
- if(ARM AND CROSS_COMPILE_ARM)
- set(ARM_ARGS -march=armv6 -mfloat-abi=soft -mfpu=vfp -marm -fPIC)
- if(ARM64)
- set(ARM_ARGS -fPIC)
- else()
- set(ARM_ARGS -march=armv6 -mfloat-abi=soft -mfpu=vfp -marm -fPIC)
- endif()
- message(STATUS "cross compile arm")
- elseif(ARM)
- find_package(Neon)
- if(CPU_HAS_NEON)
- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC)
- if(ARM64)
- set(ARM_ARGS -fPIC)
- add_definitions(-DHAVE_NEON)
- else()
- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm)
- find_package(Neon)
- if(CPU_HAS_NEON)
- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC)
- add_definitions(-DHAVE_NEON)
- else()
- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm)
- endif()
- endif()
- endif()
+ if(ARM64)
+ set(ARM_ARGS -fPIC)
+ add_definitions(-DHAVE_NEON)
+ add_definitions(${ARM_ARGS})
endif()
- add_definitions(${ARM_ARGS})
if(FPROFILE_GENERATE)
if(INTEL_CXX)
add_definitions(-prof-gen -prof-dir="${CMAKE_CURRENT_BINARY_DIR}")
diff -urN a/source/common/cpu.cpp b/source/common/cpu.cpp
--- a/source/common/cpu.cpp 2018-10-08 10:04:19.938014851 -0600
+++ b/source/common/cpu.cpp 2018-10-08 10:04:37.277342636 -0600
@@ -37,7 +37,7 @@
diff -r 2a65b7209850 source/common/cpu.cpp
--- a/source/common/cpu.cpp Fri May 29 23:09:35 2020 +0530
+++ b/source/common/cpu.cpp Tue Jun 09 12:49:19 2020 -0600
@@ -39,7 +39,7 @@
#include <machine/cpu.h>
#endif