From 807f3c0e8252e93d9338b012eebfd9202f5ece34 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Fri, 1 Dec 2023 00:18:12 +0100 Subject: [PATCH] multimedia/aom: update to 3.8.0 Changes: https://aomedia.googlesource.com/aom/+log/v3.7.1..v3.8.0 Reported by: Repology, portscout --- multimedia/aom/Makefile | 2 +- multimedia/aom/distinfo | 6 +-- .../patch-aom__ports_aarch32__cpudetect.c | 39 ++++++++++++++++++ .../patch-aom__ports_aarch64__cpudetect.c | 29 +++++++++++++ .../files/patch-aom__ports_arm__cpudetect.c | 41 ------------------- .../aom/files/patch-build_cmake_cpu.cmake | 16 ++++---- multimedia/aom/pkg-plist | 2 +- 7 files changed, 81 insertions(+), 54 deletions(-) create mode 100644 multimedia/aom/files/patch-aom__ports_aarch32__cpudetect.c create mode 100644 multimedia/aom/files/patch-aom__ports_aarch64__cpudetect.c delete mode 100644 multimedia/aom/files/patch-aom__ports_arm__cpudetect.c diff --git a/multimedia/aom/Makefile b/multimedia/aom/Makefile index 71dee6a977369..80761c6d1f25a 100644 --- a/multimedia/aom/Makefile +++ b/multimedia/aom/Makefile @@ -1,6 +1,6 @@ PORTNAME= aom DISTVERSIONPREFIX= v -DISTVERSION= 3.7.1 +DISTVERSION= 3.8.0 CATEGORIES= multimedia MAINTAINER= jbeich@FreeBSD.org diff --git a/multimedia/aom/distinfo b/multimedia/aom/distinfo index d4bfb374fe28f..6ee7f481e0713 100644 --- a/multimedia/aom/distinfo +++ b/multimedia/aom/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1700269070 -SHA256 (jbeich-aom-v3.7.1_GH0.tar.gz) = ece0d7d5d2a6b83231e51ffba5aa419df0d855e47e86a34a9e2a99c0211a5f8c -SIZE (jbeich-aom-v3.7.1_GH0.tar.gz) = 5357475 +TIMESTAMP = 1701386292 +SHA256 (jbeich-aom-v3.8.0_GH0.tar.gz) = d8e0cb0157410e97ffcf01f4fe24e6447303c46cc4103d6597ba30ef508afe05 +SIZE (jbeich-aom-v3.8.0_GH0.tar.gz) = 5458954 diff --git a/multimedia/aom/files/patch-aom__ports_aarch32__cpudetect.c b/multimedia/aom/files/patch-aom__ports_aarch32__cpudetect.c new file mode 100644 index 0000000000000..f73ebb24b13c6 --- /dev/null +++ b/multimedia/aom/files/patch-aom__ports_aarch32__cpudetect.c @@ -0,0 +1,39 @@ +- Assume NEON is enabled on armv7 +- Implement runtime detection on FreeBSD + +--- aom_ports/aarch32_cpudetect.c.orig 2023-11-30 23:18:12 UTC ++++ aom_ports/aarch32_cpudetect.c +@@ -12,7 +12,7 @@ + + #include "arm_cpudetect.h" + +-#if !CONFIG_RUNTIME_CPU_DETECT ++#if !CONFIG_RUNTIME_CPU_DETECT || defined(__ARM_NEON) + + static int arm_get_cpu_caps(void) { + // This function should actually be a no-op. There is no way to adjust any of +@@ -55,9 +55,23 @@ static int arm_get_cpu_caps(void) { + return flags; + } + +-#elif defined(__linux__) // end defined(AOM_USE_ANDROID_CPU_FEATURES) ++#elif defined(__linux__) || defined(__FreeBSD__) // end defined(AOM_USE_ANDROID_CPU_FEATURES) + + #include ++ ++#if defined(__FreeBSD__) ++static unsigned long getauxval(unsigned long type) ++{ ++ /* Only AT_HWCAP* return unsigned long */ ++ if (type != AT_HWCAP && type != AT_HWCAP2) { ++ return 0; ++ } ++ ++ unsigned long ret = 0; ++ elf_aux_info(type, &ret, sizeof(ret)); ++ return ret; ++} ++#endif + + // Define hwcap values ourselves: building with an old auxv header where these + // hwcap values are not defined should not prevent features from being enabled. diff --git a/multimedia/aom/files/patch-aom__ports_aarch64__cpudetect.c b/multimedia/aom/files/patch-aom__ports_aarch64__cpudetect.c new file mode 100644 index 0000000000000..41f34b516c232 --- /dev/null +++ b/multimedia/aom/files/patch-aom__ports_aarch64__cpudetect.c @@ -0,0 +1,29 @@ +- Implement runtime detection on FreeBSD + +--- aom_ports/aarch64_cpudetect.c.orig 2023-11-30 23:18:12 UTC ++++ aom_ports/aarch64_cpudetect.c +@@ -95,9 +95,23 @@ static int arm_get_cpu_caps(void) { + return flags; + } + +-#elif defined(__linux__) // end defined(AOM_USE_ANDROID_CPU_FEATURES) ++#elif defined(__linux__) || defined(__FreeBSD__) // end defined(AOM_USE_ANDROID_CPU_FEATURES) + + #include ++ ++#if defined(__FreeBSD__) ++static unsigned long getauxval(unsigned long type) ++{ ++ /* Only AT_HWCAP* return unsigned long */ ++ if (type != AT_HWCAP && type != AT_HWCAP2) { ++ return 0; ++ } ++ ++ unsigned long ret = 0; ++ elf_aux_info(type, &ret, sizeof(ret)); ++ return ret; ++} ++#endif + + // Define hwcap values ourselves: building with an old auxv header where these + // hwcap values are not defined should not prevent features from being enabled. diff --git a/multimedia/aom/files/patch-aom__ports_arm__cpudetect.c b/multimedia/aom/files/patch-aom__ports_arm__cpudetect.c deleted file mode 100644 index c8bce475ce5e6..0000000000000 --- a/multimedia/aom/files/patch-aom__ports_arm__cpudetect.c +++ /dev/null @@ -1,41 +0,0 @@ -- Assume NEON is enabled on aarch64 -- Implement NEON runtime detection on FreeBSD - ---- aom_ports/arm_cpudetect.c.orig 2021-10-01 00:23:06 UTC -+++ aom_ports/arm_cpudetect.c -@@ -38,7 +38,7 @@ static int arm_cpu_env_mask(void) { - return env && *env ? (int)strtol(env, NULL, 0) : ~0; - } - --#if !CONFIG_RUNTIME_CPU_DETECT || defined(__APPLE__) -+#if !CONFIG_RUNTIME_CPU_DETECT || defined(__ARM_NEON) || defined(__APPLE__) - - int aom_arm_cpu_caps(void) { - /* This function should actually be a no-op. There is no way to adjust any of -@@ -143,7 +143,25 @@ int aom_arm_cpu_caps(void) { - } - return flags & mask; - } --#else /* end __linux__ */ -+#elif defined(__FreeBSD__) -+ -+#include -+ -+int aom_arm_cpu_caps(void) { -+ int flags; -+ int mask; -+ u_long hwcap = 0; -+ if (!arm_cpu_env_flags(&flags)) { -+ return flags; -+ } -+ mask = arm_cpu_env_mask(); -+ elf_aux_info(AT_HWCAP, &hwcap, sizeof(hwcap)); -+#if HAVE_NEON -+ if (hwcap & HWCAP_NEON) flags |= HAS_NEON; -+#endif -+ return flags & mask; -+} -+#else /* end __FreeBSD__ */ - #error \ - "Runtime CPU detection selected, but no CPU detection method " \ - "available for your platform. Rerun cmake with -DCONFIG_RUNTIME_CPU_DETECT=0." diff --git a/multimedia/aom/files/patch-build_cmake_cpu.cmake b/multimedia/aom/files/patch-build_cmake_cpu.cmake index 462c1f1e0aab1..92353162f0a31 100644 --- a/multimedia/aom/files/patch-build_cmake_cpu.cmake +++ b/multimedia/aom/files/patch-build_cmake_cpu.cmake @@ -1,13 +1,13 @@ - Don't enable NEON on armv6 similar to build/cmake/rtcd.pl ---- build/cmake/cpu.cmake.orig 2023-08-14 21:22:47 UTC +--- build/cmake/cpu.cmake.orig 2023-11-30 23:18:12 UTC +++ build/cmake/cpu.cmake -@@ -9,7 +9,7 @@ - # can obtain it at www.aomedia.org/license/patent. - # +@@ -61,7 +61,7 @@ if("${AOM_TARGET_CPU}" STREQUAL "arm64") + endif() + endforeach() --if("${AOM_TARGET_CPU}" MATCHES "^arm") -+if("${AOM_TARGET_CPU}" MATCHES "^arm" AND NOT "${AOM_TARGET_CPU}" MATCHES "^armv6") +-elseif("${AOM_TARGET_CPU}" MATCHES "^arm") ++elseif("${AOM_TARGET_CPU}" MATCHES "^arm" AND NOT "${AOM_TARGET_CPU}" MATCHES "^armv6") set(AOM_ARCH_ARM 1) - if("${AOM_TARGET_CPU}" STREQUAL "arm64") - set(AOM_ARCH_AARCH64 1) + set(RTCD_ARCH_ARM "yes") + diff --git a/multimedia/aom/pkg-plist b/multimedia/aom/pkg-plist index a80efc1221b1b..3042d3eabe093 100644 --- a/multimedia/aom/pkg-plist +++ b/multimedia/aom/pkg-plist @@ -13,5 +13,5 @@ include/aom/aomdx.h lib/libaom.a lib/libaom.so lib/libaom.so.3 -lib/libaom.so.3.7.1 +lib/libaom.so.3.8.0 libdata/pkgconfig/aom.pc