Bug 64454 - [New Port] games/dotgnu-nim - traditional "Nim" game in C#
Summary: [New Port] games/dotgnu-nim - traditional "Nim" game in C#
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Pav Lucistnik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-19 11:50 UTC by Michael Johnson
Modified: 2009-07-13 19:10 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Johnson 2004-03-19 11:50:20 UTC
- New port games/dotgnu-nim
   C# implementation of the traditional "Nim" game
- Update lang/pnet to install a script dotgnu-nim and other C# programs.

Fix: -- begin dotgnu-nim

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	games/dotgnu-nim/
#	games/dotgnu-nim/pkg-descr
#	games/dotgnu-nim/Makefile
#	games/dotgnu-nim/distinfo
#
echo c - games/dotgnu-nim/
mkdir -p games/dotgnu-nim/ > /dev/null 2>&1
echo x - games/dotgnu-nim/pkg-descr
sed 's/^X//' >games/dotgnu-nim/pkg-descr << 'END-of-games/dotgnu-nim/pkg-descr'
XMohan Embar wrote an implementation of the traditional "Nim" game to 
Xdemonstrate how to write a Model-View-Controller application using DotGNU 
XPortable.NET's System.Windows.Forms implementation.
X
XWWW:	http://www.dotgnu.org
END-of-games/dotgnu-nim/pkg-descr
echo x - games/dotgnu-nim/Makefile
sed 's/^X//' >games/dotgnu-nim/Makefile << 'END-of-games/dotgnu-nim/Makefile'
X# New ports collection makefile for:	dotgnu-nim
X# Date created:		2004-03-19
X# Whom:			Michael Johnson <ahze@ahze.net>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	dotgnu-nim
XPORTVERSION=	20040305
XCATEGORIES=	games
XMASTER_SITES=	http://dotgnu.org/
X
XMAINTAINER=	ahze@ahze.net
XCOMMENT=	C\# implementation of the traditional Nim game
X
XBUILD_DEPENDS=	cscc:${PORTSDIR}/lang/pnet-base \
X		csunit:${PORTSDIR}/lang/pnetlib
XRUN_DEPENDS=	cscc:${PORTSDIR}/lang/pnet-base \
X		csunit:${PORTSDIR}/lang/pnetlib
X
XUSE_REINPLACE=	yes
XUSE_XLIB=	yes
XWRKSRC=		${WRKDIR}/${PORTNAME}
XPORTDOCS=	README \
X		screenshot.jpg
XPNET_STRAP_BIN=	nim
XPLIST_FILES=	bin/nim \
X		bin/nim.exe
XSTRIP=		# Nothing To Strip
X
X.include "../../lang/pnet/Makefile.pnet"
X.include <bsd.port.pre.mk>
X
Xpost-extract: ilrun-cp-strap
X
Xpost-patch: ilrun-do-strap
X	@${REINPLACE_CMD} -e 's|cscc|cscc ${CSFLAGS}|' \
X		${WRKSRC}/Makefile
X
Xdo-install:
X	@${INSTALL_SCRIPT} ${WRKSRC}/${PNET_STRAP_BIN} ${PREFIX}/bin/nim
X	@${INSTALL_PROGRAM} ${ILSTRIP_CMD} ${WRKSRC}/nim.exe ${PREFIX}/bin
X.if !defined(NOPORTDOCS)
X	@${MKDIR} ${DOCSDIR}
X.for docfile in ${PORTDOCS}
X	@${INSTALL_DATA} ${WRKSRC}/${docfile} ${DOCSDIR}
X.endfor
X.endif
X
X.include <bsd.port.post.mk>
END-of-games/dotgnu-nim/Makefile
echo x - games/dotgnu-nim/distinfo
sed 's/^X//' >games/dotgnu-nim/distinfo << 'END-of-games/dotgnu-nim/distinfo'
XMD5 (dotgnu-nim-20040305.tar.gz) = 3a3fbe827fe628918353b61b39cd14fe
XSIZE (dotgnu-nim-20040305.tar.gz) = 61179
END-of-games/dotgnu-nim/distinfo
exit

--end dotgnu-nim

--begin pnet



--end pnet--zrK3bwC1RjNpKLn1E2PZ7cm8e3XR15qr7dyB0sYhzA7JZ7LM
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

diff -ruN lang/pnet.orig/Makefile.pnet lang/pnet/Makefile.pnet
--- lang/pnet.orig/Makefile.pnet	Fri Mar 19 04:26:01 2004
+++ lang/pnet/Makefile.pnet	Fri Mar 19 06:23:54 2004
@@ -8,12 +8,41 @@
 			http://www.southern-storm.com.au/download/
 PNET_MASTER_SITE_SUBDIR=	dotgnu/pnet/
 
