git: f08b67611f0b - main - devel/py-awscrt: fix build on powerpc64le

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Mon, 25 Jul 2022 09:27:53 UTC
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f08b67611f0b19c0ee8d9053ee4d22e09b03f2b1

commit f08b67611f0b19c0ee8d9053ee4d22e09b03f2b1
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2022-07-25 09:27:02 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2022-07-25 09:27:40 +0000

    devel/py-awscrt: fix build on powerpc64le
    
      Unknown processor:powerpc64le
---
 devel/py-awscrt/files/patch-crt_aws-lc_CMakeLists.txt      | 11 +++++++++++
 ...atch-crt_aws-lc_crypto_fipsmodule_cpucap_cpu__ppc64le.c | 14 ++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/devel/py-awscrt/files/patch-crt_aws-lc_CMakeLists.txt b/devel/py-awscrt/files/patch-crt_aws-lc_CMakeLists.txt
new file mode 100644
index 000000000000..da35bc3d80ff
--- /dev/null
+++ b/devel/py-awscrt/files/patch-crt_aws-lc_CMakeLists.txt
@@ -0,0 +1,11 @@
+--- crt/aws-lc/CMakeLists.txt.orig	2022-07-25 08:51:35 UTC
++++ crt/aws-lc/CMakeLists.txt
+@@ -623,7 +623,7 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm*")
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "mips")
+   # Just to avoid the “unknown processor” error.
+   set(ARCH "generic")
+-elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le")
++elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "powerpc64le|ppc64le")
+   set(ARCH "ppc64le")
+ else()
+   message(FATAL_ERROR "Unknown processor:" ${CMAKE_SYSTEM_PROCESSOR})
diff --git a/devel/py-awscrt/files/patch-crt_aws-lc_crypto_fipsmodule_cpucap_cpu__ppc64le.c b/devel/py-awscrt/files/patch-crt_aws-lc_crypto_fipsmodule_cpucap_cpu__ppc64le.c
new file mode 100644
index 000000000000..a5494dd181ae
--- /dev/null
+++ b/devel/py-awscrt/files/patch-crt_aws-lc_crypto_fipsmodule_cpucap_cpu__ppc64le.c
@@ -0,0 +1,14 @@
+--- crt/aws-lc/crypto/fipsmodule/cpucap/cpu_ppc64le.c.orig	2020-10-26 11:38:52 UTC
++++ crt/aws-lc/crypto/fipsmodule/cpucap/cpu_ppc64le.c
+@@ -28,7 +28,11 @@
+ #endif
+ 
+ void OPENSSL_cpuid_setup(void) {
++#if defined(__linux__)
+   OPENSSL_ppc64le_hwcap2 = getauxval(AT_HWCAP2);
++#elif defined(__FreeBSD__)
++  elf_aux_info(AT_HWCAP2, &OPENSSL_ppc64le_hwcap2, sizeof(OPENSSL_ppc64le_hwcap2));
++#endif
+ }
+ 
+ int CRYPTO_is_PPC64LE_vcrypto_capable(void) {