git: 93bbb5247909 - main - games/stockfish: Clean it up a little

Tobias Kortkamp tobik at FreeBSD.org
Sat May 1 18:33:57 UTC 2021


The branch main has been updated by tobik:

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

commit 93bbb52479092a8421fb5cf1af296c24f1de416b
Author:     Tobias Kortkamp <tobik at FreeBSD.org>
AuthorDate: 2021-04-29 06:09:33 +0000
Commit:     Tobias Kortkamp <tobik at FreeBSD.org>
CommitDate: 2021-05-01 17:55:48 +0000

    games/stockfish: Clean it up a little
    
    - Eliminate use-once variables
    - Do not abuse ALL_TARGET for MAKE_ARGS
    - Override PREFIX and CXX via MAKE_ARGS
    - Do not expose options that are amd64 only on other archs
    - Add missing MYARCH definitions and reattempt build on other archs
---
 games/stockfish/Makefile | 42 ++++++++++++++----------------------------
 1 file changed, 14 insertions(+), 28 deletions(-)

diff --git a/games/stockfish/Makefile b/games/stockfish/Makefile
index 80eb8b7c44a0..e64024d0f49f 100644
--- a/games/stockfish/Makefile
+++ b/games/stockfish/Makefile
@@ -14,35 +14,30 @@ COMMENT=	Open source chess engine
 LICENSE=	GPLv3
 LICENSE_FILE=	${WRKSRC}/../Copying.txt
 
-BROKEN_aarch64=	Fails to build: cannot detect architecture
-BROKEN_armv6=	Fails to configure: config-sanity: Error 1
-BROKEN_armv7=	Fails to configure: config-sanity: Error 1
-BROKEN_mips64=	Fails to build: cannot detect architecture
-BROKEN_riscv64=	Fails to configure: config-sanity: Error 1
-NOT_FOR_ARCHS=	sparc64
-
 USES=		compiler:c++11-lang gmake perl5
 USE_GITHUB=	yes
 GH_ACCOUNT=	official-stockfish
 GH_PROJECT=	Stockfish
 USE_PERL5=	build
 
+MAKE_ARGS=	ARCH=${MYARCH} \
+		COMP=${CHOSEN_COMPILER_TYPE} \
+		CXX="${CXX}" \
+		PREFIX=${PREFIX}
+ALL_TARGET=	build
 LDFLAGS+=	-fuse-ld=lld
 
 _NNUE_VER=	62ef826d1a6d
 
 WRKSRC_SUBDIR=	src
-MYARCH=		${ARCH}
-MYCC=		${CHOSEN_COMPILER_TYPE}
-TGTBLD=		build
 
 PLIST_FILES=	bin/stockfish
 PORTDOCS=	README.md
 
-#POPCNT AVX2 BMI2
 OPTIONS_DEFINE=		DOCS
 OPTIONS_RADIO=		MACHDEP
 OPTIONS_RADIO_MACHDEP=	AVX2 BMI2 POPCNT
+OPTIONS_EXCLUDE=	${${ARCH} != amd64:?${OPTIONS_RADIO_MACHDEP}:}
 
 AVX2_DESC=	Use the AVX2 instruction set
 BMI2_DESC=	Use the BMI2 instruction set
@@ -50,18 +45,6 @@ POPCNT_DESC=	Use the POPCNT instruction
 
 .include <bsd.port.options.mk>
 
-.if ${PORT_OPTIONS:MPOPCNT} && ${ARCH} != amd64
-BROKEN=		POPCNT compiles only on amd64
-.endif
-
-.if ${PORT_OPTIONS:MAVX2} && ${ARCH} != amd64
-BROKEN=		AVX compiles only on amd64
-.endif
-
-.if ${PORT_OPTIONS:MBMI2} && ${ARCH} != amd64
-BROKEN=		BMI compiles only on amd64
-.endif
-
 # workaround the ARCH usage in the stockfish Makefile
 .if ${ARCH} == "i386"
 MYARCH=		x86-32
@@ -75,19 +58,22 @@ MYARCH=		x86-64-modern
 .  else
 MYARCH=		x86-64
 .  endif
+.elif ${ARCH} == aarch64
+MYARCH=		armv8
+.elif ${ARCH} == armv7
+MYARCH=		armv7-neon
 .elif ${ARCH} == powerpc
 MYARCH=		ppc-32
 .elif ${ARCH:Mpowerpc64*}
 MYARCH=		ppc-64
+.elif ${ARCH:M*64*}
+MYARCH=		general-64
+.else
+MYARCH=		general-32
 .endif
 
-ALL_TARGET=	${TGTBLD} ARCH=${MYARCH} COMP=${MYCC}
-
 post-patch:
 	@${CP} ${_DISTDIR}/nn-${_NNUE_VER}.nnue ${WRKSRC}/.
-	@${REINPLACE_CMD} -e "s/^PREFIX =/PREFIX ?=/" ${WRKSRC}/Makefile
-	@${REINPLACE_CMD} -e "s/CXX=g++/CXX=g++${GCC_DEFAULT}/" \
-		${WRKSRC}/Makefile
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/stockfish ${STAGEDIR}${PREFIX}/bin


More information about the dev-commits-ports-all mailing list