On Sun, Mar 15, 2009 at 03:56:55PM +0100, Landry Breuil wrote:
> On Sat, Mar 14, 2009 at 11:37:00AM +0100, Pierre Riteau wrote:
> > Update to sdlmess 0.130.
> 
> Comments goes for sdlmame & sdlmess :
> WANTLIB lacks dbus-1 & gio-2.0
> I'd rather see src/osd/sdl/sdlprefix.h patched to add
> || defined(__OpenBSD__) (and forward the diff upstream) instead of lying
> and pretend SDLMAME_FREEBSD is defined. If possible, make upstream
> change this define to a more generic SDLMAME_BSD ... like
> SDLMAME_DARWIN/SDLMAME_WIN32/SDLMAME_LINUX.
> And forward sdl.mak patch too :)

Fixed. I will forward the diffs ASAP.
I also removed testkeys from the installed files, it's not very useful
for the end user (it is used to create keymap files for SDL).
And I fixed the makefile to stop using -O3, as reported by Jacob.

> I didn't really manage to see the difference between sdlmame and
> sdlmess, but as it's two different tarballs (sdlmess is twice bigger),
> yeah that's correct to do two separate ports. But maybe install the
> 'common binaries' both prefixed by where they came as done for mess.

sdlmess uses sdlmame's code, adds modules to emulate home consoles and
computers, and doesn't build mame modules.
It should be possible to build sdlmame from sdlmess source
(just need to change the TARGET in the makefile), but using sdlmame's
tarball makes it easier to test the interim releases (sdlmame-0.XXXuY):
sdlmess is only updated for new stable releases.

I changed the name of the common binaries to use a suffix instead of a
prefix. Makes it easier to find them with autocompletion.

I've also looked at the last 4 releases and the common binaries source
is the same. I will see about multi-packaging them.

> Other than that, looks good so far.. if only it didn't take HOURS to
> build. I suppose you tried gcc3, and it miserably fails...

Yep, it doesn't work. And I remember upstream reporting code generation
bugs on old gcc releases, so they recommend gcc4+.

> Going to import both soon, after you send the fixes i mentioned :)
> If anyone is interested to make it work/tested & enabled on ppc/sparc64,
> see with pierre :)
> 
> Landry

Thank you for the review Landry :)

If anyone want to test on ppc, drop me a mail since you need a small
patch. And making it work on sparc64 is on my todo list.

Attached is a new tarball, plus a diff from the old tarball to help
review.
diff --git a/emulators/sdlmess/Makefile b/emulators/sdlmess/Makefile
index fdc5f61..46e0fea 100644
--- a/emulators/sdlmess/Makefile
+++ b/emulators/sdlmess/Makefile
@@ -21,12 +21,11 @@ PERMIT_PACKAGE_FTP =                Yes
 PERMIT_DISTFILES_CDROM =       may not sell
 PERMIT_DISTFILES_FTP =         Yes
 
-WANTLIB =              X11 Xinerama c m pthread expat z
-WANTLIB +=             Xau Xcomposite Xcursor Xdamage Xdmcp Xext Xfixes Xi
-WANTLIB +=             Xrandr Xrender fontconfig freetype iconv pixman-1
-WANTLIB +=             ORBit-2 atk-1.0 cairo glib-2.0 glitz gmodule-2.0
-WANTLIB +=             gobject-2.0 gthread-2.0 intl pango-1.0 pangocairo-1.0
-WANTLIB +=             pangoft2-1.0 png
+WANTLIB +=     ORBit-2 X11 Xau Xcomposite Xcursor Xdamage Xdmcp Xext
+WANTLIB +=     Xfixes Xi Xinerama Xrandr Xrender atk-1.0 c cairo dbus-1
+WANTLIB +=     expat fontconfig freetype gio-2.0 glib-2.0 glitz gmodule-2.0
+WANTLIB +=     gobject-2.0 gthread-2.0 iconv intl m pango-1.0 pangocairo-1.0
+WANTLIB +=     pangoft2-1.0 pixman-1 png pthread z
 
 MASTER_SITES =         http://rbelmont.mameworld.info/
 EXTRACT_SUFX =         .zip
