mirror of
https://github.com/openbsd/ports.git
synced 2026-06-17 23:13:55 +02:00
update to x265-4.2, from Brad (maintainer)
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
COMMENT= free H.265/HEVC encoder
|
||||
|
||||
VER= 4.1
|
||||
VER= 4.2
|
||||
DISTNAME= x265_${VER}
|
||||
PKGNAME= x265-${VER}
|
||||
REVISION= 0
|
||||
CATEGORIES= multimedia
|
||||
SITES= https://bitbucket.org/multicoreware/x265_git/downloads/
|
||||
SITES= https://github.com/Multicorewareinc/x265/releases/download/${VER}/
|
||||
|
||||
SHARED_LIBS= x265 25.0
|
||||
SHARED_LIBS= x265 26.0
|
||||
|
||||
HOMEPAGE= https://x265.org/
|
||||
|
||||
@@ -34,8 +33,6 @@ CONFIGURE_ARGS+=-DCMAKE_ASM_YASM_FLAGS_DEBUG="-g dwarf2" \
|
||||
-DENABLE_TESTS=On \
|
||||
-DGIT_ARCHETYPE=1
|
||||
|
||||
MODCMAKE_POLICY_VERSION_OVERRIDE = Yes
|
||||
|
||||
.if ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "i386"
|
||||
CONFIGURE_ARGS+=-DENABLE_ASSEMBLY=Off
|
||||
.endif
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
SHA256 (x265_4.1.tar.gz) = oxaZxqiYBrdLAVHl5qffZd5LSQUEgv5ev4pDedevjyk=
|
||||
SIZE (x265_4.1.tar.gz) = 1725279
|
||||
SHA256 (x265_4.2.tar.gz) = QLHqBFPgMJ8OupNODd9TP49ilZZmeeiJTo8cHI1eEhA=
|
||||
SIZE (x265_4.2.tar.gz) = 1833442
|
||||
|
||||
@@ -1,25 +1,10 @@
|
||||
- Add run-time CPU feature detection for FreeBSD / OpenBSD
|
||||
- Fix building AltiVec code on powerpc64
|
||||
|
||||
Index: source/CMakeLists.txt
|
||||
--- source/CMakeLists.txt.orig
|
||||
+++ source/CMakeLists.txt
|
||||
@@ -7,13 +7,13 @@ if(NOT CMAKE_BUILD_TYPE)
|
||||
endif()
|
||||
message(STATUS "cmake version ${CMAKE_VERSION}")
|
||||
if(POLICY CMP0025)
|
||||
- cmake_policy(SET CMP0025 OLD) # report Apple's Clang as just Clang
|
||||
+ cmake_policy(SET CMP0025 NEW) # report Apple's Clang as just Clang
|
||||
endif()
|
||||
if(POLICY CMP0042)
|
||||
cmake_policy(SET CMP0042 NEW) # MACOSX_RPATH
|
||||
endif()
|
||||
if(POLICY CMP0054)
|
||||
- cmake_policy(SET CMP0054 OLD) # Only interpret if() arguments as variables or keywords when unquoted
|
||||
+ cmake_policy(SET CMP0054 NEW) # Only interpret if() arguments as variables or keywords when unquoted
|
||||
endif()
|
||||
|
||||
project (x265)
|
||||
@@ -88,7 +88,7 @@ elseif(ARM64MATCH GREATER "-1")
|
||||
@@ -91,7 +91,7 @@ elseif(ARM64MATCH GREATER "-1")
|
||||
option(AARCH64_WARNINGS_AS_ERRORS "Build with -Werror for AArch64 Intrinsics files" OFF)
|
||||
|
||||
option(AARCH64_RUNTIME_CPU_DETECT "Enable AArch64 run-time CPU feature detection" ON)
|
||||
@@ -28,12 +13,21 @@ Index: source/CMakeLists.txt
|
||||
set(AARCH64_RUNTIME_CPU_DETECT OFF CACHE BOOL "" FORCE)
|
||||
message(STATUS "Run-time CPU feature detection unsupported on this platform")
|
||||
endif()
|
||||
@@ -522,6 +522,16 @@ endif()
|
||||
@@ -120,6 +120,10 @@ elseif(RISCV64MATCH GREATER "-1")
|
||||
set(RISCV64 1)
|
||||
|
||||
if(ENABLE_ASSEMBLY)
|
||||
option(RISCV64_RUNTIME_CPU_DETECT "Enable RISCV64 run-time CPU feature detection" ON)
|
||||
+ if(NOT CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD|OpenBSD")
|
||||
+ set(RISCV64_RUNTIME_CPU_DETECT OFF CACHE BOOL "" FORCE)
|
||||
+ message(STATUS "Run-time CPU feature detection unsupported on this platform")
|
||||
+ endif()
|
||||
|
||||
option(ENABLE_RVV "Enable RVV" ON)
|
||||
|
||||
@@ -664,6 +668,16 @@ if(ENABLE_ASSEMBLY)
|
||||
add_definitions(-DENABLE_ASSEMBLY)
|
||||
+endif()
|
||||
+
|
||||
endif()
|
||||
|
||||
+check_symbol_exists(getauxval sys/auxv.h HAVE_GETAUXVAL)
|
||||
+if(HAVE_GETAUXVAL)
|
||||
+ add_definitions(-DHAVE_GETAUXVAL=1)
|
||||
@@ -42,6 +36,21 @@ Index: source/CMakeLists.txt
|
||||
+check_symbol_exists(elf_aux_info sys/auxv.h HAVE_ELF_AUX_INFO)
|
||||
+if(HAVE_ELF_AUX_INFO)
|
||||
+ add_definitions(-DHAVE_ELF_AUX_INFO=1)
|
||||
endif()
|
||||
|
||||
+endif()
|
||||
+
|
||||
option(CHECKED_BUILD "Enable run-time sanity checks (debugging)" OFF)
|
||||
if(CHECKED_BUILD)
|
||||
add_definitions(-DCHECKED_BUILD=1)
|
||||
@@ -785,7 +799,11 @@ if(POWER)
|
||||
# IBM Power8
|
||||
option(ENABLE_ALTIVEC "Enable ALTIVEC profiling instrumentation" ON)
|
||||
if(ENABLE_ALTIVEC)
|
||||
- add_definitions(-DHAVE_ALTIVEC=1 -maltivec -mabi=altivec)
|
||||
+ add_definitions(-DHAVE_ALTIVEC=1 -maltivec)
|
||||
+ check_cxx_compiler_flag(-mabi=altivec CC_HAS_MABI_ALTIVEC)
|
||||
+ if(CC_HAS_MABI_ALTIVEC)
|
||||
+ add_definitions(-mabi=altivec)
|
||||
+ endif()
|
||||
add_definitions(-flax-vector-conversions -fpermissive)
|
||||
else()
|
||||
add_definitions(-DHAVE_ALTIVEC=0)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Index: source/common/aarch64/cpu.h
|
||||
--- source/common/aarch64/cpu.h.orig
|
||||
+++ source/common/aarch64/cpu.h
|
||||
@@ -119,7 +119,7 @@ static inline int aarch64_get_cpu_flags()
|
||||
@@ -127,7 +127,7 @@ static inline int aarch64_get_cpu_flags()
|
||||
return flags;
|
||||
}
|
||||
|
||||
@@ -12,14 +12,14 @@ Index: source/common/aarch64/cpu.h
|
||||
|
||||
#include <sys/auxv.h>
|
||||
|
||||
@@ -133,10 +133,10 @@ static inline int aarch64_get_cpu_flags()
|
||||
@@ -142,10 +142,10 @@ static inline int aarch64_get_cpu_flags()
|
||||
int flags = 0;
|
||||
|
||||
#if HAVE_NEON_DOTPROD || HAVE_SVE
|
||||
- unsigned long hwcap = getauxval(AT_HWCAP);
|
||||
+ unsigned long hwcap = x265_getauxval(AT_HWCAP);
|
||||
#endif
|
||||
#if HAVE_NEON_I8MM || HAVE_SVE2
|
||||
#if HAVE_NEON_I8MM || HAVE_SVE2 || HAVE_SVE2_BITPERM
|
||||
- unsigned long hwcap2 = getauxval(AT_HWCAP2);
|
||||
+ unsigned long hwcap2 = x265_getauxval(AT_HWCAP2);
|
||||
#endif
|
||||
|
||||
@@ -23,7 +23,7 @@ Index: source/common/cpu.cpp
|
||||
#include <signal.h>
|
||||
#include <setjmp.h>
|
||||
static sigjmp_buf jmpbuf;
|
||||
@@ -128,6 +132,22 @@ const cpu_name_t cpu_names[] =
|
||||
@@ -137,6 +141,22 @@ const cpu_name_t cpu_names[] =
|
||||
{ "", 0 },
|
||||
};
|
||||
|
||||
@@ -46,7 +46,7 @@ Index: source/common/cpu.cpp
|
||||
#if X265_ARCH_X86
|
||||
|
||||
extern "C" {
|
||||
@@ -348,6 +368,8 @@ void PFX(cpu_neon_test)(void);
|
||||
@@ -357,6 +377,8 @@ void PFX(cpu_neon_test)(void);
|
||||
int PFX(cpu_fast_neon_mrc_test)(void);
|
||||
}
|
||||
|
||||
@@ -55,8 +55,8 @@ Index: source/common/cpu.cpp
|
||||
uint32_t cpu_detect(bool benableavx512)
|
||||
{
|
||||
int flags = 0;
|
||||
@@ -355,6 +377,11 @@ uint32_t cpu_detect(bool benableavx512)
|
||||
#if HAVE_ARMV6
|
||||
@@ -364,6 +386,11 @@ uint32_t cpu_detect(bool benableavx512)
|
||||
#if HAVE_ARMV6 && ENABLE_ASSEMBLY
|
||||
flags |= X265_CPU_ARMV6;
|
||||
|
||||
+#if HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
|
||||
@@ -67,7 +67,7 @@ Index: source/common/cpu.cpp
|
||||
// don't do this hack if compiled with -mfpu=neon
|
||||
#if !HAVE_NEON
|
||||
static void (* oldsig)(int);
|
||||
@@ -372,6 +399,7 @@ uint32_t cpu_detect(bool benableavx512)
|
||||
@@ -381,6 +408,7 @@ uint32_t cpu_detect(bool benableavx512)
|
||||
#endif // if !HAVE_NEON
|
||||
|
||||
flags |= X265_CPU_NEON;
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
- Add run-time CPU feature detection for FreeBSD / OpenBSD
|
||||
|
||||
Index: source/common/riscv64/cpu.h
|
||||
--- source/common/riscv64/cpu.h.orig
|
||||
+++ source/common/riscv64/cpu.h
|
||||
@@ -28,12 +28,13 @@
|
||||
|
||||
#if RISCV64_RUNTIME_CPU_DETECT
|
||||
|
||||
-#if defined(__linux__)
|
||||
+#if HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
|
||||
|
||||
#include <sys/auxv.h>
|
||||
|
||||
#define HWCAP_RISCV64_RVV (1 << ('V' - 'A'))
|
||||
|
||||
+#ifdef __linux__
|
||||
static int parse_proc_cpuinfo(const char *flag) {
|
||||
FILE *file = fopen("/proc/cpuinfo", "r");
|
||||
if (file == NULL)
|
||||
@@ -52,31 +53,34 @@ static int parse_proc_cpuinfo(const char *flag) {
|
||||
fclose(file);
|
||||
return found;
|
||||
}
|
||||
+#endif
|
||||
|
||||
static inline uint32_t riscv64_cpu_detect()
|
||||
{
|
||||
uint32_t flags = 0;
|
||||
|
||||
- unsigned long hwcap = getauxval(AT_HWCAP);
|
||||
+ unsigned long hwcap = x265_getauxval(AT_HWCAP);
|
||||
|
||||
if (hwcap & HWCAP_RISCV64_RVV) {
|
||||
flags |= X265_CPU_RVV;
|
||||
|
||||
+#ifdef __linux__
|
||||
if (parse_proc_cpuinfo("zbb"))
|
||||
flags |= X265_CPU_ZBB;
|
||||
+#endif
|
||||
}
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
-#else // defined(__linux__)
|
||||
+#else // HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
|
||||
#error \
|
||||
"Run-time CPU feature detection selected, but no detection method" \
|
||||
"available for your platform. Rerun cmake configure with" \
|
||||
"-DRISCV64_RUNTIME_CPU_DETECT=OFF."
|
||||
-#endif // defined(__linux__)
|
||||
+#endif // HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
|
||||
|
||||
-#else // if AARCH64_RUNTIME_CPU_DETECT
|
||||
+#else // if RISCV64_RUNTIME_CPU_DETECT
|
||||
|
||||
static inline uint32_t riscv64_cpu_detect()
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
Index: source/common/x86/x86inc.asm
|
||||
--- source/common/x86/x86inc.asm.orig
|
||||
+++ source/common/x86/x86inc.asm
|
||||
@@ -731,6 +731,9 @@ BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg,
|
||||
@@ -757,6 +757,9 @@ BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg,
|
||||
%endif
|
||||
align function_align
|
||||
%2:
|
||||
|
||||
Reference in New Issue
Block a user