From nobody@FreeBSD.org  Sun Oct 14 08:36:16 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id C79D3884
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 14 Oct 2012 08:36:16 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 8C7738FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 14 Oct 2012 08:36:16 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id q9E8aGMh076481
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 14 Oct 2012 08:36:16 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id q9E8aGxg076480;
	Sun, 14 Oct 2012 08:36:16 GMT
	(envelope-from nobody)
Message-Id: <201210140836.q9E8aGxg076480@red.freebsd.org>
Date: Sun, 14 Oct 2012 08:36:16 GMT
From: Gautam Mani <execve@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [MAINT UPD] Update games/stockfish to to 2.3.1
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         172686
>Category:       ports
>Synopsis:       Update games/stockfish to to 2.3.1
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    madpilot
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 14 08:40:01 UTC 2012
>Closed-Date:    Sat Oct 20 08:39:45 UTC 2012
>Last-Modified:  Sat Oct 20 08:39:45 UTC 2012
>Originator:     Gautam Mani
>Release:        9-STABLE
>Organization:
>Environment:
FreeBSD mellon 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #8 r+b9c6677-dirty: Sat Oct  6 13:25:32 IST 2012     root@mellon:/usr/obj/usr/src/sys/MYKERNEL  amd64
>Description:
Summary of changes:

1. Port is updated to support stockfish-2.3.1
2. Book file is still 2.1.1 version level and compatible.
3. Basic support for clang added. 
4. Restructured options due to further changes in the upstream options



>How-To-Repeat:
NA
>Fix:
NA

Patch attached with submission follows:

diff --git a/ports/stockfish/Makefile b/ports/stockfish/Makefile
index 32d621b..ff2ac84 100644
--- a/ports/stockfish/Makefile
+++ b/ports/stockfish/Makefile
@@ -2,18 +2,18 @@
 # Date created:		Apr 21 2011
 # Whom:			Gautam Mani <execve@gmail.com>
 #
-# $FreeBSD: ports/games/stockfish/Makefile,v 1.5 2012/01/30 18:49:03 jgh Exp $
+# $FreeBSD$
 #
 
 PORTNAME=	stockfish
-PORTVERSION=	2.2.2
+PORTVERSION=	2.3.1
 CATEGORIES=	games
-MASTER_SITES=	http://dl.dropbox.com/u/2116588/sf-archive/:src \
+MASTER_SITES=	http://cl.ly/2t3y2k2Y3Y1H/download/:src \
 		http://www.execve.net/sf/:src \
 		http://f.cl.ly/items/1y0Q3P2n0I2S0g0Y100E/:book \
 		http://www.execve.net/sf/:book
