git: c2664553adba - main - www/node16: Fix build with OpenSSL 3

From: Juraj Lutter <otis_at_FreeBSD.org>
Date: Tue, 13 Jun 2023 06:38:58 UTC
The branch main has been updated by otis:

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

commit c2664553adba708d98bffc275a651955d73edf1c
Author:     Juraj Lutter <otis@FreeBSD.org>
AuthorDate: 2023-06-12 06:54:34 +0000
Commit:     Juraj Lutter <otis@FreeBSD.org>
CommitDate: 2023-06-13 06:38:20 +0000

    www/node16: Fix build with OpenSSL 3
    
    - This was tested only with OpenSSL 3 from base but not with openssl30
      or openssl31 ports.
    - Regen patches
    
    PR:     271656
---
 ...eps_openssl_config_archs_linux-elf_no-asm_openssl.gypi |  4 ++--
 .../files/patch-deps_openssl_openssl-cl__no__asm.gypi     |  6 +++---
 www/node16/files/patch-deps_openssl_openssl__no__asm.gypi |  6 +++---
 www/node16/files/patch-node.gypi                          |  4 ++--
 www/node16/files/patch-src_crypto_crypto__util.cc         | 15 +++++++++++++++
 5 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/www/node16/files/patch-deps_openssl_config_archs_linux-elf_no-asm_openssl.gypi b/www/node16/files/patch-deps_openssl_config_archs_linux-elf_no-asm_openssl.gypi
index 1da46abc11ad..aad8ab036c0b 100644
--- a/www/node16/files/patch-deps_openssl_config_archs_linux-elf_no-asm_openssl.gypi
+++ b/www/node16/files/patch-deps_openssl_config_archs_linux-elf_no-asm_openssl.gypi
@@ -1,6 +1,6 @@
---- deps/openssl/config/archs/linux-elf/no-asm/openssl.gypi.orig	2021-03-17 20:16:25 UTC
+--- deps/openssl/config/archs/linux-elf/no-asm/openssl.gypi.orig	2023-03-28 21:14:18 UTC
 +++ deps/openssl/config/archs/linux-elf/no-asm/openssl.gypi
-@@ -698,7 +698,7 @@
+@@ -699,7 +699,7 @@
        '-Wall -O3 -fomit-frame-pointer',
      ],
      'openssl_ex_libs_linux-elf': [
diff --git a/www/node16/files/patch-deps_openssl_openssl-cl__no__asm.gypi b/www/node16/files/patch-deps_openssl_openssl-cl__no__asm.gypi
index 8966d6b4ba0d..3aa5573e17ef 100644
--- a/www/node16/files/patch-deps_openssl_openssl-cl__no__asm.gypi
+++ b/www/node16/files/patch-deps_openssl_openssl-cl__no__asm.gypi
@@ -1,4 +1,4 @@
---- deps/openssl/openssl-cl_no_asm.gypi.orig	2020-09-08 12:17:10 UTC
+--- deps/openssl/openssl-cl_no_asm.gypi.orig	2023-03-28 21:14:18 UTC
 +++ deps/openssl/openssl-cl_no_asm.gypi
 @@ -1,4 +1,5 @@
  {
@@ -6,8 +6,8 @@
    'conditions': [
      ['target_arch=="ppc" and OS=="aix"', {
        'includes': ['config/archs/aix-gcc/no-asm/openssl-cl.gypi'],
-@@ -47,7 +48,7 @@
-       'includes': ['config/archs/linux64-mips64/no-asm/openssl-cl.gypi'],
+@@ -49,7 +50,7 @@
+       'includes': ['config/archs/linux64-riscv64/no-asm/openssl-cl.gypi'],
      }, {
        # Other architectures don't use assembly
 -      'includes': ['config/archs/linux-x86_64/no-asm/openssl-cl.gypi'],
diff --git a/www/node16/files/patch-deps_openssl_openssl__no__asm.gypi b/www/node16/files/patch-deps_openssl_openssl__no__asm.gypi
index 1fef0c4ca71f..fbce5b5affea 100644
--- a/www/node16/files/patch-deps_openssl_openssl__no__asm.gypi
+++ b/www/node16/files/patch-deps_openssl_openssl__no__asm.gypi
@@ -1,7 +1,7 @@
---- deps/openssl/openssl_no_asm.gypi.orig	2020-09-08 12:17:11 UTC
+--- deps/openssl/openssl_no_asm.gypi.orig	2023-03-28 21:14:18 UTC
 +++ deps/openssl/openssl_no_asm.gypi
-@@ -48,7 +48,7 @@
-       'includes': ['config/archs/linux64-mips64/no-asm/openssl.gypi'],
+@@ -50,7 +50,7 @@
+       'includes': ['config/archs/linux64-riscv64/no-asm/openssl.gypi'],
      }, {
        # Other architectures don't use assembly
 -      'includes': ['config/archs/linux-x86_64/no-asm/openssl.gypi'],
diff --git a/www/node16/files/patch-node.gypi b/www/node16/files/patch-node.gypi
index ff86f35a170b..9b726fefe1f4 100644
--- a/www/node16/files/patch-node.gypi
+++ b/www/node16/files/patch-node.gypi
@@ -1,6 +1,6 @@
---- node.gypi.orig	2021-03-03 05:40:19 UTC
+--- node.gypi.orig	2023-03-28 21:14:21 UTC
 +++ node.gypi
-@@ -319,6 +319,9 @@
+@@ -338,6 +338,9 @@
      [ 'node_use_openssl=="true"', {
        'defines': [ 'HAVE_OPENSSL=1' ],
        'conditions': [
diff --git a/www/node16/files/patch-src_crypto_crypto__util.cc b/www/node16/files/patch-src_crypto_crypto__util.cc
new file mode 100644
index 000000000000..e31cabd10570
--- /dev/null
+++ b/www/node16/files/patch-src_crypto_crypto__util.cc
@@ -0,0 +1,15 @@
+--- src/crypto/crypto_util.cc.orig	2023-06-12 06:44:17 UTC
++++ src/crypto/crypto_util.cc
+@@ -194,10 +194,12 @@ void InitCryptoOnce() {
+   // No-op with OPENSSL_NO_COMP builds of OpenSSL.
+   sk_SSL_COMP_zero(SSL_COMP_get_compression_methods());
+ 
++#if OPENSSL_VERSION_MAJOR < 3
+ #ifndef OPENSSL_NO_ENGINE
+   ERR_load_ENGINE_strings();
+   ENGINE_load_builtin_engines();
+ #endif  // !OPENSSL_NO_ENGINE
++#endif  // OPENSSL_VERSION_MAJOR < 3
+ 
+   NodeBIO::GetMethod();
+ }