git: e3a741fd8b9e - main - security/openssl-unsafe: Fix build on i386

From: Bernard Spil <brnrd_at_FreeBSD.org>
Date: Mon, 18 Apr 2022 12:34:33 UTC
The branch main has been updated by brnrd:

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

commit e3a741fd8b9ea725013555c5e4f68162c46ee2d2
Author:     Bernard Spil <brnrd@FreeBSD.org>
AuthorDate: 2022-04-18 12:32:53 +0000
Commit:     Bernard Spil <brnrd@FreeBSD.org>
CommitDate: 2022-04-18 12:32:53 +0000

    security/openssl-unsafe: Fix build on i386
    
     * reuse fix from 231459
    
    PR:             261645
    Submitted by:   takefu airport fm
---
 security/openssl-unsafe/Makefile | 34 +++++++++++++++++++++-------------
 1 file changed, 21 insertions(+), 13 deletions(-)

diff --git a/security/openssl-unsafe/Makefile b/security/openssl-unsafe/Makefile
index 1d207767510e..7bb4ff27c971 100644
--- a/security/openssl-unsafe/Makefile
+++ b/security/openssl-unsafe/Makefile
@@ -11,24 +11,17 @@ COMMENT=	Unsafe SSL and crypto library
 LICENSE=	OpenSSL
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
-CPE_VERSION=	1.0.2k
-
 USES=		cpe perl5
-USE_PERL5=	build
-MAKE_ENV+=	LIBRPATH="${PREFIX}/openssl-unsafe/lib" GREP_OPTIONS= SHLIBVER=${OPENSSL_SHLIBVER}
-CFLAGS+=	-fPIC -DPIC
-SUB_FILES=	pkg-message
-PLIST_SUB+=	SHLIBVER=${OPENSSL_SHLIBVER}
-USE_LDCONFIG=	yes
+CPE_VERSION=	1.0.2k
 
+.if ${MACHINE} == "i386"
+#USE_GCC=	8+
+.endif
 USE_GITHUB=	yes
 GH_ACCOUNT=	PeterMosmans
 GH_TAGNAME=	c9ba19c
-
-.if ${/usr/bin/ld:L:tA} == /usr/bin/ld.lld
-BROKEN_i386=	ld: error: unknown argument: -Bforcearchive
-.endif
-MAKE_JOBS_UNSAFE=	yes
+USE_PERL5=	build
+USE_LDCONFIG=	yes
 
 CONFIGURE_ARGS=	enable-camellia enable-cms enable-ec enable-ec2m \
 		enable-ecdh enable-ecdsa enable-gost enable-idea enable-md2 enable-mdc2 \
@@ -36,6 +29,12 @@ CONFIGURE_ARGS=	enable-camellia enable-cms enable-ec enable-ec2m \
 		enable-ssl2 enable-ssl2-methods enable-ssl3 enable-weak-ssl-ciphers \
 		experimental-jpake experimental-store \
 		no-gmp sctp shared threads zlib zlib-dynamic
+MAKE_ENV+=	LIBRPATH="${PREFIX}/openssl-unsafe/lib" GREP_OPTIONS= SHLIBVER=${OPENSSL_SHLIBVER}
+MAKE_JOBS_UNSAFE=	yes
+CFLAGS+=	-fPIC -DPIC
+SUB_FILES=	pkg-message
+PLIST_SUB+=	SHLIBVER=${OPENSSL_SHLIBVER}
+
 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "mips64el"
 CONFIGURE_ARGS+=	enable-ec_nistp_64_gcc_128
 .endif
@@ -49,6 +48,7 @@ post-patch:
 	${REINPLACE_CMD} -e 's|m4 -B 8192|m4|g' \
 		${WRKSRC}/crypto/des/Makefile
 	${REINPLACE_CMD} -e 's|all install_docs |all |;s| tools$$||;s| build_tools$$||' ${WRKSRC}/Makefile.org
+	${REINPLACE_CMD} -e 's|\^GNU ld|GNU|' ${WRKSRC}/Makefile.shared
 
 do-configure:
 	${REINPLACE_CMD} -e "s|options 386|options|" \
@@ -66,6 +66,14 @@ post-configure:
 		-e 's|LIBVERSION=[^ ]* |LIBVERSION=${OPENSSL_SHLIBVER} |' \
 		${WRKSRC}/Makefile
 
+post-install:
+	${STRIP_CMD} ${STAGEDIR}${PREFIX}/openssl-unsafe/bin/openssl
+	${STRIP_CMD} ${STAGEDIR}${PREFIX}/openssl-unsafe/lib/libcrypto.so.${OPENSSL_SHLIBVER}
+	${STRIP_CMD} ${STAGEDIR}${PREFIX}/openssl-unsafe/lib/libssl.so.${OPENSSL_SHLIBVER}
+.for i in ubsec gost capi gmp atalla sureware nuron cswift 4758cca padlock aep chil
+	${STRIP_CMD} ${STAGEDIR}${PREFIX}/openssl-unsafe/lib/engines/lib${i}.so
+.endfor
+
 test: build
 	cd ${WRKSRC} && ${MAKE} test