pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/emulators/libretro-mame2010 libretro-mame2010: fix bui...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e70214ab4109
branches:  trunk
changeset: 454787:e70214ab4109
user:      nia <nia%pkgsrc.org@localhost>
date:      Sat Jun 19 07:23:31 2021 +0000

description:
libretro-mame2010: fix building on non-x86 non-powerpc

use the "ARM" CPU yield code (actually portable C) on everything where
there's not inline ASM.

while here, comment patches, convert line endings to unix.

diffstat:

 emulators/libretro-mame2010/Makefile                               |   11 +-
 emulators/libretro-mame2010/distinfo                               |   13 +-
 emulators/libretro-mame2010/patches/patch-Makefile                 |  121 +++++----
 emulators/libretro-mame2010/patches/patch-src_emu_emucore.h        |   32 +-
 emulators/libretro-mame2010/patches/patch-src_emu_romload.c        |   35 +-
 emulators/libretro-mame2010/patches/patch-src_emu_state.h          |   39 +-
 emulators/libretro-mame2010/patches/patch-src_emu_uimenu.c         |   29 +-
 emulators/libretro-mame2010/patches/patch-src_osd_retro_osinline.h |   24 +
 8 files changed, 172 insertions(+), 132 deletions(-)

diffs (truncated from 386 to 300 lines):

diff -r 32b88f1c7e27 -r e70214ab4109 emulators/libretro-mame2010/Makefile
--- a/emulators/libretro-mame2010/Makefile      Sat Jun 19 06:06:12 2021 +0000
+++ b/emulators/libretro-mame2010/Makefile      Sat Jun 19 07:23:31 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2020/05/31 18:34:56 nia Exp $
+# $NetBSD: Makefile,v 1.5 2021/06/19 07:23:31 nia Exp $
 
 DISTNAME=      libretro-mame2010-20200525
 CATEGORIES=    emulators
@@ -14,6 +14,8 @@
 
 LIBRETRO_CORE= mame2010
 
+TOOL_DEPENDS+= dos2unix-[0-9]*:../../converters/dos2unix
+
 MAKE_FLAGS+=   BUILD_ZLIB=0
 
 .include "../../mk/endian.mk"
@@ -32,8 +34,6 @@
 CFLAGS+=       -DNO_AFFINITY_NP
 .endif
 
-CFLAGS+=       -Wno-narrowing
-
 .if ${MACHINE_ARCH} != "x86_64" && ${MACHINE_ARCH} != "i386"
 MAKE_FLAGS+=   FORCE_DRC_C_BACKEND=1
 .endif
@@ -57,5 +57,10 @@
 MAKE_FLAGS+=   CC=${CXX:Q}
 MAKE_FLAGS+=   LD=${CXX:Q}
 
