Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Feb 2004 23:50:25 +0900
From:      KATO Tsuguru <tkato@prontomail.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/62262: Update port: emulators/darcnes
Message-ID:  <20040202235025.4e23695d.tkato@prontomail.com>
Resent-Message-ID: <200402021500.i12F0bUq071958@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         62262
>Category:       ports
>Synopsis:       Update port: emulators/darcnes
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 02 07:00:36 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     KATO Tsuguru
>Release:        FreeBSD 4.9-RELEASE-p1 i386
>Organization:
>Environment:
>Description:
- Fix build on non-i386 arch
- Add option to support Gtk/SVGAlib GUI
- Support NOPORTDOCS
- Fix WWW: line

New file:
files/endian.h
files/patch-cd_unix.c
files/patch-mtypes.h
files/patch-tool.c
files/patch-types.h
files/patch-ui_gtk.c
files/patch-ui_x.c

>How-To-Repeat:
>Fix:

diff -urN /usr/ports/emulators/darcnes/Makefile emulators/darcnes/Makefile
--- /usr/ports/emulators/darcnes/Makefile	Mon Nov  3 14:23:59 2003
+++ emulators/darcnes/Makefile	Mon Feb  2 20:30:09 2004
@@ -7,6 +7,7 @@
 
 PORTNAME=	darcnes
 PORTVERSION=	9b0401
+PORTREVISION=	1
 CATEGORIES=	emulators
 MASTER_SITES=	http://www.dridus.com/~nyef/darcnes/download/
 DISTNAME=	dn${PORTVERSION}
@@ -15,14 +16,45 @@
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	multi-system emulator
 
-WRKSRC=		${WRKDIR}/${PORTNAME}
-
 NO_CDROM=	Commercial use is restricted
 
-USE_X_PREFIX=	yes
+WRKSRC=		${WRKDIR}/${PORTNAME}
+
+WANT_GNOME=	yes
 USE_GMAKE=	yes
+MAKE_ARGS=	CC="${CC}" TARGET_CC="${CC}" CXX="${CXX}" TARGET_CXX="${CXX}" \
+		AS="${AS}" TARGET_AS="${CC}" LD="${LD}" TARGET_LD="${CC}"
+
+.include <bsd.port.pre.mk>
+
+.if ${ARCH} != "i386" || defined(WITHOUT_X86_ASM)
+MAKE_ARGS+=	C_ONLY=-DC_ONLY
+.else
+MAKE_ARGS+=	MACH_TYPES=-DMACH_TYPES=\\\"types-i386.h\\\"
+.endif
+
+.if ${HAVE_GNOME:Mgtk12}!=""
+USE_GNOME=	gtk12
+MAKE_ARGS+=	TARGET=Linux_GTK
+PKGNAMESUFFIX=	-gtk
+.else
+.if defined(WITH_SVGALIB)
+LIB_DEPENDS+=	vga:${PORTSDIR}/graphics/svgalib
+MAKE_ARGS+=	TARGET=Linux_svgalib
+PKGNAMESUFFIX=	-svgalib
+.else
+USE_XLIB=	yes
+.endif
+.endif
+
+post-patch:
+	@${CP} ${FILESDIR}/endian.h ${WRKSRC}
 
 do-install:
