From: Brad Smith Subject: UPDATE: libavif 1.3.0 To: ports@openbsd.org Date: Sat, 5 Jul 2025 01:15:10 -0400 Here is an update to libavif 1.3.0. Tested on aarch64 and build tested with all dependent ports. Index: Makefile =================================================================== RCS file: /cvs/ports/graphics/libavif/Makefile,v retrieving revision 1.24 diff -u -p -u -p -r1.24 Makefile --- Makefile 30 Aug 2024 07:48:53 -0000 1.24 +++ Makefile 22 Jun 2025 13:11:37 -0000 @@ -1,11 +1,11 @@ COMMENT= library for encoding and decoding .avif files -DIST_TUPLE+= github AOMediaCodec libavif v1.1.1 . +DIST_TUPLE+= github AOMediaCodec libavif v1.3.0 . DIST_TUPLE+= github lemenkov libyuv \ - a6a2ec654b1be1166b376476a7555c89eca0c275 ext/libyuv + 1724c4be72f32d2f04eead939f7b3f35ad4e39e3 ext/libyuv CATEGORIES= graphics -SHARED_LIBS= avif 7.1 +SHARED_LIBS= avif 8.0 HOMEPAGE= https://github.com/AOMediaCodec/libavif Index: distinfo =================================================================== RCS file: /cvs/ports/graphics/libavif/distinfo,v retrieving revision 1.18 diff -u -p -u -p -r1.18 distinfo --- distinfo 30 Aug 2024 07:48:53 -0000 1.18 +++ distinfo 22 Jun 2025 13:11:37 -0000 @@ -1,4 +1,4 @@ -SHA256 (AOMediaCodec-libavif-v1.1.1.tar.gz) = kUZi4WJF4GLtc/kBEvu0VIJBMAhDp3ctjUQbtoWd5Fs= -SHA256 (lemenkov-libyuv-a6a2ec654b1be1166b376476a7555c89eca0c275.tar.gz) = +5dXKi3B2Ok3bmGzPrSHCMzPs0Egb8m02atl9Asyb7M= -SIZE (AOMediaCodec-libavif-v1.1.1.tar.gz) = 13644189 -SIZE (lemenkov-libyuv-a6a2ec654b1be1166b376476a7555c89eca0c275.tar.gz) = 570482 +SHA256 (AOMediaCodec-libavif-v1.3.0.tar.gz) = ClRelTzASb9bz07kZzBqLxE6dREO31nmEkiHMQHNJsE= +SHA256 (lemenkov-libyuv-1724c4be72f32d2f04eead939f7b3f35ad4e39e3.tar.gz) = rZjzMob/NHc4UfQYFZzkeeBJpe3iHDe167ofY87rY/0= +SIZE (AOMediaCodec-libavif-v1.3.0.tar.gz) = 14062497 +SIZE (lemenkov-libyuv-1724c4be72f32d2f04eead939f7b3f35ad4e39e3.tar.gz) = 618740 Index: patches/patch-ext_libyuv_include_libyuv_cpu_id_h =================================================================== RCS file: patches/patch-ext_libyuv_include_libyuv_cpu_id_h diff -N patches/patch-ext_libyuv_include_libyuv_cpu_id_h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-ext_libyuv_include_libyuv_cpu_id_h 22 Jun 2025 13:11:37 -0000 @@ -0,0 +1,12 @@ +Index: ext/libyuv/include/libyuv/cpu_id.h +--- ext/libyuv/include/libyuv/cpu_id.h.orig ++++ ext/libyuv/include/libyuv/cpu_id.h +@@ -95,7 +95,7 @@ int MipsCpuCaps(const char* cpuinfo_name); + LIBYUV_API + int RiscvCpuCaps(const char* cpuinfo_name); + +-#ifdef __linux__ ++#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) + // On Linux, parse AArch64 features from getauxval(AT_HWCAP{,2}). + LIBYUV_API + int AArch64CpuCaps(unsigned long hwcap, unsigned long hwcap2); Index: patches/patch-ext_libyuv_source_cpu_id_cc =================================================================== RCS file: patches/patch-ext_libyuv_source_cpu_id_cc diff -N patches/patch-ext_libyuv_source_cpu_id_cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-ext_libyuv_source_cpu_id_cc 22 Jun 2025 13:11:37 -0000 @@ -0,0 +1,44 @@ +Index: ext/libyuv/source/cpu_id.cc +--- ext/libyuv/source/cpu_id.cc.orig ++++ ext/libyuv/source/cpu_id.cc +@@ -23,7 +23,8 @@ + #include // For fopen() + #include + +-#if defined(__linux__) && defined(__aarch64__) ++#if (defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)) && \ ++ defined(__aarch64__) + #include // For getauxval() + #endif + +@@ -179,7 +180,7 @@ LIBYUV_API SAFEBUFFERS int ArmCpuCaps(const char* cpui + } + + #ifdef __aarch64__ +-#ifdef __linux__ ++#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) + // Define hwcap values ourselves: building with an old auxv header where these + // hwcap values are not defined should not prevent features from being enabled. + #define YUV_AARCH64_HWCAP_ASIMDDP (1UL << 20) +@@ -472,13 +473,20 @@ static SAFEBUFFERS int GetCpuFlags(void) { + cpu_info |= kCpuHasLOONGARCH; + #endif + #if defined(__aarch64__) +-#if defined(__linux__) ++#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) ++#if defined(__FreeBSD__) || defined(__OpenBSD__) ++ unsigned long hwcap = 0; ++ unsigned long hwcap2 = 0; ++ elf_aux_info(AT_HWCAP, &hwcap, sizeof(hwcap)); ++ elf_aux_info(AT_HWCAP2, &hwcap2, sizeof(hwcap2)); ++#else + // getauxval is supported since Android SDK version 18, minimum at time of + // writing is 21, so should be safe to always use this. If getauxval is + // somehow disabled then getauxval returns 0, which will leave Neon enabled + // since Neon is mandatory on AArch64. + unsigned long hwcap = getauxval(AT_HWCAP); + unsigned long hwcap2 = getauxval(AT_HWCAP2); ++#endif + cpu_info = AArch64CpuCaps(hwcap, hwcap2); + #else + cpu_info = AArch64CpuCaps(); Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/graphics/libavif/pkg/PLIST,v retrieving revision 1.6 diff -u -p -u -p -r1.6 PLIST --- pkg/PLIST 27 Aug 2024 07:54:17 -0000 1.6 +++ pkg/PLIST 22 Jun 2025 13:11:37 -0000 @@ -1,5 +1,6 @@ @bin bin/avifdec @bin bin/avifenc +@bin bin/avifgainmaputil include/avif/ include/avif/avif.h include/avif/avif_cxx.h