UPDATE: x265 4.3

Brad Smith <[email protected]> Sat, 1 Aug 2026 01:44:56 -0400
Newsgroups gmane.os.openbsd.ports
Message-ID <[email protected]>
Here is an update to x265 4.3.

All depends build Ok.

Tested on aarch64 and amd64.


Index: Makefile
===================================================================
RCS file: /cvs/ports/multimedia/x265/Makefile,v
retrieving revision 1.63
diff -u -p -u -p -r1.63 Makefile
--- Makefile	29 May 2026 16:14:51 -0000	1.63
+++ Makefile	31 Jul 2026 22:00:27 -0000
@@ -1,12 +1,12 @@
 COMMENT=	free H.265/HEVC encoder
 
-VER=		4.2
+VER=		4.3
 DISTNAME=	x265_${VER}
 PKGNAME=	x265-${VER}
 CATEGORIES=	multimedia
 SITES=		https://github.com/Multicorewareinc/x265/releases/download/${VER}/
 
-SHARED_LIBS=	x265	26.0
+SHARED_LIBS=	x265	27.0
 
 HOMEPAGE=	https://x265.org/
 
Index: distinfo
===================================================================
RCS file: /cvs/ports/multimedia/x265/distinfo,v
retrieving revision 1.29
diff -u -p -u -p -r1.29 distinfo
--- distinfo	29 May 2026 16:14:51 -0000	1.29
+++ distinfo	31 Jul 2026 22:00:27 -0000
@@ -1,2 +1,2 @@
-SHA256 (x265_4.2.tar.gz) = QLHqBFPgMJ8OupNODd9TP49ilZZmeeiJTo8cHI1eEhA=
-SIZE (x265_4.2.tar.gz) = 1833442
+SHA256 (x265_4.3.tar.gz) = g8U+TIu7jx4z7VnhCn1iHR14AcqFORDD60HwOLj/sSE=
+SIZE (x265_4.3.tar.gz) = 2052112
Index: patches/patch-source_CMakeLists_txt
===================================================================
RCS file: patches/patch-source_CMakeLists_txt
diff -N patches/patch-source_CMakeLists_txt
--- patches/patch-source_CMakeLists_txt	29 May 2026 16:14:51 -0000	1.11
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,56 +0,0 @@
-- 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
-@@ -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)
--    if(NOT CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin|Windows")
-+    if(NOT CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD|OpenBSD|Darwin|Windows")
-         set(AARCH64_RUNTIME_CPU_DETECT OFF CACHE BOOL "" FORCE)
-         message(STATUS "Run-time CPU feature detection unsupported on this platform")
-     endif()
-@@ -120,6 +120,10 @@ elseif(RISCV64MATCH GREATER "-1")
-     set(RISCV64 1)
- 
-     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()
- 
-+check_symbol_exists(getauxval sys/auxv.h HAVE_GETAUXVAL)
-+if(HAVE_GETAUXVAL)
-+    add_definitions(-DHAVE_GETAUXVAL=1)
-+endif()
-+
-+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()
-+
- 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)
Index: patches/patch-source_common_aarch64_cpu_h
===================================================================
RCS file: patches/patch-source_common_aarch64_cpu_h
diff -N patches/patch-source_common_aarch64_cpu_h
--- patches/patch-source_common_aarch64_cpu_h	29 May 2026 16:14:51 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,27 +0,0 @@
-- Add run-time CPU feature detection for FreeBSD / OpenBSD
-
-Index: source/common/aarch64/cpu.h
---- source/common/aarch64/cpu.h.orig
-+++ source/common/aarch64/cpu.h
-@@ -127,7 +127,7 @@ static inline int aarch64_get_cpu_flags()
-     return flags;
- }
- 
--#elif defined(__linux__)
-+#elif HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
- 
- #include <sys/auxv.h>
- 
-@@ -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 || HAVE_SVE2_BITPERM
--    unsigned long hwcap2 = getauxval(AT_HWCAP2);
-+    unsigned long hwcap2 = x265_getauxval(AT_HWCAP2);
- #endif
- 
- #if HAVE_NEON
Index: patches/patch-source_common_aarch64_dct_S
===================================================================
RCS file: patches/patch-source_common_aarch64_dct_S
diff -N patches/patch-source_common_aarch64_dct_S
--- patches/patch-source_common_aarch64_dct_S	2 Dec 2024 10:40:47 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,44 +0,0 @@
-Fix for aarch64 xonly.
-
-Index: source/common/aarch64/dct.S
---- source/common/aarch64/dct.S.orig
-+++ source/common/aarch64/dct.S
-@@ -32,9 +32,6 @@
- .section .rodata
- #endif
- 
--.align 4
--
--.text
- .set idct16_shift_1, 7
- .set idct16_shift_2, 12-(BIT_DEPTH-8)
- 
-@@ -99,7 +96,10 @@ tbl_const_dct_0:
-     .word 64, 83, 36, 89, 75, 50, 18,  0    // v0, v1
-     .word 90, 87, 80, 70, 57, 43, 25,  9    // v2, v3
- 
-+.text
- 
-+.align 4
-+
- // ***** idct 16x16 *****
- // void idct16(const int16_t* src, int16_t* dst, intptr_t dstStride)
- function PFX(idct16_neon)
-@@ -112,7 +112,7 @@ function PFX(idct16_neon)
-     stp             d8, d9, [sp,#-16]!
-     sub             sp, sp, #(16*16*2)
- 
--    adr             x8, tbl_const_idct_0
-+    movrel          x8, tbl_const_idct_0
-     ldp             q0, q1, [x8]
- 
-     mov             x5, sp
-@@ -513,7 +513,7 @@ function PFX(dct16_neon)
-     stp             d12, d13, [sp,#-16]!
-     stp             d14, d15, [sp,#-16]!
- 
--    adr             x6, tbl_const_dct_0
-+    movrel          x6, tbl_const_dct_0
-     ld4r            {v16.2d, v17.2d, v18.2d, v19.2d}, [x6], #32
-     ld4r            {v20.2d, v21.2d, v22.2d, v23.2d}, [x6], #32
-     ld1             {v24.8h, v25.8h, v26.8h, v27.8h}, [x6], #64
Index: patches/patch-source_common_cpu_cpp
===================================================================
RCS file: patches/patch-source_common_cpu_cpp
diff -N patches/patch-source_common_cpu_cpp
--- patches/patch-source_common_cpu_cpp	29 May 2026 16:14:51 -0000	1.5
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,77 +0,0 @@
-- Add run-time CPU feature detection for FreeBSD / OpenBSD
-
-Index: source/common/cpu.cpp
---- source/common/cpu.cpp.orig
-+++ source/common/cpu.cpp
-@@ -31,6 +31,10 @@
- #include "cpu.h"
- #include "common.h"
- 
-+#include <errno.h>
-+#if HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
-+#include <sys/auxv.h>
-+#endif
- #if MACOS || SYS_FREEBSD
- #include <sys/types.h>
- #include <sys/sysctl.h>
-@@ -41,7 +45,7 @@
- #include <machine/cpu.h>
- #endif
- 
--#if X265_ARCH_ARM && !defined(HAVE_NEON)
-+#if X265_ARCH_ARM && !defined(HAVE_NEON) && !(HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO)
- #include <signal.h>
- #include <setjmp.h>
- static sigjmp_buf jmpbuf;
-@@ -137,6 +141,22 @@ const cpu_name_t cpu_names[] =
-     { "", 0 },
- };
- 
-+unsigned long x265_getauxval(unsigned long type)
-+{
-+#if HAVE_GETAUXVAL
-+    return getauxval(type);
-+#elif HAVE_ELF_AUX_INFO
-+    unsigned long aux = 0;
-+    int ret = elf_aux_info(type, &aux, sizeof(aux));
-+    if (ret != 0)
-+        errno = ret;
-+    return aux;
-+#else
-+    errno = ENOSYS;
-+    return 0;
-+#endif
-+}
-+
- #if X265_ARCH_X86
- 
- extern "C" {
-@@ -357,6 +377,8 @@ void PFX(cpu_neon_test)(void);
- int PFX(cpu_fast_neon_mrc_test)(void);
- }
- 
-+#define X265_ARM_HWCAP_NEON (1U << 12)
-+
- uint32_t cpu_detect(bool benableavx512)
- {
-     int flags = 0;
-@@ -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
-+    unsigned long hwcap = x265_getauxval(AT_HWCAP);
-+
-+    if (hwcap & X265_ARM_HWCAP_NEON) flags |= X265_CPU_NEON;
-+#else
-     // don't do this hack if compiled with -mfpu=neon
- #if !HAVE_NEON
-     static void (* oldsig)(int);
-@@ -381,6 +408,7 @@ uint32_t cpu_detect(bool benableavx512)
- #endif // if !HAVE_NEON
- 
-     flags |= X265_CPU_NEON;
-+#endif
- 
-     // fast neon -> arm (Cortex-A9) detection relies on user access to the
-     // cycle counter; this assumes ARMv7 performance counters.
Index: patches/patch-source_common_cpu_h
===================================================================
RCS file: patches/patch-source_common_cpu_h
diff -N patches/patch-source_common_cpu_h
--- patches/patch-source_common_cpu_h	2 Dec 2024 10:40:47 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-- Add run-time CPU feature detection for FreeBSD / OpenBSD
-
-Index: source/common/cpu.h
---- source/common/cpu.h.orig
-+++ source/common/cpu.h
-@@ -48,6 +48,8 @@ extern "C" void PFX(safe_intel_cpu_indicator_init)(voi
- #define x265_emms() PFX(cpu_emms)()
- #endif
- 
-+unsigned long x265_getauxval(unsigned long);
-+
- namespace X265_NS {
- uint32_t cpu_detect(bool);
- bool detect512();
Index: patches/patch-source_common_riscv64_cpu_h
===================================================================
RCS file: patches/patch-source_common_riscv64_cpu_h
diff -N patches/patch-source_common_riscv64_cpu_h
--- patches/patch-source_common_riscv64_cpu_h	29 May 2026 16:14:51 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,59 +0,0 @@
-- 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()
- {