git: 45ac01128f79 - main - graphics/sharpconstruct: fix build on powerpc64le

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Fri, 03 Dec 2021 03:05:00 UTC
The branch main has been updated by pkubaj:

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

commit 45ac01128f797d52763ac56a6bfa867aad1bc656
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2021-12-03 02:57:02 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2021-12-03 02:57:02 +0000

    graphics/sharpconstruct: fix build on powerpc64le
    
    Use GCC's SSE translation.
    Remove -msse and add it to i386 flags.
---
 graphics/sharpconstruct/Makefile                    | 14 ++++++++++++--
 graphics/sharpconstruct/files/patch-src_Makefile.in | 11 +++++++++++
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/graphics/sharpconstruct/Makefile b/graphics/sharpconstruct/Makefile
index 7235e4ad6044..7c95470d9c36 100644
--- a/graphics/sharpconstruct/Makefile
+++ b/graphics/sharpconstruct/Makefile
@@ -13,18 +13,28 @@ LICENSE_FILE=	${WRKSRC}/COPYING
 LIB_DEPENDS=	libgtkglextmm-x11-1.2.so:x11-toolkits/gtkglextmm \
 		libglademm-2.4.so:devel/libglademm24
 
-ONLY_FOR_ARCHS=	i386 amd64
+ONLY_FOR_ARCHS=	amd64 i386 powerpc64le
 ONLY_FOR_ARCHS_REASON=	uses SSE instructions
 
-USES=		compiler:c++11-lang gl tar:bzip2 gmake pkgconfig
+USES=		gl tar:bzip2 gmake pkgconfig
 USE_CXXSTD=	c++11
 GNU_CONFIGURE=	yes
 USE_GL=		gl glu
 
+CXXFLAGS_i386=	-msse
 PLIST_FILES=	bin/${PORTNAME} \
 		man/man1/${PORTNAME}.1.gz
 PORTDATA=	*
 
+.include <bsd.port.options.mk>
+
+.if ${ARCH} == powerpc64le
+CXXFLAGS+=	-DNO_WARN_X86_INTRINSICS
+USES+=		compiler:gcc-c++11-lib
+.else
+USES+=		compiler:c++11-lang
+.endif
+
 post-patch:
 	@${REINPLACE_CMD} -e 's|malloc.h|stdlib.h|' ${WRKSRC}/include/Align.hh
 	@${REINPLACE_CMD} -e 's|"/sharpconstruct|"|' ${WRKSRC}/src/MainWindow.cc
diff --git a/graphics/sharpconstruct/files/patch-src_Makefile.in b/graphics/sharpconstruct/files/patch-src_Makefile.in
new file mode 100644
index 000000000000..f89940df2bc5
--- /dev/null
+++ b/graphics/sharpconstruct/files/patch-src_Makefile.in
@@ -0,0 +1,11 @@
+--- src/Makefile.in.orig	2021-12-02 18:50:44 UTC
++++ src/Makefile.in
+@@ -172,7 +172,7 @@ sharedstatedir = ${prefix}/com
+ sysconfdir = ${prefix}/etc
+ target_alias = 
+ INCLUDES = -I../include
+-AM_CXXFLAGS = -Wall -msse $(libglademm_CFLAGS) $(gtkglextmm_CFLAGS) $(X_CFLAGS) $(BINRELOC_CFLAGS)
++AM_CXXFLAGS = -Wall $(libglademm_CFLAGS) $(gtkglextmm_CFLAGS) $(X_CFLAGS) $(BINRELOC_CFLAGS)
+ LDADD = $(libglademm_LIBS) $(gtkglextmm_LIBS) -lGL -lGLU $(X_LIBS)
+ sharpconstruct_SOURCES = \
+ 	ArcBall.cc \