Index | Thread | Search

From:
yaydn@protonmail.com
Subject:
Re: UPDATE: libavif 1.3.0
To:
Brad Smith <brad@comstyle.com>
Cc:
"ports@openbsd.org" <ports@openbsd.org>
Date:
Sun, 20 Jul 2025 14:35:26 +0000

Download raw body.

Thread
På tirsdag 8. juli 2025 kl. 06:45, Brad Smith
<brad@comstyle.com> skrev:

> On Sat, Jul 05, 2025 at 01:15:11AM -0400, Brad Smith wrote:
>
> > Here is an update to libavif 1.3.0.
> >
> > Tested on aarch64 and build tested with all dependent ports.
>
>
> Added a dist tuple to fetch libargparse.
>
>


Tested on current/amd64.

cd /usr/ports/graphics/libavif/ ; patch -l -p0 -E < /tmp/libavif-1.3.0.patch
cd /usr/ports/graphics/libavif/ ; make update clean && make distclean

Builds fine. For what it is worth, okay.

Hope this helps. Well wishes and hang in there. ^_^;

> 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 8 Jul 2025 04:07:47 -0000
> @@ -1,11 +1,13 @@
> 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
> + 4db2af62dab48895226be6b52737247e898ebe36 ext/libyuv
> +DIST_TUPLE+= github kmurray libargparse \
> + ee74d1b53bd680748af14e737378de57e2a0a954 ext/libargparse
> 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 8 Jul 2025 04:07:47 -0000
> @@ -1,4 +1,6 @@
> -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 (kmurray-libargparse-ee74d1b53bd680748af14e737378de57e2a0a954.tar.gz) = dyewSYhR5bam/Nc062Z6iiMYl+LIajV67FHMBmSBMGA=
> +SHA256 (lemenkov-libyuv-4db2af62dab48895226be6b52737247e898ebe36.tar.gz) = 0eVhTT+9BDkVvV4VaVG7GgnmMciQsyJ5aG69rUze7C0=
> +SIZE (AOMediaCodec-libavif-v1.3.0.tar.gz) = 14062497
> +SIZE (kmurray-libargparse-ee74d1b53bd680748af14e737378de57e2a0a954.tar.gz) = 22394
> +SIZE (lemenkov-libyuv-4db2af62dab48895226be6b52737247e898ebe36.tar.gz) = 615749
> 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 8 Jul 2025 04:07:47 -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 8 Jul 2025 04:07:47 -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 <stdio.h> // For fopen()
>
> + #include <string.h>
>
> +
> +-#if defined(linux) && defined(aarch64)
> ++#if (defined(linux) || defined(FreeBSD) || defined(OpenBSD)) && \
> ++ defined(aarch64)
> + #include <sys/auxv.h> // 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 8 Jul 2025 04:07:47 -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