@@ -43,7 +42,6 @@ USE_X11 =             Yes
 
 NO_REGRESS =           Yes
 
-CFLAGS +=              -DSDLMAME_FREEBSD
 MAKE_ENV =             ARCH=$(ARCH) CC=$(CC) CFLAGS="$(CFLAGS)" LD=$(CC) \
                        TARGETOS=openbsd
 .if ${MACHINE_ARCH} == "amd64"
@@ -52,14 +50,14 @@ MAKE_ENV+=          PTR64=1
 MAKE_FILE =            makefile.sdl
 
 MESS_EXTBIN=           chdman dat2html imgtool jedutil ldresample ldverify \
-                               romcmp testkeys
+                               romcmp
 MESS_DOC=              config.txt credits.htm faq.htm imgtool.txt \
                                license.txt mame.txt messnew.txt newvideo.txt
 
 do-install:
        ${INSTALL_PROGRAM} ${WRKSRC}/mess ${PREFIX}/bin/sdlmess
 .for i in ${MESS_EXTBIN}
-       ${INSTALL_PROGRAM} ${WRKSRC}/${i} ${PREFIX}/bin/mess-${i}
+       ${INSTALL_PROGRAM} ${WRKSRC}/${i} ${PREFIX}/bin/${i}-mess
 .endfor
        ${INSTALL_DATA_DIR} ${PREFIX}/share/sdlmess/keymaps
        ${INSTALL_DATA} ${WRKSRC}/keymaps/km[-_]??.txt \
diff --git a/emulators/sdlmess/patches/patch-makefile_sdl 
b/emulators/sdlmess/patches/patch-makefile_sdl
index 37facdb..bae716c 100644
--- a/emulators/sdlmess/patches/patch-makefile_sdl
+++ b/emulators/sdlmess/patches/patch-makefile_sdl
@@ -1,6 +1,6 @@
 $OpenBSD$
 --- makefile.sdl.orig  Fri Mar 13 17:53:53 2009
-+++ makefile.sdl       Sat Mar 14 10:55:48 2009
++++ makefile.sdl       Sun Mar 15 15:52:01 2009
 @@ -125,10 +125,10 @@ endif
  # BIGENDIAN = 1
  
@@ -46,7 +46,13 @@ $OpenBSD$
  endif
  
  # we compile C-only to C89 standard with GNU extensions
-@@ -336,11 +336,7 @@ CCOMFLAGS += -O$(OPTIMIZE)
+@@ -331,16 +331,12 @@ CCOMFLAGS += -pg
+ endif
+ 
+ # add the optimization flag
+-CCOMFLAGS += -O$(OPTIMIZE)
++#CCOMFLAGS += -O$(OPTIMIZE)
+ 
  # if we are optimizing, include optimization options
  # and make all errors into warnings
  ifneq ($(OPTIMIZE),0)