+.if defined(PNET_STRAP_BIN) || defined(PNET_STRAP_SBIN)
+USE_REINPLACE=	yes
+.endif
+
+ILSTRIP_CMD?=	${LOCALBASE}/bin/ilstrip
+ILRUN_CMD?=	${LOCALBASE}/bin/ilrun
 
-ILSTRIP_CMD=	${LOCALBASE}/bin/ilstrip
+PNET_STRAP_SCRIPT=	${PORTSDIR}/lang/pnet/files/pnetstrap
+PNET_STRAP_SUFX?=	.exe
 
 .if defined(WITH_OPTIMIZED_CSFLAGS)
 CSFLAGS=-O2
 .endif
+
+ilrun-cp-strap:
+.for strap in ${PNET_STRAP_BIN}
+	@${CP} ${PNET_STRAP_SCRIPT} ${WRKSRC}/${strap}
+.endfor
+.for strap in ${PNET_STRAP_SBIN}
+	@${CP} ${PNET_STRAP_SCRIPT} ${WRKSRC}/${strap}
+.endfor
+
+ilrun-do-strap:
+.for strap in ${PNET_STRAP_BIN}
+	@${REINPLACE_CMD} -e 's|SH|${SH}|; \
+		s|ILRUN|${ILRUN_CMD} ${ILRUN_FLAGS}|; \
+		s|PNET_STRAP_BIN|${PREFIX}/bin/${strap}${PNET_STRAP_SUFX}|' \
+		${WRKSRC}/${strap}
+.endfor
+.for strap in ${PNET_STRAP_SBIN}
+	@${REINPLACE_CMD} -e 's|SH|${SH}|; \
+		s|ILRUN|${ILRUN_CMD} ${ILRUN_FLAGS}|; \
+		s|PNET_STRAP_BIN|${PREFIX}/sbin/${strap}${PNET_STRAP_SUFX}|' \
+		${WRKSRC}/${strap}
+.endfor
 
 pre-everything:: post-everything
 .if !defined(WITH_OPTIMIZED_CSFLAGS)
diff -ruN lang/pnet.orig/files/pnetstrap lang/pnet/files/pnetstrap
--- lang/pnet.orig/files/pnetstrap	Wed Dec 31 19:00:00 1969
+++ lang/pnet/files/pnetstrap	Fri Mar 19 05:14:45 2004
@@ -0,0 +1,2 @@
+#!SH
+ILRUN PNET_STRAP_BIN
Comment 1 Michael Johnson 2004-03-23 07:56:30 UTC
Please ignore the lang/pnet patch and use this.
It isn't friendly to all C# programs.

=== lang/pnet ==
diff -ruN lang/pnet.orig/Makefile.pnet lang/pnet/Makefile.pnet
--- lang/pnet.orig/Makefile.pnet	Mon Mar 22 20:51:51 2004
+++ lang/pnet/Makefile.pnet	Tue Mar 23 02:48:48 2004
@@ -8,11 +8,48 @@
  			http://www.southern-storm.com.au/download/
  PNET_MASTER_SITE_SUBDIR=	dotgnu/pnet/

-
  ILSTRIP_CMD=	${LOCALBASE}/bin/ilstrip
+ILRUN_CMD=	${LOCALBASE}/bin/ilrun

  .if defined(WITH_OPTIMIZED_CSFLAGS)
-CSFLAGS=-O2
+CSFLAGS+=-O2
+.endif
+
+.if defined(PNET_STRAP_BIN) || defined(PNET_STRAP_SBIN)
+
+PNET_STRAP_SUFX?=	.exe
+PNET_BIN_WRKDIR?=	${WRKDIR}/PNET_STRAP/bin
+PNET_SBIN_WRKDIR?=	${WRKDIR}/PNET_STRAP/sbin
+
+.for strap in ${PNET_STRAP_BIN}
+PLIST_FILES+=	bin/${strap}
+.endfor
+.for strap in ${PNET_STRAP_SBIN}
+PLIST_FILES+=	sbin/${strap}
+.endfor
+
+pre-patch: pnet-strap
+pnet-strap:
+	@${MKDIR} ${PNET_BIN_WRKDIR}
+	@${MKDIR} ${PNET_SBIN_WRKDIR}
+
+.for strap in ${PNET_STRAP_BIN}
+	@${ECHO_CMD} "#!${SH}" >> ${PNET_BIN_WRKDIR}/${strap}
+	@${ECHO_CMD} "${ILRUN_CMD} ${ILRUN_FLAGS} 
${PREFIX}/bin/${strap}${PNET_STRAP_SUFX}" >> 
${PNET_BIN_WRKDIR}/${strap}
+.endfor
+.for strap in ${PNET_STRAP_SBIN}
+	@${ECHO_CMD} -n "#!${SH}" >> ${PNET_SBIN_WRKDIR}/${strap}
+	@${EHCO_CMD} -n "${ILRUN_CMD} ${ILRUN_FLAGS} 
${PREFIX}/sbin/${strap}${PNET_STRAP_SUFX}" >> 
${PNET_SBIN_WRKDIR}/${strap}
+.endfor
+
+post-install: pnet-strap-install
+pnet-strap-install:
+.for strap in ${PNET_STRAP_BIN}
+	@${INSTALL_SCRIPT} ${PNET_BIN_WRKDIR}/${strap} ${PREFIX}/bin
+.endfor
+.for strap in ${PNET_STRAP_SBIN}
+	@${INSTALL_SCRIPT} ${PNET_SBIN_WRKDIR}/${strap} ${PREFIX}/sbin
+.endfor
  .endif

  pre-everything:: post-everything