-		${INSTALL_PROGRAM} ${WRKSRC}/darcnes ${PREFIX}/bin
+	${INSTALL_PROGRAM} ${WRKSRC}/darcnes ${PREFIX}/bin
+.if !defined(NOPORTDOCS)
+	@${MKDIR} ${DOCSDIR}
+	${INSTALL_DATA} ${WRKSRC}/readme ${DOCSDIR}
+.endif
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff -urN /usr/ports/emulators/darcnes/files/endian.h emulators/darcnes/files/endian.h
--- /usr/ports/emulators/darcnes/files/endian.h	Thu Jan  1 09:00:00 1970
+++ emulators/darcnes/files/endian.h	Mon Feb  2 19:33:31 2004
@@ -0,0 +1,41 @@
+#ifndef __HAD_MY_ENDIAN_H
+#define __HAD_MY_ENDIAN_H
+
+#include <sys/param.h>
+
+#if (defined(BSD) && (BSD >= 199306))
+/* this should filter out NetBSD, FreeBSD and OpenBSD */
+#include <machine/endian.h>
+
+#if BYTE_ORDER == BIG_ENDIAN
+#define MSB_FIRST 1
+#undef LSB_FIRST
+#else
+#define LSB_FIRST 1
+#undef MSB_FIRST
+#endif
+
+#else
+/* for Linux, perhaps use #ifdef __linux__? */
+#include <sys/types.h>
+
+#if defined(__BYTE_ORDER)
+#if __BYTE_ORDER == __BIG_ENDIAN
+#define MSB_FIRST 1
+#undef LSB_FIRST
+#else
+#define LSB_FIRST 1
+#undef MSB_FIRST
+#endif /* __BYTE_ORDER == __BIG_ENDIAN */
+
+#else /* defined(__BYTE_ORDER) */
+
+/* not Linux, either, just set it to LSB */
+#define LSB_FIRST 1
+#undef MSB_FIRST
+
+#endif /* defined(__BYTE_ORDER) */
+
+#endif /* defined(BSD) && (BSD >= 199306) */
+
+#endif /* __HAD_MY_ENDIAN_H */
diff -urN /usr/ports/emulators/darcnes/files/patch-ab emulators/darcnes/files/patch-ab
--- /usr/ports/emulators/darcnes/files/patch-ab	Thu Oct 24 12:19:35 2002
+++ emulators/darcnes/files/patch-ab	Mon Feb  2 20:30:38 2004
@@ -1,35 +1,52 @@
---- Makefile.orig	Tue Mar 27 16:51:41 2001
-+++ Makefile	Wed Oct 23 20:19:27 2002
-@@ -18,7 +18,7 @@
+--- Makefile.orig	Wed Mar 28 09:51:41 2001
++++ Makefile	Mon Feb  2 20:30:32 2004
+@@ -11,16 +11,16 @@
  
- DEBUG=-g
+ #C_ONLY=-DC_ONLY
+ 
+-MACH_TYPES=-DMACH_TYPES=\"types-i386.h\"
++#MACH_TYPES=-DMACH_TYPES=\"types-i386.h\"
+ 
+ #BYTE_ORDER=-DMSB_FIRST
+-BYTE_ORDER=-DLSB_FIRST
++#BYTE_ORDER=-DLSB_FIRST
+ 
+-DEBUG=-g
++#DEBUG=-g
  
 -OPTFLAGS=-O2 -fomit-frame-pointer
-+OPTFLAGS=
++#OPTFLAGS=-O2 -fomit-frame-pointer
  
- BASE_CFLAGS=-Wall $(DEBUG) $(OPTFLAGS) $(C_ONLY) $(BYTE_ORDER) $(MACH_TYPES)
+-BASE_CFLAGS=-Wall $(DEBUG) $(OPTFLAGS) $(C_ONLY) $(BYTE_ORDER) $(MACH_TYPES)
++BASE_CFLAGS=-Wall $(DEBUG) $(OPTFLAGS) $(C_ONLY) $(MACH_TYPES)
  BASE_SFLAGS=-Wall $(DEBUG) $(OPTFLAGS)
-@@ -85,15 +85,14 @@
- #
- # fixup command variables
+ BASE_LDFLAGS=
+ 
+@@ -33,8 +33,12 @@
  #
