git: 3c39406e8270 - main - security/libfido2: Convert REINPLACE_CMD to patch file

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Sat, 16 Apr 2022 04:21:29 UTC
The branch main has been updated by sunpoet:

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

commit 3c39406e827036f4b97d754db64beb343c988f02
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2022-04-16 03:56:22 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2022-04-16 04:19:10 +0000

    security/libfido2: Convert REINPLACE_CMD to patch file
---
 security/libfido2/Makefile                  |  3 +--
 security/libfido2/files/extra-patch-openssl | 26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/security/libfido2/Makefile b/security/libfido2/Makefile
index 1f7a5c424597..ecd68835e1af 100644
--- a/security/libfido2/Makefile
+++ b/security/libfido2/Makefile
@@ -24,10 +24,9 @@ OPTIONS_DEFINE=	DOCS
 
 .include <bsd.port.pre.mk>
 
-post-patch:
 # we do not ship libcrypto.pc in base system
 .if ${SSL_DEFAULT} == base
-	@${REINPLACE_CMD} -e '/libcrypto/d' ${WRKSRC}/CMakeLists.txt ${WRKSRC}/src/libfido2.pc.in
+EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-openssl
 .endif
 
 .include <bsd.port.post.mk>
diff --git a/security/libfido2/files/extra-patch-openssl b/security/libfido2/files/extra-patch-openssl
new file mode 100644
index 000000000000..6cab9adce02d
--- /dev/null
+++ b/security/libfido2/files/extra-patch-openssl
@@ -0,0 +1,26 @@
+--- CMakeLists.txt.orig	2022-01-17 12:42:03 UTC
++++ CMakeLists.txt
+@@ -196,14 +196,10 @@ if(MSVC)
+ else()
+ 	include(FindPkgConfig)
+ 	pkg_search_module(CBOR libcbor)
+-	pkg_search_module(CRYPTO libcrypto)
+ 	pkg_search_module(ZLIB zlib)
+ 
+ 	if(NOT CBOR_FOUND AND NOT HAVE_CBOR_H)
+ 		message(FATAL_ERROR "could not find libcbor")
+-	endif()
+-	if(NOT CRYPTO_FOUND AND NOT HAVE_OPENSSLV_H)
+-		message(FATAL_ERROR "could not find libcrypto")
+ 	endif()
+ 	if(NOT ZLIB_FOUND)
+ 		message(FATAL_ERROR "could not find zlib")
+--- src/libfido2.pc.in.orig	2022-01-17 12:42:03 UTC
++++ src/libfido2.pc.in
+@@ -7,6 +7,5 @@ Name: @PROJECT_NAME@
+ Description: A FIDO2 library
+ URL: https://github.com/yubico/libfido2
+ Version: @FIDO_VERSION@
+-Requires: libcrypto
+ Libs: -L${libdir} -lfido2
+ Cflags: -I${includedir}