From 7b1f463116b2285ff2b42fcbfa4f19ebe9493e39 Mon Sep 17 00:00:00 2001
From: Rozhuk Ivan <rozhuk.im@gmail.com>
Date: Fri, 10 Feb 2023 23:48:30 +0300
Subject: [PATCH] security/libressl: fix build

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269249
---
 security/libressl/Makefile | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/security/libressl/Makefile b/security/libressl/Makefile
index 574151ad0833..bfe656361242 100644
--- a/security/libressl/Makefile
+++ b/security/libressl/Makefile
@@ -49,6 +49,21 @@ LDFLAGS+=	-pthread
 INSTALL_TARGET=	install-strip
 TEST_TARGET=	check
 
+post-patch:
+	${REINPLACE_CMD} -e 's|endian\.h|sys/endian.h|g' \
+		${WRKSRC}/crypto/bn/bn_nist.c \
+		${WRKSRC}/crypto/des/cfb_enc.c \
+		${WRKSRC}/crypto/gost/gost2814789.c \
+		${WRKSRC}/crypto/gost/streebog.c \
+		${WRKSRC}/crypto/modes/modes_lcl.h \
+		${WRKSRC}/crypto/modes/xts128.c \
+		${WRKSRC}/crypto/rc4/rc4_enc.c \
+		${WRKSRC}/crypto/sha/sha_locl.h \
+		${WRKSRC}/crypto/sha/sha256.c \
+		${WRKSRC}/crypto/sha/sha512.c \
+		${WRKSRC}/crypto/whrlpool/wp_block.c \
+		${WRKSRC}/ssl/d1_pkt.c
+
 post-patch-MAN3-off:
 	${REINPLACE_CMD} -e '/^install-man:/s/install-man3//' \
 		-e '/$$(MAKE) $$(AM_MAKEFLAGS) install-data-hook/d' \