aboutsummaryrefslogtreecommitdiff
path: root/games/stockfish/Makefile
diff options
context:
space:
mode:
authorTobias Kortkamp <tobik@FreeBSD.org>2021-04-29 06:09:33 +0000
committerTobias Kortkamp <tobik@FreeBSD.org>2021-05-01 17:55:48 +0000
commit93bbb52479092a8421fb5cf1af296c24f1de416b (patch)
tree1b67f6cf39f6319e5627fb48c6893004314031e9 /games/stockfish/Makefile
parent07be349a5855db581be5ec5d7bb0884259ca22c3 (diff)
downloadports-93bbb52479092a8421fb5cf1af296c24f1de416b.tar.gz
ports-93bbb52479092a8421fb5cf1af296c24f1de416b.zip
Diffstat (limited to 'games/stockfish/Makefile')
-rw-r--r--games/stockfish/Makefile42
1 files 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