diff --git a/emulators/xmame/Makefile b/emulators/xmame/Makefile index f4c6d0122130..bf6651695065 100644 --- a/emulators/xmame/Makefile +++ b/emulators/xmame/Makefile @@ -6,7 +6,7 @@ # PORTNAME?= xmame -PORTVERSION?= 0.58.1 +PORTVERSION?= 0.58.3 CATEGORIES= emulators MASTER_SITES= http://x.mame.net/download/ \ http://www.mame.net/zips/ \ @@ -24,11 +24,6 @@ MAN6= x${MAMEMESS}.6 XMAMEVERSION?= ${PORTVERSION} -.if !defined(WITH_SVGALIB) || ${WITH_SVGALIB} != "yes" -USE_XPM= yes -USE_X_PREFIX= yes -.endif - # Are we building MAME, MESS or PinMAME? (also set by slave ports) MAMEMESS?= mame @@ -103,9 +98,20 @@ ALLDOCS= ${GENERALDOCS} ${PINMAMEDOCS} .endif .endif -# Datfiles - for history/bugs/cheats/highscores in MAME +PKGOPTS= ${FILESDIR}/pkg-opts + +# +# Various options are processed here. Note that due to a bug in make(1), at +# present the conditionals are suboptimal. See PR bin/34032. +# + +# Option WITH_DATFILES .if ${MAMEMESS} == "mame" -.if defined(WITH_DATFILES) && ${WITH_DATFILES} == "yes" +.if !defined(WITH_DATFILES) +WITH_DATFILES= yes +.endif + +.if ${WITH_DATFILES:L} != "no" PLIST_SUB+= DATFILES="" BUILD_DEPENDS= unzip:${PORTSDIR}/archivers/unzip @@ -125,52 +131,35 @@ post-extract: unzip -q ${DISTDIR}/${DIST_SUBDIR}/cheat.zip cheat.dat .else PLIST_SUB+= DATFILES="@comment " -.if !defined(WITH_DATFILES) -pre-everything:: - @${ECHO_MSG} "===> If you want to install additional information with MAME (such as game" - @${ECHO_MSG} " history, cheats, and highscores) use \"make WITH_DATFILES=yes\"" -.endif .endif .endif -# ASM 68k cores - disabled by default, because they break things (pbobble2 -# being a prime example). These also only work on i386. Should be enabled -# by default when ready for prime time. -.if defined(WITH_ASM68K) && ${WITH_ASM68K} == "yes" +# Option WITH_ASM68K +.if !defined(WITH_ASM68K) +WITH_ASM68K= no +.endif + +.if ${WITH_ASM68K:L} == "yes" ASM_COMMENT= .else ASM_COMMENT=\# .endif -# Heavy optimization - disabled by default because it breaks things. It's -# still available because it enables considerable speedup. -.if defined(WITH_OPTIMIZATION) && ${WITH_OPTIMIZATION} == "yes" +# Option WITH_OPTIMIZATION +.if defined(WITH_OPTIMIZATION) +.if ${WITH_OPTIMIZATION:L} == "yes" CFLAGS+= -O3 -Wall -Wno-unused -funroll-loops \ -fstrength-reduce -fomit-frame-pointer -ffast-math \ -malign-functions=4 -malign-jumps=4 -malign-loops=4 -.else -.if !defined(WITH_OPTIMIZATION) -pre-everything:: - @${ECHO_MSG} "===> If you want to enable high optimization levels, use " - @${ECHO_MSG} " \"make WITH_OPTIMIZATION=yes\". Be warned that this is known to" - @${ECHO_MSG} " break some games though." .endif .endif -# Choose one of several display targets: -# WITH_GL OpenGL based, displays vector games with hardware -# acceleration -# WITH_SDL Uses the SDL library to be able to play fullscreen -# without root rights -# WITH_SVGALIB Uses the svgalib library to allow playing without X. This -# has not been extensively tested; patches welcome to make -# this actually work. -# WITH_X11 The standard display target, should work without -# dependancies other than X -# -# WITH_SDL is enabled by default because x{mame,mess} can run full -# screen without having to be setuid root. -.if defined(WITH_GL) && ${WITH_GL} == "yes" +# Option DISPLAY_TARGET +.if !defined(DISPLAY_TARGET) +DISPLAY_TARGET=sdl +.endif + +.if ${DISPLAY_TARGET:L} == "opengl" CFLAGS+= ${PTHREAD_CFLAGS} USE_MESA= yes DISPLAY_METHOD= xgl @@ -178,32 +167,65 @@ PLIST_SUB+= OPENGL="" ALL_DOCS+= ${GLDOCS} .else PLIST_SUB+= OPENGL="@comment " -.if defined(WITH_SVGALIB) && ${WITH_SVGALIB} == "yes" + +.if ${DISPLAY_TARGET:L} == "svgalib" LIB_DEPENDS= vga.1:${PORTSDIR}/graphics/svgalib CFLAGS+= -I${LOCALBASE}/include MAKE_ENV+= LOCALBASE=${LOCALBASE} DISPLAY_METHOD= svgalib .else -.if !defined(WITH_SDL) || ${WITH_SDL} != "no" + +.if ${DISPLAY_TARGET:L} == "x11" +DISPLAY_METHOD= x11 +.else + +.if ${DISPLAY_TARGET:L} != "sdl" +pre-everything:: + @${ECHO_MSG} "You must select a valid DISPLAY_TARGET. Refer to" + @${ECHO_MSG} "'make options' for more information." + @exit 1 +.endif LIB_DEPENDS= SDL-1.1.3:${PORTSDIR}/devel/sdl12 SDL_CONFIG?= ${LOCALBASE}/bin/sdl11-config MAKE_ENV+= SDL_CONFIG=${SDL_CONFIG} DISPLAY_METHOD= SDL -.if !defined(WITH_SDL) -pre-everything:: - @${ECHO_MSG} "===> If you don't want ${MAMEMESS:U} to be built with SDL support," - @${ECHO_MSG} " use \"make WITH_SDL=no\"" - @${ECHO_MSG} "===> If you want to build ${MAMEMESS:U} with OpenGL support for vector games," - @${ECHO_MSG} " use \"make WITH_GL=yes\"" -.endif -.else -DISPLAY_METHOD= x11 .endif .endif .endif + +.if ${DISPLAY_TARGET:L} != "svgalib" +USE_XPM= yes +USE_X_PREFIX= yes +.endif + PKGNAMESUFFIX=-${DISPLAY_METHOD:L} -# USB joysticks - only enabled on -STABLE because of conflicting USB +# Option WITH_ESOUND +.if !defined(WITH_ESOUND) +WITH_ESOUND= no +.endif + +.if ${WITH_ESOUND:L} == "yes" +ESOUNDCOMMENT= +USE_ESOUND= yes +.else +ESOUNDCOMMENT=\#\ +.endif + +# Option WITH_NETWORK +.if ${MAMEMESS} == "mame" +.if !defined(WITH_NETWORK) +WITH_NETWORK= yes +.endif + +.if ${WITH_NETWORK:L} != "no" +NETWORK= +.else +NETWORK=\#\ +.endif +.endif + +# USB joysticks are only enabled on -STABLE because of conflicting USB # prototypes in -STABLE & -CURRENT. .include @@ -213,34 +235,22 @@ JOYUSBCOMMENT=\#\ JOYUSBCOMMENT= .endif -# Esound audio - handy for a GNOME environment -.if defined(WITH_ESOUND) && ${WITH_ESOUND} == "yes" -ESOUNDCOMMENT= -USE_ESOUND= yes -.else -ESOUNDCOMMENT=\#\ -.if !defined(WITH_ESOUND) -pre-everything:: - @echo "===> If you want to build ${MAMEMESS:U} with support for ESound," - @echo " use \"make WITH_ESOUND=yes\"" -.endif -.endif +# +# Regular targets +# + +options: + @(${ECHO_MSG} "===> Build options for ${PKGNAME}:"; \ + ${PERL} -ne '/^#/ || /^\s/ && print || \ + print sprintf "* %s [%s]\n %s", split(/\|/)' ${PKGOPTS}) | \ + $${PAGER:-/usr/bin/more} -.if ${MAMEMESS} == "mame" -# Network support - enabled by default because the penalty is low. There might -# be a speedup without it though, so I've made it (yet another) option. -.if !defined(WITH_NETWORK) || ${WITH_NETWORK} != "no" -NETWORK= -.else -NETWORK=\#\ -.endif -.if !defined(WITH_NETWORK) pre-everything:: - @echo "===> If you want to build ${MAMEMESS:U} without network support," - @echo " use \"make WITH_NETWORK=no\"" -.endif -.else -NETWORK=\#\ +.if !defined(BATCH) + @${TEST} -r ${PKGOPTS} && \ + (${ECHO_MSG} '-------------------------------------------------------------------------'; \ + ${ECHO_MSG} 'Perform a "make options" to see a list of available installation options.'; \ + ${ECHO_MSG} '-------------------------------------------------------------------------';) .endif # Some simple patches that don't warrant a separate patch diff --git a/emulators/xmame/distinfo b/emulators/xmame/distinfo index 5ae57fe2b1f4..9e6a736eb830 100644 --- a/emulators/xmame/distinfo +++ b/emulators/xmame/distinfo @@ -1,4 +1,4 @@ -MD5 (xmame/xmame-0.58.1.tar.bz2) = d85e54b760ec796d11a0b04e782bd69f +MD5 (xmame/xmame-0.58.3.tar.bz2) = 9cda8e3289dee78872fe75c113d6b427 MD5 (xmame/xmame-0.56.2.tar.bz2) = e43dd5e087f954351948fb9848485924 MD5 (xmame/xmame-0.37b14.2.tar.bz2) = 34bfba3d1412a8f8e1abd4d738de3f27 MD5 (xmame/cheat.zip) = b745ea4df1a3a517c00fedae1ee49a14 diff --git a/emulators/xmame/files/patch-ac b/emulators/xmame/files/patch-ac index f93a6f1b2eed..ca37cc743b69 100644 --- a/emulators/xmame/files/patch-ac +++ b/emulators/xmame/files/patch-ac @@ -1,9 +1,9 @@ ---- src/unix/unix.mak.orig Thu Nov 15 07:15:47 2001 -+++ src/unix/unix.mak Thu Nov 22 11:11:35 2001 -@@ -45,20 +45,20 @@ +--- src/unix/unix.mak.orig Mon Mar 18 02:41:37 2002 ++++ src/unix/unix.mak Tue Mar 19 18:05:20 2002 +@@ -50,20 +50,20 @@ # svga and ggi also use $(X11LIB) since that's where zlib often is - LIBS.x11 = $(X11LIB) $(JOY_X11_LIBS) -lX11 -lXext + LIBS.x11 = $(X11LIB) $(JOY_X11_LIBS) $(XINPUT_DEVICES_LIBS) -lX11 -lXext -LIBS.svgalib = $(X11LIB) -lvga -lvgagl +LIBS.svgalib = -L$(LOCALBASE)/lib -lvga -lvgagl LIBS.ggi = $(X11LIB) -lggi @@ -16,17 +16,17 @@ +LIBS.SDL = `$(SDL_CONFIG) --libs` LIBS.photon2 = -L/usr/lib -lph -lphrender - CFLAGS.x11 = $(X11INC) $(JOY_X11_CFLAGS) + CFLAGS.x11 = $(X11INC) $(JOY_X11_CFLAGS) $(XINPUT_DEVICES_CFLAGS) -CFLAGS.xgl = $(X11INC) $(JOY_X11_CFLAGS) $(GLCFLAGS) +CFLAGS.xgl = -DGLU_VERSION_1_2 $(X11INC) $(JOY_X11_CFLAGS) $(GLCFLAGS) -I$(LOCALBASE)/include $(PTHREAD_CFLAGS) CFLAGS.xfx = $(X11INC) $(JOY_X11_CFLAGS) -I/usr/include/glide CFLAGS.svgafx = -I/usr/include/glide -CFLAGS.SDL = -D_REENTRANT -+CFLAGS.SDL = `$(SDL_CONFIG) --cflags` ++CFLAGS.SDL = $(X11INC) `$(SDL_CONFIG) --cflags` CFLAGS.photon2 = INST.x11 = doinstall -@@ -340,7 +340,7 @@ +@@ -357,7 +357,7 @@ doc/x$(TARGET)rc.dist: all src/unix/xmamerc-keybinding-notes.txt ./x$(TARGET).$(DISPLAY_METHOD) -noloadconfig -showconfig | \ @@ -35,7 +35,7 @@ cat src/unix/xmamerc-keybinding-notes.txt >> doc/x$(TARGET)rc.dist doc/gamelist.$(TARGET): all -@@ -349,7 +349,8 @@ +@@ -366,7 +366,8 @@ doc/x$(TARGET).6: all src/unix/xmame.6-1 src/unix/xmame.6-3 cat src/unix/xmame.6-1 > doc/x$(TARGET).6 diff --git a/emulators/xmame/files/patch-ak b/emulators/xmame/files/patch-ak deleted file mode 100644 index 3292ccef5446..000000000000 --- a/emulators/xmame/files/patch-ak +++ /dev/null @@ -1,10 +0,0 @@ ---- src/unix/network.c.orig Wed Feb 6 04:33:30 2002 -+++ src/unix/network.c Thu Feb 7 15:14:28 2002 -@@ -361,6 +361,7 @@ - master_hostent->h_addr, - master_hostent->h_length); - _master_info.addr.sin_port = htons(MASTER_INPUT_PORT); -+ _master_info.addr.sin_family = AF_INET; - - gethostname(scratch, MAX_MSG_LEN); - diff --git a/emulators/xmame/files/pkg-opts b/emulators/xmame/files/pkg-opts new file mode 100644 index 000000000000..afdaa7f401be --- /dev/null +++ b/emulators/xmame/files/pkg-opts @@ -0,0 +1,30 @@ +# Variable|Default value|Short description +# Multi-line/long description (optional). +# Multi-line/long description lines must start with whitespace! +# +DISPLAY_TARGET|sdl|Set this to one of the following: + sdl Uses the SDL library to be able to play fullscreen + games without having to have root rights. + opengl Uses OpenGL libraries for hardware accelerrated screen + scaling. + x11 Use the standard X11 libraries. Need to be root to + play fullscreen games. + svgalib Uses the svgalib library for console play. This + target is not working yet; patches to make it work + most warmly welcomed. +WITH_ASM68K|no|If set to 'yes', this will enable the speedier but buggy + assembler 68x00 CPU emulation cores. This will only work on x86. + Note that some games are known to break with this option, among + them pbobble2. +WITH_OPTIMIZATION|no|If set to 'yes', this will enable maximum C compiler + optimization. Due to the fact that these optimization levels + sometimes uncover hidden GCC bugs, this is disabled by default. + Enable at your own risk. +WITH_ESOUND|no|If set to 'yes', compile with the esound libraries for + nice behaviour in a GNOME environment. +WITH_DATFILES|yes|If set to 'yes', this installs additional information + with MAME, including cheats, history of games, and highscores. + This is a MAME-only option. +WITH_NETWORK|yes|If set to 'yes', include support for network play. + This can be disabled because there might be a speed increase + without it.