--LOCAL_CC?=gcc
--LOCAL_CXX?=g++
--LOCAL_AS?=gcc
--LOCAL_LD?=gcc
--
--CC=$(LOCAL_CC)
--CXX=$(LOCAL_CC)
--AS=$(LOCAL_AS)
--LD=$(LOCAL_LD)
-+CC?=cc
-+LOCAL_CC=$(CC)
-+CXX?=c++
-+LOCAL_CXX=$(CXX)
-+AS=$(CC)
-+LOCAL_AS=$(AS)
-+LD=$(CC)
-+LOCAL_LD=$(LD)
+ ifeq ($(TARGET),Linux_svgalib)
+ CONFFLAGS=-DPCE_CD_SUPPORT -DSOUND
++LOCALBASE?=/usr/local
++LDFLAGS+=-L${LOCALBASE}/lib
++CFLAGS+=-I${LOCALBASE}/include
++SFLAGS+=-I${LOCALBASE}/include
+ SYSTEMSRCS=video_svga.c ui_svga.c snd_unix.c cd_unix.c
+-BINFILE=sdarcnes
++BINFILE=darcnes
+ LIBS=-lvgagl -lvga
+ endif
  
- ifndef CROSS_COMPILING
- TARGET_CC=$(LOCAL_CC)
+@@ -43,9 +47,10 @@
+ #
+ ifeq ($(TARGET),Linux_X)
+ CONFFLAGS=-DPCE_CD_SUPPORT -DSOUND
+-LDFLAGS+=-L/usr/X11R6/lib
+-CFLAGS+=-I/usr/X11R6/include
+-SFLAGS+=-I/usr/X11R6/include
++X11BASE?=/usr/X11R6
++LDFLAGS+=-L${X11BASE}/lib
++CFLAGS+=-I${X11BASE}/include
++SFLAGS+=-I${X11BASE}/include
+ SYSTEMSRCS=video_x.c ui_x.c snd_unix.c keyboard_x.c cd_unix.c
+ BINFILE=darcnes
+ LIBS=-lXext -lXaw -lXmu -lXt -lX11
diff -urN /usr/ports/emulators/darcnes/files/patch-cd_unix.c emulators/darcnes/files/patch-cd_unix.c
--- /usr/ports/emulators/darcnes/files/patch-cd_unix.c	Thu Jan  1 09:00:00 1970
+++ emulators/darcnes/files/patch-cd_unix.c	Mon Feb  2 19:33:02 2004
@@ -0,0 +1,31 @@
+--- cd_unix.c.orig	Sun Aug 20 03:25:53 2000
++++ cd_unix.c
+@@ -62,7 +62,6 @@
+ 
+ void cd_play_track(u8 track)
+ {
+-#ifdef SYSTEM_FREEBSD
+     struct ioc_play_track playtrack;
+ 
+     /* FIXME: CD keeps playing after program quits */
+@@ -74,12 +73,10 @@
+     playtrack.end_index = 1;
+ 
+     ioctl(cd_drive, CDIOCPLAYTRACKS, &playtrack);
+-#endif
+ }
+ 
+ void cd_play_lba(u32 from, u32 to, int repeat)
+ {
+-#ifdef SYSTEM_FREEBSD
+     struct ioc_play_blocks playblocks;
+ 
+     /* FIXME: ignores the repeat flag */
+@@ -94,7 +91,6 @@
+     playblocks.len = to - from;
+ 
+     ioctl(cd_drive, CDIOCPLAYBLOCKS, &playblocks);
+-#endif
+ }
+ 
+ #ifdef SYSTEM_LINUX
diff -urN /usr/ports/emulators/darcnes/files/patch-mtypes.h emulators/darcnes/files/patch-mtypes.h
--- /usr/ports/emulators/darcnes/files/patch-mtypes.h	Thu Jan  1 09:00:00 1970
+++ emulators/darcnes/files/patch-mtypes.h	Mon Feb  2 19:33:48 2004
@@ -0,0 +1,7 @@
+--- mtypes.h.orig	Sat Aug  7 18:19:37 1999
++++ mtypes.h	Thu Jun  1 02:43:05 2000
+@@ -11,2 +11,4 @@
+ 
++#include "endian.h"
++
+ typedef unsigned char byte;
diff -urN /usr/ports/emulators/darcnes/files/patch-tool.c emulators/darcnes/files/patch-tool.c
--- /usr/ports/emulators/darcnes/files/patch-tool.c	Thu Jan  1 09:00:00 1970
+++ emulators/darcnes/files/patch-tool.c	Mon Feb  2 19:33:56 2004
@@ -0,0 +1,10 @@
+--- tool.c.orig	Sat May  6 23:50:17 2000
++++ tool.c	Thu Jun  1 02:43:09 2000
+@@ -19,6 +19,7 @@
+ #include "video.h"
+ #include "tool.h"
+ #include "system.h"
++#include "endian.h"
+ 
+ unsigned long system_flags;
+ 
diff -urN /usr/ports/emulators/darcnes/files/patch-types.h emulators/darcnes/files/patch-types.h
--- /usr/ports/emulators/darcnes/files/patch-types.h	Thu Jan  1 09:00:00 1970
+++ emulators/darcnes/files/patch-types.h	Mon Feb  2 19:34:18 2004
@@ -0,0 +1,11 @@
+--- types.h.orig	Tue Dec  7 03:01:23 1999
++++ types.h	Thu Jun  1 02:43:11 2000
+@@ -13,6 +13,8 @@
+ #include MACH_TYPES
+ #endif
+ 
++#include "endian.h"
++
+ typedef unsigned char u8;
+ typedef signed char s8;
+ 
diff -urN /usr/ports/emulators/darcnes/files/patch-ui_gtk.c emulators/darcnes/files/patch-ui_gtk.c
--- /usr/ports/emulators/darcnes/files/patch-ui_gtk.c	Thu Jan  1 09:00:00 1970
+++ emulators/darcnes/files/patch-ui_gtk.c	Mon Feb  2 20:13:08 2004
@@ -0,0 +1,10 @@
+--- ui_gtk.c.orig	Tue Aug 22 11:06:48 2000
++++ ui_gtk.c	Mon Feb  2 20:12:54 2004
+@@ -63,6 +63,7 @@
+   video_buffer_1 = video_buffer_2 = NULL;
+ 
+   /* Get Gtk up and running. */
++  gtk_set_locale();
+   gtk_init( &argc, &argv );
+ 
+   nes_gtk_window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
diff -urN /usr/ports/emulators/darcnes/files/patch-ui_x.c emulators/darcnes/files/patch-ui_x.c
--- /usr/ports/emulators/darcnes/files/patch-ui_x.c	Thu Jan  1 09:00:00 1970
+++ emulators/darcnes/files/patch-ui_x.c	Mon Feb  2 19:34:06 2004
@@ -0,0 +1,15 @@
+--- ui_x.c.orig	Mon Oct 30 23:15:31 2000
++++ ui_x.c
+@@ -177,6 +177,12 @@ int main(int argc, char *argv[])
+ 	return 1;
+     }
+ 
++    if (romfile == NULL) {
++	printf("rom not specified.\n");
++	usage(argv[0]);
++	return 1;
++    }
++
+     initialize_window(display);
+ 
+     activate_system(system_type, romfile);
diff -urN /usr/ports/emulators/darcnes/pkg-descr emulators/darcnes/pkg-descr
--- /usr/ports/emulators/darcnes/pkg-descr	Sun Apr 22 11:35:53 2001
+++ emulators/darcnes/pkg-descr	Mon Feb  2 18:47:36 2004
@@ -1,3 +1,3 @@
 multi-system emulator
 
-WWW: http://www.netway.com/~nyef/
+WWW: http://www.dridus.com/~nyef/darcnes/
diff -urN /usr/ports/emulators/darcnes/pkg-plist emulators/darcnes/pkg-plist
--- /usr/ports/emulators/darcnes/pkg-plist	Sun Apr 22 11:35:53 2001
+++ emulators/darcnes/pkg-plist	Mon Feb  2 20:27:12 2004
@@ -1 +1,3 @@
 bin/darcnes
+%%PORTDOCS%%%%DOCSDIR%%/readme
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040202235025.4e23695d.tkato>