+post-extract:
+       cd ${WRKSRC} && dos2unix Makefile
+       cd ${WRKSRC} && dos2unix src/emu/*.c src/emu/*.h
+       cd ${WRKSRC} && dos2unix src/osd/retro/osinline.h
+
 .include "../../devel/zlib/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff -r 32b88f1c7e27 -r e70214ab4109 emulators/libretro-mame2010/distinfo
--- a/emulators/libretro-mame2010/distinfo      Sat Jun 19 06:06:12 2021 +0000
+++ b/emulators/libretro-mame2010/distinfo      Sat Jun 19 07:23:31 2021 +0000
@@ -1,11 +1,12 @@
-$NetBSD: distinfo,v 1.3 2020/05/30 20:36:15 nia Exp $
+$NetBSD: distinfo,v 1.4 2021/06/19 07:23:31 nia Exp $
 
 SHA1 (libretro-mame2010-20200525-bef96188e7276422eab81b44b41361896885bae5.tar.gz) = 1a9b99431b50f576236b33a82b1a4a0c17754402
 RMD160 (libretro-mame2010-20200525-bef96188e7276422eab81b44b41361896885bae5.tar.gz) = 52ab590b9401ae039cfae5beb34fc514144be9a1
 SHA512 (libretro-mame2010-20200525-bef96188e7276422eab81b44b41361896885bae5.tar.gz) = 
2da2fdf04c5198b24cf74402a13bdc77a61bd3dbcc5e682485884611ffffdc4824ac32709b3a6e24b5df1263392f4fa1939020c22202bbfea6f7ce907293b64e
 Size (libretro-mame2010-20200525-bef96188e7276422eab81b44b41361896885bae5.tar.gz) = 24302224 bytes
-SHA1 (patch-Makefile) = ac0a4ba498396911e195278e84cffdc5f98996a2
-SHA1 (patch-src_emu_emucore.h) = ecb9617e260559aeb685e9625195f2ad6c99244d
-SHA1 (patch-src_emu_romload.c) = 7907e934439a7e5ed92c71394e6a9a0c5ef9cf94
-SHA1 (patch-src_emu_state.h) = 60109326f67e079d1cd073bc15393d3b3dbb2ce9
-SHA1 (patch-src_emu_uimenu.c) = 717302298958fd0734899537ca8b77f45aa8dd77
+SHA1 (patch-Makefile) = cfa8db8855296b1793c09d509590ea2a34fd45f9
+SHA1 (patch-src_emu_emucore.h) = 51e024ebb7a92d49cf873a0a988da45a483551b7
+SHA1 (patch-src_emu_romload.c) = 130167a433cf4f7b7501a1bcf006509d5f0d5326
+SHA1 (patch-src_emu_state.h) = 89d49f5f9dbadc8c4bb703a40c8c1e7e4dae75cd
+SHA1 (patch-src_emu_uimenu.c) = a832b3c34e4fef3d11286e9a4722d9324e108447
+SHA1 (patch-src_osd_retro_osinline.h) = 3f1063ef37b96f99cea29916cbc446f5c27c6da7
diff -r 32b88f1c7e27 -r e70214ab4109 emulators/libretro-mame2010/patches/patch-Makefile
--- a/emulators/libretro-mame2010/patches/patch-Makefile        Sat Jun 19 06:06:12 2021 +0000
+++ b/emulators/libretro-mame2010/patches/patch-Makefile        Sat Jun 19 07:23:31 2021 +0000
@@ -1,64 +1,65 @@
-$NetBSD: patch-Makefile,v 1.2 2020/05/14 19:35:59 joerg Exp $
+$NetBSD: patch-Makefile,v 1.3 2021/06/19 07:23:31 nia Exp $
 
 Avoid overriding build settings.
+Fix build problems with newer compilers.
 
---- Makefile.orig      2018-04-17 17:16:44.000000000 +0000
+--- Makefile.orig      2021-06-19 06:48:42.800581466 +0000
 +++ Makefile
-@@ -55,14 +55,9 @@ LIBS = 
- #-------------------------------------------------
- 
- # start with empties for everything
--CCOMFLAGS = -DDISABLE_MIDI
--CONLYFLAGS =
--COBJFLAGS =
--CPPONLYFLAGS =
-+CCOMFLAGS += -DDISABLE_MIDI
- # LDFLAGS are used generally; LDFLAGSEMULATOR are additional
- # flags only used when linking the core emulator
--LDFLAGS =
--LDFLAGSEMULATOR =
- 
- GIT_VERSION ?= " $(shell git rev-parse --short HEAD || echo unknown)"
- ifneq ($(GIT_VERSION)," unknown")
-@@ -143,15 +138,6 @@ ifeq ($(VRENDER),opengl)  
-    LIBS += -lGL
- endif
- LDFLAGS += $(SHARED)
--   NATIVELD = g++
--   NATIVELDFLAGS = -Wl,--warn-common -lstdc++
--   NATIVECC = g++
--   NATIVECFLAGS = -std=gnu99
--   CC_AS = gcc 
--   CC = g++
--   AR = @ar
--   LD = g++ 
--   CCOMFLAGS += $(PLATCFLAGS) -ffast-math  
-    LIBS += -lstdc++ -lpthread 
- 
- # Android
-@@ -568,7 +554,7 @@ DEFS += -DFLAC__NO_DLL
- 
- # CFLAGS is defined based on C or C++ targets
- # (remember, expansion only happens when used, so doing it here is ok)
--CFLAGS = $(CCOMFLAGS) $(CPPONLYFLAGS)
-+CFLAGS += $(CCOMFLAGS) $(CPPONLYFLAGS)
- 
- # we compile C-only to C89 standard with GNU extensions
- # we compile C++ code to C++98 standard with GNU extensions
-@@ -578,7 +564,7 @@ CONLYFLAGS += -ansi
- else
- CONLYFLAGS += -std=gnu89
- endif
--CPPONLYFLAGS += -x c++ -std=gnu++98
-+CPPONLYFLAGS += -x c++ -std=gnu++11 -Wno-c++11-narrowing
- COBJFLAGS += -x objective-c++
- 
- # this speeds it up a bit by piping between the preprocessor/compiler/assembler
-@@ -588,7 +574,6 @@ ifeq ($(MDEBUG),1)
- CCOMFLAGS +=  -O0 -g
- else
- # add the optimization flag
--CCOMFLAGS += -O$(OPTIMIZE)
- endif
- 
- # add the error warning flag
+@@ -57,14 +57,9 @@ LIBS = 
+ #-------------------------------------------------
+ 
+ # start with empties for everything
+-CCOMFLAGS = -DDISABLE_MIDI
+-CONLYFLAGS =
+-COBJFLAGS =
+-CPPONLYFLAGS =
++CCOMFLAGS += -DDISABLE_MIDI
+ # LDFLAGS are used generally; LDFLAGSEMULATOR are additional
+ # flags only used when linking the core emulator
+-LDFLAGS =
+-LDFLAGSEMULATOR =
+ 
+ GIT_VERSION ?= " $(shell git rev-parse --short HEAD || echo unknown)"
+ ifneq ($(GIT_VERSION)," unknown")
+@@ -145,15 +140,6 @@ ifeq ($(VRENDER),opengl)  
+    LIBS += -lGL
+ endif
+ LDFLAGS += $(SHARED)
+-   NATIVELD = g++
+-   NATIVELDFLAGS = -Wl,--warn-common -lstdc++
+-   NATIVECC = g++
+-   NATIVECFLAGS = -std=gnu99
+-   CC_AS = gcc 
+-   CC = g++
+-   AR = @ar
+-   LD = g++ 
+-   CCOMFLAGS += $(PLATCFLAGS) -ffast-math  
+    LIBS += -lstdc++ -lpthread 
+ 
+ # Android
+@@ -656,7 +642,7 @@ DEFS += -DFLAC__NO_DLL
+ 
+ # CFLAGS is defined based on C or C++ targets
+ # (remember, expansion only happens when used, so doing it here is ok)
+-CFLAGS = $(CCOMFLAGS) $(CPPONLYFLAGS)
++CFLAGS += $(CCOMFLAGS) $(CPPONLYFLAGS)
+ 
+ # we compile C-only to C89 standard with GNU extensions
+ # we compile C++ code to C++98 standard with GNU extensions
+@@ -666,7 +652,7 @@ CONLYFLAGS += -ansi
+ else
+ CONLYFLAGS += -std=gnu89
+ endif
+-CPPONLYFLAGS += -x c++ -std=gnu++98
++CPPONLYFLAGS += -x c++ -std=gnu++11 -Wno-narrowing
+ COBJFLAGS += -x objective-c++
+ 
+ # this speeds it up a bit by piping between the preprocessor/compiler/assembler
+@@ -676,7 +662,6 @@ ifeq ($(MDEBUG),1)
+ CCOMFLAGS +=  -O0 -g
+ else
+ # add the optimization flag
+-CCOMFLAGS += -O$(OPTIMIZE)
+ endif
+ 
+ # add the error warning flag
diff -r 32b88f1c7e27 -r e70214ab4109 emulators/libretro-mame2010/patches/patch-src_emu_emucore.h
--- a/emulators/libretro-mame2010/patches/patch-src_emu_emucore.h       Sat Jun 19 06:06:12 2021 +0000
+++ b/emulators/libretro-mame2010/patches/patch-src_emu_emucore.h       Sat Jun 19 07:23:31 2021 +0000
@@ -1,22 +1,22 @@
-$NetBSD: patch-src_emu_emucore.h,v 1.1 2019/01/02 13:24:29 nia Exp $
+$NetBSD: patch-src_emu_emucore.h,v 1.2 2021/06/19 07:23:31 nia Exp $
 
 Avoid colliding with libc symbols on NetBSD.
 
 --- src/emu/emucore.h.orig     2018-04-17 17:16:44.000000000 +0000
 +++ src/emu/emucore.h
 @@ -502,6 +502,7 @@ inline void fatalerror_exitcode(running_
- //**************************************************************************
- 
- // population count
-+#ifndef __NetBSD__
- inline int popcount(UINT32 val)
- {
-       int count;
-@@ -510,6 +511,7 @@ inline int popcount(UINT32 val)
-               val &= val - 1;
-       return count;
- }
-+#endif
- 
- 
- // convert a series of 32 bits into a float
+ //**************************************************************************
+ 
+ // population count
++#ifndef __NetBSD__
+ inline int popcount(UINT32 val)
+ {
+       int count;
+@@ -510,6 +511,7 @@ inline int popcount(UINT32 val)
+               val &= val - 1;
+       return count;
+ }
++#endif
+ 
+ 
+ // convert a series of 32 bits into a float
diff -r 32b88f1c7e27 -r e70214ab4109 emulators/libretro-mame2010/patches/patch-src_emu_romload.c
--- a/emulators/libretro-mame2010/patches/patch-src_emu_romload.c       Sat Jun 19 06:06:12 2021 +0000
+++ b/emulators/libretro-mame2010/patches/patch-src_emu_romload.c       Sat Jun 19 07:23:31 2021 +0000
@@ -1,20 +1,23 @@
-$NetBSD: patch-src_emu_romload.c,v 1.1 2020/05/14 19:35:59 joerg Exp $
+$NetBSD: patch-src_emu_romload.c,v 1.2 2021/06/19 07:23:31 nia Exp $
+
+Consistently build as C++11 source, but ignore narrow issues.
+Don't depend on ordering of pointers relative to zero. Avoid UDL.
 
 --- src/emu/romload.c.orig     2020-05-13 15:21:49.756367021 +0000
 +++ src/emu/romload.c
 @@ -586,13 +586,13 @@ static void display_rom_load_results(rom
-       {
-               /* create the error message and exit fatally */
-               mame_printf_error("%s", romdata->errorstring.cstr());
--              fatalerror_exitcode(romdata->machine, MAMERR_MISSING_FILES, "ERROR: required files are missing, the "GAMENOUN" cannot be run.");
-+              fatalerror_exitcode(romdata->machine, MAMERR_MISSING_FILES, "ERROR: required files are missing, the " GAMENOUN " cannot be run.");
-       }
- 
-       /* if we had warnings, output them, but continue */
-       if (romdata->warnings)
-       {
--              romdata->errorstring.cat("WARNING: the "GAMENOUN" might not run correctly.");
-+              romdata->errorstring.cat("WARNING: the " GAMENOUN " might not run correctly.");
-               mame_printf_warning("%s\n", romdata->errorstring.cstr());
-       }
- }
+       {
+               /* create the error message and exit fatally */
+               mame_printf_error("%s", romdata->errorstring.cstr());
+-              fatalerror_exitcode(romdata->machine, MAMERR_MISSING_FILES, "ERROR: required files are missing, the "GAMENOUN" cannot be run.");
++              fatalerror_exitcode(romdata->machine, MAMERR_MISSING_FILES, "ERROR: required files are missing, the " GAMENOUN " cannot be run.");
+       }
+ 
+       /* if we had warnings, output them, but continue */
+       if (romdata->warnings)
+       {
+-              romdata->errorstring.cat("WARNING: the "GAMENOUN" might not run correctly.");
++              romdata->errorstring.cat("WARNING: the " GAMENOUN " might not run correctly.");
+               mame_printf_warning("%s\n", romdata->errorstring.cstr());
+       }
+ }
diff -r 32b88f1c7e27 -r e70214ab4109 emulators/libretro-mame2010/patches/patch-src_emu_state.h
--- a/emulators/libretro-mame2010/patches/patch-src_emu_state.h Sat Jun 19 06:06:12 2021 +0000
+++ b/emulators/libretro-mame2010/patches/patch-src_emu_state.h Sat Jun 19 07:23:31 2021 +0000
@@ -1,22 +1,25 @@
-$NetBSD: patch-src_emu_state.h,v 1.2 2020/05/30 20:36:15 nia Exp $
+$NetBSD: patch-src_emu_state.h,v 1.3 2021/06/19 07:23:31 nia Exp $
+
+Consistently build as C++11 source, but ignore narrow issues.
+Don't depend on ordering of pointers relative to zero. Avoid UDL.
 
 --- src/emu/state.h.orig       2020-05-25 02:01:22.000000000 +0000
 +++ src/emu/state.h
 @@ -18,17 +18,8 @@
- #ifndef __STATE_H__
- #define __STATE_H__
- 
--#if (defined(__MACH__) && !defined(IOS)) || defined(ANDROID)
- #include <type_traits>
- #define DEF_NAMESPACE std
--#elif defined(IOS)
--#include <type_traits>
--#define DEF_NAMESPACE std::tr1
--#define DEF_NAMESPACE std
--#elif defined(__GNUC__)
--#include <tr1/type_traits>
--#define DEF_NAMESPACE std::tr1



Home | Main Index | Thread Index | Old Index