-DISTNAME=	stockfish-${PORTVERSION:S/.//g}-ja
-DISTFILES=	stockfish-${PORTVERSION:S/.//g}-ja.zip:src \
+DISTNAME=	stockfish-${PORTVERSION:S/.//g}-linux
+DISTFILES=	stockfish-${PORTVERSION:S/.//g}-linux.zip:src \
 		sf-211-book.zip:book
 
 MAINTAINER=	execve@gmail.com
@@ -28,17 +28,21 @@ 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}
 
-ALL_TARGET=	build ARCH=${MYARCH}
+TGTBLD=		build
+MYCC=		gcc
 
-OPTIONS=	POPCNT_PROFILE_BUILD       "Make a Profile build (POPCNT enabled)" Off \
-		PROFILE_BUILD "Make a Profile build" Off
+.if ${CC} == "clang" || ${CXX} == "clang++"
+MYCC=	clang
+.endif
 
-TGTBLD=		build
+OPTIONS=	POPCNT_ENABLED       "Use the POPCNT instruction" Off \
+		PROFILE_BUILD "Make a Profile build" Off
 
 .include <bsd.port.options.mk>
 
@@ -46,21 +50,25 @@ TGTBLD=		build
 TGTBLD=		profile-build
 .endif
 
-.if defined(WITH_POPCNT_PROFILE_BUILD)
+.if defined(WITH_POPCNT_ENABLED)
 .if ${ARCH} != "amd64"
-BROKEN=		WITH_POPCNT_PROFILE_BUILD compiles only on amd64
+BROKEN=		WITH_POPCNT_ENABLED compiles only on amd64
 .endif
-TGTBLD=		popcnt-profile-build
 .endif
 
 .include <bsd.port.pre.mk>
 
 # workaround the ARCH usage in the stockfish Makefile
-.if ${MYARCH} == "i386"
-ALL_TARGET=	${TGTBLD} ARCH=x86-32
-.elif ${MYARCH} == "amd64"
-ALL_TARGET=	${TGTBLD} ARCH=x86-64
+.if ${ARCH} == "i386"
+MYARCH=		x86-32
+.elif ${ARCH} == "amd64"
+.if defined(WITH_POPCNT_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
diff --git a/ports/stockfish/distinfo b/ports/stockfish/distinfo
index 5e17538..fca568a 100644
--- a/ports/stockfish/distinfo
+++ b/ports/stockfish/distinfo
@@ -1,4 +1,4 @@
-SHA256 (stockfish-222-ja.zip) = 068ccf7d1088e2df880fcfd326f0ac3920b05953d34ec39e6265391328d6fb9b
-SIZE (stockfish-222-ja.zip) = 2272728
+SHA256 (stockfish-231-linux.zip) = 119acf339d18b8b23c6142a72c9d8e09edf385c20a811a458bc0b63472c6a682
+SIZE (stockfish-231-linux.zip) = 852252
 SHA256 (sf-211-book.zip) = fc4b2964128278dcf076b1601a5fb7a6cc88d87d9f617d32fa82aeb05cfdff74
 SIZE (sf-211-book.zip) = 8831695


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->madpilot 
Responsible-Changed-By: madpilot 
Responsible-Changed-When: Sun Oct 14 18:35:56 UTC 2012 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=172686 
State-Changed-From-To: open->feedback 
State-Changed-By: madpilot 
State-Changed-When: Sun Oct 14 21:44:10 UTC 2012 
State-Changed-Why:  
Ask for maintainer approval. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=172686 

From: Guido Falsi <madpilot@FreeBSD.org>
To: bug-followup@FreeBSD.org, execve@gmail.com
Cc:  
Subject: Re: ports/172686: [MAINT UPD] Update games/stockfish to to 2.3.1
Date: Sun, 14 Oct 2012 23:43:46 +0200

 This is a multi-part message in MIME format.
 --------------020108030605030001090708
 Content-Type: text/plain; charset=ISO-8859-15
 Content-Transfer-Encoding: 7bit
 
 Hi,
 
 Thanks for you patch!
 
 I have modified it to convert the port to the new options framework.
 
 Can you approve the patch?
 
 -- 
 Guido Falsi <madpilot@FreeBSD.org>
 
 --------------020108030605030001090708
 Content-Type: text/plain; charset=us-ascii;
  name="stockfish.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="stockfish.diff"
 
 Index: Makefile
 ===================================================================
 --- Makefile	(revision 305889)
 +++ Makefile	(working copy)
 @@ -1,19 +1,15 @@
 -# New ports collection makefile for:   stockfish
 -# Date created:		Apr 21 2011
 -# Whom:			Gautam Mani <execve@gmail.com>
 -#
 +# Created by: Gautam Mani <execve@gmail.com>
  # $FreeBSD$
 -#
  
  PORTNAME=	stockfish
 -PORTVERSION=	2.2.2
 +PORTVERSION=	2.3.1
  CATEGORIES=	games
 -MASTER_SITES=	http://dl.dropbox.com/u/2116588/sf-archive/:src \
 +MASTER_SITES=	http://cl.ly/2t3y2k2Y3Y1H/download/:src \
  		http://www.execve.net/sf/:src \
 -		http://f.cl.ly/items/1y0Q3P2n0I2S0g0Y100E/:book \
 +		http://api.cld.me/2R1L1Y0V0b1M3M1B1D26/download/:book \
  		http://www.execve.net/sf/:book
 -DISTNAME=	stockfish-${PORTVERSION:S/.//g}-ja
 -DISTFILES=	stockfish-${PORTVERSION:S/.//g}-ja.zip:src \
 +DISTNAME=	stockfish-${PORTVERSION:S/.//g}-linux
 +DISTFILES=	stockfish-${PORTVERSION:S/.//g}-linux.zip:src \
  		sf-211-book.zip:book
  
  MAINTAINER=	execve@gmail.com
 @@ -28,39 +24,48 @@
  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}
  
 -ALL_TARGET=	build ARCH=${MYARCH}
 +TGTBLD=		build
 +MYCC=		gcc
  
 -OPTIONS=	POPCNT_PROFILE_BUILD       "Make a Profile build (POPCNT enabled)" Off \
 -		PROFILE_BUILD "Make a Profile build" Off
 +.if ${CC} == "clang" || ${CXX} == "clang++"
 +MYCC=	clang
 +.endif
  
 -TGTBLD=		build
 +OPTIONS_DEFINE=	DOCS POPCNT_ENABLED PROFILE_BUILD
 +POPCNT_ENABLED_DESC=	Use the POPCNT instruction
 +PROFILE_BUILD_DESC=	Make a Profile build
  
  .include <bsd.port.options.mk>
  
 -.if defined(WITH_PROFILE_BUILD)
 +.if ${PORT_OPTIONS:MPROFILE_BUILD}
  TGTBLD=		profile-build
  .endif
  
 -.if defined(WITH_POPCNT_PROFILE_BUILD)
 +.if ${PORT_OPTIONS:MPOPCNT_ENABLED}
  .if ${ARCH} != "amd64"
 -BROKEN=		WITH_POPCNT_PROFILE_BUILD compiles only on amd64
 +BROKEN=		POPCNT_ENABLED compiles only on amd64
  .endif
 -TGTBLD=		popcnt-profile-build
  .endif
  
  .include <bsd.port.pre.mk>
  
  # workaround the ARCH usage in the stockfish Makefile
 -.if ${MYARCH} == "i386"
 -ALL_TARGET=	${TGTBLD} ARCH=x86-32
 -.elif ${MYARCH} == "amd64"
 -ALL_TARGET=	${TGTBLD} ARCH=x86-64
 +.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
 @@ -70,7 +75,7 @@
  	${INSTALL_PROGRAM} ${WRKSRC}/stockfish ${PREFIX}/bin/stockfish
  
  post-install:
 -.if !defined(NOPORTDOCS)
 +.if ${PORT_OPTIONS:MDOCS}
  	${MKDIR} ${DOCSDIR}
  	${INSTALL_DATA} ${WRKDIR}/${DISTNAME}/Readme.txt ${DOCSDIR}
  	${INSTALL_DATA} ${WRKDIR}/${DISTNAME}/polyglot.ini ${DOCSDIR}
 Index: distinfo
 ===================================================================
 --- distinfo	(revision 305889)
 +++ distinfo	(working copy)
 @@ -1,4 +1,4 @@
 -SHA256 (stockfish-222-ja.zip) = 068ccf7d1088e2df880fcfd326f0ac3920b05953d34ec39e6265391328d6fb9b
 -SIZE (stockfish-222-ja.zip) = 2272728
 +SHA256 (stockfish-231-linux.zip) = 119acf339d18b8b23c6142a72c9d8e09edf385c20a811a458bc0b63472c6a682
 +SIZE (stockfish-231-linux.zip) = 852252
  SHA256 (sf-211-book.zip) = fc4b2964128278dcf076b1601a5fb7a6cc88d87d9f617d32fa82aeb05cfdff74
  SIZE (sf-211-book.zip) = 8831695
 
 --------------020108030605030001090708--

From: Gautam <execve@gmail.com>
To: Guido Falsi <madpilot@freebsd.org>
Cc: bug-followup@freebsd.org
Subject: Re: ports/172686: [MAINT UPD] Update games/stockfish to to 2.3.1
Date: Fri, 19 Oct 2012 21:50:57 +0530

 --bcaec54b492484d78a04cc6be362
 Content-Type: text/plain; charset=ISO-8859-1
 
 Yes, OK.
 
 Thanks for your support!
 
 Cheers,
 Gautam
 
 On Mon, Oct 15, 2012 at 3:13 AM, Guido Falsi <madpilot@freebsd.org> wrote:
 
 > Hi,
 >
 > Thanks for you patch!
 >
 > I have modified it to convert the port to the new options framework.
 >
 > Can you approve the patch?
 >
 > --
 > Guido Falsi <madpilot@FreeBSD.org>
 >
 
 --bcaec54b492484d78a04cc6be362
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 <font face=3D"verdana,sans-serif">Yes, OK.<br><br>Thanks for your support!<=
 br><br>Cheers,<br>Gautam<br></font><br><div class=3D"gmail_quote">On Mon, O=
 ct 15, 2012 at 3:13 AM, Guido Falsi <span dir=3D"ltr">&lt;<a href=3D"mailto=
 :madpilot@freebsd.org" target=3D"_blank">madpilot@freebsd.org</a>&gt;</span=
 > wrote:<br>
 <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
 x #ccc solid;padding-left:1ex">Hi,<br>
 <br>
 Thanks for you patch!<br>
 <br>
 I have modified it to convert the port to the new options framework.<br>
 <br>
 Can you approve the patch?<br>
 <span class=3D"HOEnZb"><font color=3D"#888888"><br>
 --<br>
 Guido Falsi &lt;madpilot@FreeBSD.org&gt;<br>
 </font></span></blockquote></div><br>
 
 --bcaec54b492484d78a04cc6be362--
State-Changed-From-To: feedback->open 
State-Changed-By: madpilot 
State-Changed-When: Fri Oct 19 16:31:31 UTC 2012 
State-Changed-Why:  
Maintainer has approved. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=172686 
State-Changed-From-To: open->closed 
State-Changed-By: madpilot 
State-Changed-When: Sat Oct 20 08:39:45 UTC 2012 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=172686 
>Unformatted:
