From 7e9fc36ba37453a1ab8bbfa6f43bdd0507555696 Mon Sep 17 00:00:00 2001
From: Robert Clausecker <fuz@FreeBSD.org>
Date: Mon, 20 Jan 2025 05:51:50 +0100
Subject: [PATCH] graphics/libskiasharp: fix build on armv7 and aarch64

Add getauxval() shim using elf_aux_info() for CPU feature detection.

Approved by:	portmgr (build fix blanket)
MFH:		2025Q1
---
 graphics/libskiasharp/Makefile                |  2 +-
 .../files/patch-src_core_SkCpu.cpp            | 20 +++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)
 create mode 100644 graphics/libskiasharp/files/patch-src_core_SkCpu.cpp

diff --git a/graphics/libskiasharp/Makefile b/graphics/libskiasharp/Makefile
index 669af43325f8..d8a43fb8c120 100644
--- a/graphics/libskiasharp/Makefile
+++ b/graphics/libskiasharp/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	libskiasharp
 DISTVERSIONPREFIX=	v
 DISTVERSION=	2.88.3
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	graphics
 MASTER_SITES=	LOCAL/bapt:libjpeg_turbo
 DISTFILES=	libjpeg_turbo-${LIBJPEG_TURBO_REV}.tar.gz:libjpeg_turbo
diff --git a/graphics/libskiasharp/files/patch-src_core_SkCpu.cpp b/graphics/libskiasharp/files/patch-src_core_SkCpu.cpp
new file mode 100644
index 000000000000..44348f506302
--- /dev/null
+++ b/graphics/libskiasharp/files/patch-src_core_SkCpu.cpp
@@ -0,0 +1,20 @@
+--- src/core/SkCpu.cpp.orig	2025-01-20 04:43:13 UTC
++++ src/core/SkCpu.cpp
+@@ -10,6 +10,17 @@
+ #include "include/private/SkOnce.h"
+ #include "src/core/SkCpu.h"
+ 
++#ifdef __FreeBSD__
++#include <sys/auxv.h>
++static unsigned long getauxval(unsigned long aux) {
++    unsigned long val = 0;
++
++    elf_aux_info((int)aux, &val, sizeof aux);
++
++    return val;
++}
++#endif
++
+ #if defined(SK_CPU_X86)
+     #if defined(_MSC_VER)
+         #include <intrin.h>
-- 
GitLab