=== games/dotgnu-nim ==

diff -ruN games/dotgnu-nim.orig/Makefile games/dotgnu-nim/Makefile
--- games/dotgnu-nim.orig/Makefile	Mon Mar 22 21:01:43 2004
+++ games/dotgnu-nim/Makefile	Tue Mar 23 02:49:43 2004
@@ -23,22 +23,18 @@
  WRKSRC=		${WRKDIR}/${PORTNAME}
  PORTDOCS=	README \
  		screenshot.jpg
-PNET_STRAP_BIN=	nim
-PLIST_FILES=	bin/nim \
-		bin/nim.exe
+PNET_STRAP_BIN=	nim
+PLIST_FILES=	bin/nim.exe
  STRIP=		# Nothing To Strip

  .include "../../lang/pnet/Makefile.pnet"
  .include <bsd.port.pre.mk>

-post-extract: ilrun-cp-strap
-
-post-patch: ilrun-do-strap
+post-patch:
  	@${REINPLACE_CMD} -e 's|cscc|cscc ${CSFLAGS}|' \
  		${WRKSRC}/Makefile

  do-install:
-	@${INSTALL_SCRIPT} ${WRKSRC}/${PNET_STRAP_BIN} ${PREFIX}/bin/nim
  	@${INSTALL_PROGRAM} ${ILSTRIP_CMD} ${WRKSRC}/nim.exe ${PREFIX}/bin
  .if !defined(NOPORTDOCS)
  	@${MKDIR} ${DOCSDIR}
Comment 2 Pav Lucistnik freebsd_committer freebsd_triage 2004-03-25 20:24:03 UTC
State Changed
From-To: open->feedback

This does not run here: 

Uncaught exception: System.EntryPointNotFoundException: Entry point was not found 
at Xsharp.Font.CreateFont(String, Int32, FontStyle) 
at Xsharp.Font.CreateFont(String) 
at Xsharp.Font.CreateFromXLFD(String) 
at Xsharp.Application..ctor(String, String[]) 
at System.Drawing.Toolkit.DrawingToolkit..ctor() 
at System.Reflection.ClrConstructor.Invoke(BindingFlags, Binder, Object[], CultureInfo) 
at System.Reflection.ConstructorInfo.Invoke(Object[]) 
at System.Drawing.Toolkit.ToolkitManager.CreateDefaultToolkit() 
at System.Drawing.Toolkit.ToolkitManager.get_Toolkit() 
at System.Windows.Forms.Form.ClientToBounds(Size) 
at System.Windows.Forms.Control.SetClientSizeCore(Int32, Int32) 
at System.Windows.Forms.Control.set_ClientSize(Size) 
at com.thisiscool.csharp.nim.ui.MessageForm.LayoutControls() 
at com.thisiscool.csharp.nim.ui.MessageForm..ctor() 
at com.thisiscool.csharp.nim.ui.NimForm..ctor() 
at com.thisiscool.csharp.nim.ui.NimForm.Main() 

What did I wrong? 


Comment 3 Pav Lucistnik freebsd_committer freebsd_triage 2004-03-25 20:24:03 UTC
Responsible Changed
From-To: freebsd-ports-bugs->pav

Handle
Comment 4 Michael Johnson 2004-03-26 10:42:19 UTC
Makefile
-XPLIST_FILES=   bin/nim \
-               bin/nim.exe

once pr-64750 is committed
Comment 5 Pav Lucistnik freebsd_committer freebsd_triage 2004-04-20 23:08:53 UTC
State Changed
From-To: feedback->closed

Feedback timeout. If you happen to make this work 
in future, please submit a new PR.
Comment 6 dave 2009-07-13 18:13:14 UTC
Hello,

I am facing the same problem for running Nim.
Can you please let me know where to save following details:
========
Makefile
-XPLIST_FILES= bin/nim \
- bin/nim.exe
========
Thank you.

Regards,
Dave