# Created by: Gautam Mani # $FreeBSD$ PORTNAME= stockfish PORTVERSION= 2.3.1 CATEGORIES= games MASTER_SITES= http://cl.ly/2t3y2k2Y3Y1H/download/:src \ http://www.execve.net/sf/:src \ http://api.cld.me/2R1L1Y0V0b1M3M1B1D26/download/:book \ http://www.execve.net/sf/:book DISTNAME= stockfish-${PORTVERSION:S/.//g}-linux DISTFILES= stockfish-${PORTVERSION:S/.//g}-linux.zip:src \ sf-211-book.zip:book MAINTAINER= execve@gmail.com COMMENT= Open source chess engine LICENSE= GPLv3 USE_ZIP= yes WRKSRC= ${WRKDIR}/${DISTNAME}/src USE_GMAKE= yes MYARCH= ${ARCH} BOOKDIR= sf-211-book PORTDOCS= Readme.txt polyglot.ini PORTDATA= Book.bin FETCH_ARGS= -Fpr PLIST_FILES= bin/stockfish PLIST_DIRSTRY= share/data/${PORTNAME} \ share/docs/${PORTNAME} TGTBLD= build MYCC= gcc .if ${CC} == "clang" || ${CXX} == "clang++" MYCC= clang .endif OPTIONS_DEFINE= DOCS POPCNT_ENABLED PROFILE_BUILD POPCNT_ENABLED_DESC= Use the POPCNT instruction PROFILE_BUILD_DESC= Make a Profile build .include .if ${PORT_OPTIONS:MPROFILE_BUILD} TGTBLD= profile-build .endif .if ${PORT_OPTIONS:MPOPCNT_ENABLED} .if ${ARCH} != "amd64" BROKEN= POPCNT_ENABLED compiles only on amd64 .endif .endif .include # workaround the ARCH usage in the stockfish Makefile .if ${ARCH} == "i386" MYARCH= x86-32 .elif ${ARCH} == "amd64" .if ${PORT_OPTIONS:MPOPCNT_ENABLED} MYARCH= x86-64-modern .else MYARCH= x86-64 .endif .endif ALL_TARGET= ${TGTBLD} ARCH=${MYARCH} COMP=${MYCC} .if ${ARCH} == "ia64" || ${ARCH} == "powerpc" || ${ARCH} == "sparc64" BROKEN= Does not compile on ia64, powerpc, or sparc64 .endif do-install: ${INSTALL_PROGRAM} ${WRKSRC}/stockfish ${PREFIX}/bin/stockfish post-install: .if ${PORT_OPTIONS:MDOCS} ${MKDIR} ${DOCSDIR} ${INSTALL_DATA} ${WRKDIR}/${DISTNAME}/Readme.txt ${DOCSDIR} ${INSTALL_DATA} ${WRKDIR}/${DISTNAME}/polyglot.ini ${DOCSDIR} .endif .if !defined(NOPORTDATA) ${MKDIR} ${DATADIR} ${INSTALL_DATA} ${WRKDIR}/${BOOKDIR}/${PORTDATA} ${DATADIR} .endif .include