From 718cf88e8d7699d94619cfccd730d83e0897287d Mon Sep 17 00:00:00 2001 From: q66 Date: Thu, 20 Dec 2018 18:16:33 +0100 Subject: [PATCH] mame: fix ppc64 builds, fix ELF in /usr/share [ci skip] --- srcpkgs/mame/files/mame.sh | 4 +-- srcpkgs/mame/files/mess.sh | 4 +-- srcpkgs/mame/patches/ppc64-fixes.patch | 35 ++++++++++++++++++++++++++ srcpkgs/mame/template | 6 ++--- 4 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 srcpkgs/mame/patches/ppc64-fixes.patch diff --git a/srcpkgs/mame/files/mame.sh b/srcpkgs/mame/files/mame.sh index 486f436cab1..b34dae8e945 100644 --- a/srcpkgs/mame/files/mame.sh +++ b/srcpkgs/mame/files/mame.sh @@ -1,7 +1,7 @@ #!/bin/sh exec_mame() { - /usr/share/mame/mame \ + /usr/libexec/mame/mame \ -artpath "$HOME/.mame/artwork;artwork" \ -ctrlrpath "$HOME/.mame/ctrlr;ctrlr" \ -inipath $HOME/.mame/ini \ @@ -41,5 +41,5 @@ elif [ ! -e $HOME/.mame ]; then cd $HOME/.mame && exec_mame else cd /usr/share/mame - ./mame "$@" + /usr/libexec/mame/mame "$@" fi diff --git a/srcpkgs/mame/files/mess.sh b/srcpkgs/mame/files/mess.sh index ff7ac1997bd..2cf56d9b321 100644 --- a/srcpkgs/mame/files/mess.sh +++ b/srcpkgs/mame/files/mess.sh @@ -1,7 +1,7 @@ #!/bin/sh exec_mess() { - /usr/share/mame/mess \ + /usr/libexec/mame/mess \ -artpath "$HOME/.mess/artwork;artwork" \ -ctrlrpath "$HOME/.mess/ctrlr;ctrlr" \ -inipath $HOME/.mess/ini \ @@ -41,5 +41,5 @@ elif [ ! -e $HOME/.mess ]; then cd $HOME/.mess && exec_mess else cd /usr/share/mame - ./mame "$@" + /usr/libexec/mame/mess "$@" fi diff --git a/srcpkgs/mame/patches/ppc64-fixes.patch b/srcpkgs/mame/patches/ppc64-fixes.patch new file mode 100644 index 00000000000..6c847f09b81 --- /dev/null +++ b/srcpkgs/mame/patches/ppc64-fixes.patch @@ -0,0 +1,35 @@ +--- 3rdparty/bx/include/bx/platform.h ++++ 3rdparty/bx/include/bx/platform.h +@@ -133,8 +133,14 @@ + #endif // + + #if BX_CPU_PPC +-# undef BX_CPU_ENDIAN_BIG +-# define BX_CPU_ENDIAN_BIG 1 ++// _LITTLE_ENDIAN exists on ppc64le. ++# if _LITTLE_ENDIAN ++# undef BX_CPU_ENDIAN_LITTLE ++# define BX_CPU_ENDIAN_LITTLE 1 ++# else ++# undef BX_CPU_ENDIAN_BIG ++# define BX_CPU_ENDIAN_BIG 1 ++# endif + #else + # undef BX_CPU_ENDIAN_LITTLE + # define BX_CPU_ENDIAN_LITTLE 1 + +--- makefile ++++ makefile +@@ -394,6 +394,12 @@ BIGENDIAN := 1 + endif + endif # BIGENDIAN + ++# Work around an issue with long doubles on ppc64 (#3157) ++ifneq (,$(findstring ppc64,$(UNAME))) ++ARCHOPTS_C += -mlong-double-64 ++ARCHOPTS_CXX += -mlong-double-64 ++endif ++ + ifndef PYTHON_EXECUTABLE + PYTHON := python + else diff --git a/srcpkgs/mame/template b/srcpkgs/mame/template index 0e5545799c1..da05bb4cf92 100644 --- a/srcpkgs/mame/template +++ b/srcpkgs/mame/template @@ -52,7 +52,7 @@ do_build() { i686*) # Overcome linker memory exhaustion opts+=" SYMBOLS=0" ;; - x86_64*|aarch64*) + x86_64*|aarch64*|ppc64*) opts+=" PTR64=1" ;; esac @@ -78,13 +78,13 @@ do_install() { # Install the main application(s) for f in mame mame64 mamearcade mamearcade64; do if [ -r ${f} ]; then - vinstall ${f} 755 usr/share/${pkgname} mame + vinstall ${f} 755 usr/libexec/${pkgname} mame break fi done for f in mess mess64; do if [ -r ${f} ]; then - vinstall ${f} 755 usr/share/${pkgname} mess + vinstall ${f} 755 usr/libexec/${pkgname} mess break fi done