aboutsummaryrefslogtreecommitdiff
path: root/emulators
diff options
context:
space:
mode:
authorKirill Ponomarev <krion@FreeBSD.org>2004-02-02 15:48:45 +0000
committerKirill Ponomarev <krion@FreeBSD.org>2004-02-02 15:48:45 +0000
commit245be80d7660ae21a4fc975750067ae1cc2334f8 (patch)
tree7f125a81ffc6b69c5adc4b4c0f41750c73ddc922 /emulators
parent31868e48659385b7a468058336d8d1ad6ab97ffe (diff)
downloadports-245be80d7660ae21a4fc975750067ae1cc2334f8.tar.gz
ports-245be80d7660ae21a4fc975750067ae1cc2334f8.zip
- Fix build on non-i386 arch
- Add option to support Gtk/SVGAlib GUI - Support NOPORTDOCS - Fix WWW: line PR: ports/62262 Submitted by: Ports Fury
Notes
Notes: svn path=/head/; revision=99819
Diffstat (limited to 'emulators')
-rw-r--r--emulators/darcnes/Makefile42
-rw-r--r--emulators/darcnes/files/endian.h41
-rw-r--r--emulators/darcnes/files/patch-ab73
-rw-r--r--emulators/darcnes/files/patch-cd_unix.c31
-rw-r--r--emulators/darcnes/files/patch-mtypes.h7
-rw-r--r--emulators/darcnes/files/patch-tool.c10
-rw-r--r--emulators/darcnes/files/patch-types.h11
-rw-r--r--emulators/darcnes/files/patch-ui_gtk.c10
-rw-r--r--emulators/darcnes/files/patch-ui_x.c15
-rw-r--r--emulators/darcnes/pkg-descr2
-rw-r--r--emulators/darcnes/pkg-plist2
11 files changed, 210 insertions, 34 deletions
diff --git a/emulators/darcnes/Makefile b/emulators/darcnes/Makefile
index a273a740f561..7b61e26ef029 100644
--- a/emulators/darcnes/Makefile
+++ b/emulators/darcnes/Makefile
@@ -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 @@ EXTRACT_SUFX= .tgz
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 --git a/emulators/darcnes/files/endian.h b/emulators/darcnes/files/endian.h
new file mode 100644
index 000000000000..82ecb50205f8
--- /dev/null
+++ b/emulators/darcnes/files/endian.h
@@ -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 --git a/emulators/darcnes/files/patch-ab b/emulators/darcnes/files/patch-ab
index 82029382ca30..69bbc0bfc021 100644
--- a/emulators/darcnes/files/patch-ab
+++ b/emulators/darcnes/files/patch-ab
@@ -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 @@
+ BASE_LDFLAGS=
+
+@@ -33,8 +33,12 @@
#
- # fixup command variables
+ 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
+
+@@ -43,9 +47,10 @@
#
--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)
-
- ifndef CROSS_COMPILING
- TARGET_CC=$(LOCAL_CC)
+ 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 --git a/emulators/darcnes/files/patch-cd_unix.c b/emulators/darcnes/files/patch-cd_unix.c
new file mode 100644
index 000000000000..ced852c1b10c
--- /dev/null
+++ b/emulators/darcnes/files/patch-cd_unix.c
@@ -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 --git a/emulators/darcnes/files/patch-mtypes.h b/emulators/darcnes/files/patch-mtypes.h
new file mode 100644
index 000000000000..30dc8dfe346c
--- /dev/null
+++ b/emulators/darcnes/files/patch-mtypes.h
@@ -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 --git a/emulators/darcnes/files/patch-tool.c b/emulators/darcnes/files/patch-tool.c
new file mode 100644
index 000000000000..b4d59628fef4
--- /dev/null
+++ b/emulators/darcnes/files/patch-tool.c
@@ -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 --git a/emulators/darcnes/files/patch-types.h b/emulators/darcnes/files/patch-types.h
new file mode 100644
index 000000000000..77564830253e
--- /dev/null
+++ b/emulators/darcnes/files/patch-types.h
@@ -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 --git a/emulators/darcnes/files/patch-ui_gtk.c b/emulators/darcnes/files/patch-ui_gtk.c
new file mode 100644
index 000000000000..44de790f1058
--- /dev/null
+++ b/emulators/darcnes/files/patch-ui_gtk.c
@@ -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 --git a/emulators/darcnes/files/patch-ui_x.c b/emulators/darcnes/files/patch-ui_x.c
new file mode 100644
index 000000000000..0ec269aadeec
--- /dev/null
+++ b/emulators/darcnes/files/patch-ui_x.c
@@ -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 --git a/emulators/darcnes/pkg-descr b/emulators/darcnes/pkg-descr
index 262d4235f0a0..662531ec5df4 100644
--- a/emulators/darcnes/pkg-descr
+++ b/emulators/darcnes/pkg-descr
@@ -1,3 +1,3 @@
multi-system emulator
-WWW: http://www.netway.com/~nyef/
+WWW: http://www.dridus.com/~nyef/darcnes/
diff --git a/emulators/darcnes/pkg-plist b/emulators/darcnes/pkg-plist
index d4a70dd068de..0ce80209e63a 100644
--- a/emulators/darcnes/pkg-plist
+++ b/emulators/darcnes/pkg-plist
@@ -1 +1,3 @@
bin/darcnes
+%%PORTDOCS%%%%DOCSDIR%%/readme
+%%PORTDOCS%%@dirrm %%DOCSDIR%%