diff --git a/emulators/sdlmess/patches/patch-src_osd_sdl_sdldir_c 
b/emulators/sdlmess/patches/patch-src_osd_sdl_sdldir_c
new file mode 100644
index 0000000..30fc4f4
--- /dev/null
+++ b/emulators/sdlmess/patches/patch-src_osd_sdl_sdldir_c
@@ -0,0 +1,57 @@
+$OpenBSD$
+--- src/osd/sdl/sdldir.c.orig  Sun Mar 15 15:49:29 2009
++++ src/osd/sdl/sdldir.c       Sun Mar 15 15:50:38 2009
+@@ -13,7 +13,7 @@
+ #ifdef SDLMAME_LINUX
+ #define __USE_LARGEFILE64
+ #endif
+-#ifndef SDLMAME_FREEBSD
++#ifndef SDLMAME_BSD
+ #define _XOPEN_SOURCE 500
+ #endif
+ 
+@@ -43,7 +43,7 @@
+ struct _osd_directory
+ {
+       osd_directory_entry ent;
+-#if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || 
defined(SDLMAME_NO64BITIO) || defined(SDLMAME_FREEBSD) || defined(SDLMAME_OS2)
++#if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || 
defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
+       struct dirent *data;
+ #else
+       struct dirent64 *data;
+@@ -52,7 +52,7 @@ struct _osd_directory
+ };
+ 
+ 
+-#if defined (SDLMAME_LINUX) || defined (SDLMAME_FREEBSD) || 
defined(SDLMAME_DARWIN)
++#if defined (SDLMAME_LINUX) || defined (SDLMAME_BSD) || 
defined(SDLMAME_DARWIN)
+ static osd_dir_entry_type get_attributes_enttype(int attributes)
+ {
+       if (attributes == DT_DIR)
+@@ -85,7 +85,7 @@ static osd_dir_entry_type get_attributes_stat(const ch
+ 
+ static UINT64 osd_get_file_size(const char *file)
+ {
+-#if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || 
defined(SDLMAME_NO64BITIO) || defined(SDLMAME_FREEBSD) || defined(SDLMAME_OS2)
++#if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || 
defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
+       struct stat st;
+       if(stat(file, &st))
+               return 0;
+@@ -171,7 +171,7 @@ osd_directory *osd_opendir(const char *dirname)
+ 
+ const osd_directory_entry *osd_readdir(osd_directory *dir)
+ {
+-      #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || 
defined(SDLMAME_NO64BITIO) || defined(SDLMAME_FREEBSD) || defined(SDLMAME_OS2)
++      #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || 
defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
+       dir->data = readdir(dir->fd);
+       #else
+       dir->data = readdir64(dir->fd);
+@@ -181,7 +181,7 @@ const osd_directory_entry *osd_readdir(osd_directory *
+               return NULL;
+ 
+       dir->ent.name = dir->data->d_name;
+-      #if defined (SDLMAME_LINUX) || defined (SDLMAME_FREEBSD) || 
defined(SDLMAME_DARWIN)
++      #if defined (SDLMAME_LINUX) || defined (SDLMAME_BSD) || 
defined(SDLMAME_DARWIN)
+       dir->ent.type = get_attributes_enttype(dir->data->d_type);
+       #else
+       dir->ent.type = get_attributes_stat(dir->data->d_name);
diff --git a/emulators/sdlmess/patches/patch-src_osd_sdl_sdlfile_c 
b/emulators/sdlmess/patches/patch-src_osd_sdl_sdlfile_c
new file mode 100644
index 0000000..c789a77
--- /dev/null
+++ b/emulators/sdlmess/patches/patch-src_osd_sdl_sdlfile_c
@@ -0,0 +1,82 @@
+$OpenBSD$
+--- src/osd/sdl/sdlfile.c.orig Sun Mar 15 15:49:29 2009
++++ src/osd/sdl/sdlfile.c      Sun Mar 15 15:50:38 2009
+@@ -13,7 +13,7 @@
+ #ifdef SDLMAME_LINUX
+ #define __USE_LARGEFILE64
+ #endif
+-#ifndef SDLMAME_FREEBSD
++#ifndef SDLMAME_BSD
+ #define _XOPEN_SOURCE 500
+ #endif
+ 
+@@ -96,7 +96,7 @@ file_error osd_open(const char *path, UINT32 openflags
+       UINT32 access;
+       const char *src;
+       char *dst;
+-        #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || 
defined(SDLMAME_NO64BITIO) || defined(SDLMAME_FREEBSD) || defined(SDLMAME_OS2)
++        #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || 
defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
+       struct stat st;
+       #else
+       struct stat64 st;
+@@ -180,7 +180,7 @@ file_error osd_open(const char *path, UINT32 openflags
+       #endif
+ 
+       // attempt to open the file
+-        #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || 
defined(SDLMAME_NO64BITIO) || defined(SDLMAME_FREEBSD) || defined(SDLMAME_OS2)
++        #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || 
defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
+       (*file)->handle = open(tmpstr, access, 0666);
+       #else
+       (*file)->handle = open64(tmpstr, access, 0666);
+@@ -203,7 +203,7 @@ file_error osd_open(const char *path, UINT32 openflags
+                               // attempt to reopen the file
+                               if (error == NO_ERROR)
+                               {
+-                                      #if defined(SDLMAME_DARWIN) || 
defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || 
defined(SDLMAME_FREEBSD) || defined(SDLMAME_OS2)
++                                      #if defined(SDLMAME_DARWIN) || 
defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || 
defined(SDLMAME_OS2)
+                                       (*file)->handle = open(tmpstr, access, 
0666);
+                                       #else
+                                       (*file)->handle = open64(tmpstr, 
access, 0666);
+@@ -223,7 +223,7 @@ file_error osd_open(const char *path, UINT32 openflags
+       }
+ 
+       // get the file size
+-        #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || 
defined(SDLMAME_NO64BITIO) || defined(SDLMAME_FREEBSD) || defined(SDLMAME_OS2)
++        #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || 
defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
+       fstat((*file)->handle, &st);
+       #else
+       fstat64((*file)->handle, &st);
+@@ -253,7 +253,7 @@ file_error osd_read(osd_file *file, void *buffer, UINT
+ {
+       ssize_t result;
+ 
+-#if defined(SDLMAME_DARWIN) || defined(SDLMAME_FREEBSD)
++#if defined(SDLMAME_DARWIN) || defined(SDLMAME_BSD)
+       result = pread(file->handle, buffer, count, offset);
+       if (result < 0)
+ #elif defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || 
defined(SDLMAME_OS2)
+@@ -281,7 +281,7 @@ file_error osd_write(osd_file *file, const void *buffe
+ {
+       UINT32 result;
+ 
+-#if defined(SDLMAME_DARWIN) || defined(SDLMAME_FREEBSD)
++#if defined(SDLMAME_DARWIN) || defined(SDLMAME_BSD)
+       result = pwrite(file->handle, buffer, count, offset);
+       if (!result)
+ #elif defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || 
defined(SDLMAME_OS2)
+@@ -465,13 +465,13 @@ osd_directory_entry *osd_stat(const char *path)
+ {
+       int err;
+       osd_directory_entry *result = NULL;
+-      #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || 
defined(SDLMAME_NO64BITIO) || defined(SDLMAME_FREEBSD) || defined(SDLMAME_OS2)
++      #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || 
defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
+       struct stat st;
+       #else
+       struct stat64 st;
+       #endif
+       
+-      #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || 
defined(SDLMAME_NO64BITIO) || defined(SDLMAME_FREEBSD) || defined(SDLMAME_OS2)
++      #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || 
defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
+       err = stat(path, &st);
+       #else
+       err = stat64(path, &st);
diff --git a/emulators/sdlmess/patches/patch-src_osd_sdl_sdlmain_c 
b/emulators/sdlmess/patches/patch-src_osd_sdl_sdlmain_c
new file mode 100644
index 0000000..aa3233e
--- /dev/null
+++ b/emulators/sdlmess/patches/patch-src_osd_sdl_sdlmain_c
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- src/osd/sdl/sdlmain.c.orig Sun Mar 15 15:49:29 2009
++++ src/osd/sdl/sdlmain.c      Sun Mar 15 15:50:38 2009
+@@ -455,7 +455,7 @@ static void defines_verbose(void)
+       MACRO_VERBOSE(SDLMAME_LINUX);
+       MACRO_VERBOSE(SDLMAME_SOLARIS);
+       MACRO_VERBOSE(SDLMAME_IRIX);
+-      MACRO_VERBOSE(SDLMAME_FREEBSD);
++      MACRO_VERBOSE(SDLMAME_BSD);
+       MACRO_VERBOSE(LSB_FIRST);
+       MACRO_VERBOSE(PTR64);
+       MACRO_VERBOSE(MAME_DEBUG);
diff --git a/emulators/sdlmess/patches/patch-src_osd_sdl_sdlmisc_c 
b/emulators/sdlmess/patches/patch-src_osd_sdl_sdlmisc_c
new file mode 100644
index 0000000..8c06982
--- /dev/null
+++ b/emulators/sdlmess/patches/patch-src_osd_sdl_sdlmisc_c
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- src/osd/sdl/sdlmisc.c.orig Sun Mar 15 15:49:29 2009
++++ src/osd/sdl/sdlmisc.c      Sun Mar 15 15:50:38 2009
+@@ -50,7 +50,7 @@ void *osd_alloc_executable(size_t size)
+ {
+ #if defined(SDLMAME_DARWIN)
+       return (void *)malloc(size);
+-#elif defined(SDLMAME_FREEBSD)
++#elif defined(SDLMAME_BSD)
+       return (void *)mmap(0, size, PROT_EXEC|PROT_READ|PROT_WRITE, 
MAP_ANON|MAP_SHARED, -1, 0);
+ #elif defined(SDLMAME_UNIX)
+       return (void *)mmap(0, size, PROT_EXEC|PROT_READ|PROT_WRITE, 
MAP_ANON|MAP_SHARED, 0, 0);
diff --git a/emulators/sdlmess/patches/patch-src_osd_sdl_sdlprefix_h 
b/emulators/sdlmess/patches/patch-src_osd_sdl_sdlprefix_h
new file mode 100644
index 0000000..b1768d9
--- /dev/null
+++ b/emulators/sdlmess/patches/patch-src_osd_sdl_sdlprefix_h
@@ -0,0 +1,14 @@
+$OpenBSD$
+--- src/osd/sdl/sdlprefix.h.orig       Sun Mar 15 15:49:29 2009
++++ src/osd/sdl/sdlprefix.h    Sun Mar 15 15:50:39 2009
+@@ -30,8 +30,8 @@
+ #elif defined(__linux__)
+ #define SDLMAME_LINUX 1
+ 
+-#elif defined(__FreeBSD__) || defined(__DragonFly__)
+-#define SDLMAME_FREEBSD 1
++#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
++#define SDLMAME_BSD 1
+ #endif
+ 
+ // fix for Ubuntu 8.10
diff --git a/emulators/sdlmess/pkg/PLIST b/emulators/sdlmess/pkg/PLIST
index 71b9dd5..cc50e34 100644
--- a/emulators/sdlmess/pkg/PLIST
+++ b/emulators/sdlmess/pkg/PLIST
@@ -1,12 +1,11 @@
 @comment $OpenBSD$
-...@bin bin/mess-chdman
-...@bin bin/mess-dat2html
-...@bin bin/mess-imgtool
-...@bin bin/mess-jedutil
-...@bin bin/mess-ldresample
-...@bin bin/mess-ldverify
-...@bin bin/mess-romcmp
-...@bin bin/mess-testkeys
+...@bin bin/chdman-mess
+...@bin bin/dat2html-mess
+...@bin bin/imgtool-mess
+...@bin bin/jedutil-mess
+...@bin bin/ldresample-mess
+...@bin bin/ldverify-mess
+...@bin bin/romcmp-mess
 @bin bin/sdlmess
 share/doc/sdlmess/
 share/doc/sdlmess/SDLMESS.txt

Attachment: sdlmess-0.130v2.tar.gz
Description: application/tar-gz

Reply via email to