summaryrefslogtreecommitdiff
path: root/games-emulation/sdlmame
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /games-emulation/sdlmame
reinit the tree, so we can have metadata
Diffstat (limited to 'games-emulation/sdlmame')
-rw-r--r--games-emulation/sdlmame/Manifest10
-rw-r--r--games-emulation/sdlmame/files/sdlmame-0.174-cxx14.patch28
-rw-r--r--games-emulation/sdlmame/files/sdlmame-0.174-qt.patch29
-rw-r--r--games-emulation/sdlmame/files/vector.ini9
-rw-r--r--games-emulation/sdlmame/metadata.xml30
-rw-r--r--games-emulation/sdlmame/sdlmame-0.168.ebuild232
-rw-r--r--games-emulation/sdlmame/sdlmame-0.174.ebuild234
7 files changed, 572 insertions, 0 deletions
diff --git a/games-emulation/sdlmame/Manifest b/games-emulation/sdlmame/Manifest
new file mode 100644
index 000000000000..dcaaef6a6179
--- /dev/null
+++ b/games-emulation/sdlmame/Manifest
@@ -0,0 +1,10 @@
+AUX sdlmame-0.174-cxx14.patch 812 SHA256 a8e7cdd6099d7d7beab228c87bceae5878fe5cee39b3611d20ce72ac72f38b01 SHA512 988eec1f288e2b82ce9aea863c2cf7368fc598ce6c3ccada1c50c0f05f0600d84d4bd0891a5ccd256810c2f0c4206ea0c4b37ad2de1193605de6b682a2afcbe5 WHIRLPOOL f1090d175ffc663d11f220d6f090684f82b439c179056b37f8d4b54eaff8c932a921e167251f7973b204135c5dd5b9b3984a023b84820f2cef6204a92061d8d2
+AUX sdlmame-0.174-qt.patch 829 SHA256 0795ef98e0075586624d696bda29740dbf72f1ef367183fbfa3635ccd8e14c95 SHA512 68ce8a500acfda83152bdb6a2dd798ca29099c3671864f4a30557b3b878b2d4b71c6bbff18291a8e0a43a5a736ec0f0952385b5867bf7d6129ce154537aabd96 WHIRLPOOL e25624097711ae28529cee900c9cec7beb4ba1ba5293e7877f59734204c5e576c3057007673479e95ad0b309c79ddd72e3826506908682e0d476e790d6208328
+AUX vector.ini 116 SHA256 408aeaaffcb2ecccd20db457f22d2d5efa930c0f62a92987b0fbefaf6c038c23 SHA512 6d84eb7b9c4e9f134b57e64ba9ae30dcaaa620296830f7c9858611fde9064f803bd7d230a989a5cce34d8b815b5a98d323b19d3eef3d4c688b5c32b96b299f5f WHIRLPOOL f60543015a0195487917c696640cc66e29109298ac8f9bd1309346f6ab1b46d8e2ce83d00506c17a9ea588f6b3bac82f0f66d7e75bbf88656ba897cd50fa3dac
+DIST mame-0.168.zip 82770536 SHA256 f91e014c3d3bf3da790284a25437f231a84228a6adbf42db35ca34a57f8a3092 SHA512 14b0519682f8aeb2379cd29b9e0ad8f3c54866296ac158876435425b79c3bf19a2dc520df7a44fe301a8e8cbbc335185602f4998edf6e95324f527c50c72411e WHIRLPOOL 41ddbe191423e3653a52f7734cc85088f1c663fd9aefdbd00ceefbe86f27bde190d14505be7fa69f76c7a39c6bbb5ab196685c2e001c8517cb90f4f7f27e8a51
+DIST mame-0.174.zip 95944685 SHA256 b9b1a65e855b055b0b6b262a7644d2b9a57c73541c55ee9eb60158508348a6fd SHA512 9db4d98fb5f5373529808f3bc41fddefa65ebbf7c26d946ebf886cab25e5abf7c4d539d96dfd6af5e62f4366b2bb0b0b59d40fe7a722698f3707eb8ea4c12a0b WHIRLPOOL 02a66870e5e27b4ea5cea8a53f3e2b629cdbf86090e0ba7c80fd4a0f1f7a866e67ff730e3cf14aa416560fab172dd65a9235013be97a9b61a451227649a551cc
+EBUILD sdlmame-0.168.ebuild 6359 SHA256 f8f42c4541e4ed0f7cf211b2aabe488f4a10daf22d80399d04ab8471f6a59618 SHA512 300383ed2247fe6619fd044a70c509febf0e39d082853ed600212b4ff925389cdc08dcc6ed592c0a79975d67b118b73dc9341bed23ddef73f464dd575bcc67f2 WHIRLPOOL 0c2ab7da8222c3529cbedd4d1d7a54eeca2119b13fefcbd35fc06449c578d918d0bf4ec54a10da08eb76367f1302082bc31315532267ab7aba4b88f4d6a88ad4
+EBUILD sdlmame-0.174.ebuild 6334 SHA256 fa3e8a400bebc9529d60535679437ae116949bb07f6a5d42857194cfa427ffa7 SHA512 e9b8a1e8e96f89470e456581e0d7a2cd4d51928ea6a333f1883e8cdf380d84d747a8b4f247d31339337f3f0fbf492e3b140517735b34f96c85d2066d0dfe727c WHIRLPOOL e7a20d3be000537dcb67542be4ab5ea316b5d85d2ede81b3874a0b0e529e5e0e9ef3cfabdb66b076e2a602d45f0ec7ebbae15dfd9b87fdacee69123249123e2b
+MISC ChangeLog 6966 SHA256 b201d07b1cbcaa7f34bd0c195632cde71616b8696be2cb6454cc945ad8e60ed0 SHA512 771befc4078028932d3eccca440541629fc4f0673fdd9e9937860df88b5f128d20d0a4d684f75af7a30107418eb1b621e4de0cfe445b20307c8d07a4ba6ae66b WHIRLPOOL 094f7fc947f8fcb449e76a221adf6a7b895c63cea70b7e200db3b0f8d5f19e165e6a54aa6cf780df8be5e988447a12e16b7e510263595cb8d4b2c0171043d538
+MISC ChangeLog-2015 10471 SHA256 9cd1a24ad7823344af024f3267f44e0b349c89db9e83301aeaaa7bc41d6e1de1 SHA512 cda36946b0711b443d618a9332bbfad9a62c642c578f8904530b56c1f19ff7102151a5e43c1a5028e708fd22bc1b13cb14e90c065dd2ba42381c190c0035917f WHIRLPOOL 5cdb8fa36cd198031dc0514792e4a964356b7636c2ada448d23d73809afa01dabd5ac5b13998baac281e9f1c2f7ff7b83012799751f54623023044f7d174c30d
+MISC metadata.xml 1573 SHA256 c6ebd03a72eb92950cee9f306757c7f46b7f3c29d8c38298e9508a9e7a5853cd SHA512 a621863a22333f29886464b354f0efe7edc372ec598beec36ee3c0358846527e677a644b7ac24e1757c9f684f69c996a9cf74988643d015b3a34f3cbfa23c7e4 WHIRLPOOL 77270be2b8d17d5e4d0986f8c3c1f237764322ed1ad25519b66bbb3d9fdfaf40b5b0a8291c4d259064bb6d50f31dd7e660762015fe6085e4b9901711134dc31f
diff --git a/games-emulation/sdlmame/files/sdlmame-0.174-cxx14.patch b/games-emulation/sdlmame/files/sdlmame-0.174-cxx14.patch
new file mode 100644
index 000000000000..bd88cb476e8a
--- /dev/null
+++ b/games-emulation/sdlmame/files/sdlmame-0.174-cxx14.patch
@@ -0,0 +1,28 @@
+# work around gcc-4.9.3's implementation of cxx14
+# bug 582576 with patch from Alexander Miller
+# https://bugs.gentoo.org/show_bug.cgi?id=582576
+
+--- a/src/lib/util/strformat.h
++++ b/src/lib/util/strformat.h
+@@ -185,9 +185,8 @@
+ #include <type_traits>
+ #include <utility>
+
+-#if defined(__GLIBCXX__) && (__GLIBCXX__ < 20150413)
+-namespace std
+-{
++namespace std {
++namespace mame_cxx14_compat {
+ template<class _Container>
+ inline constexpr auto
+ cbegin(const _Container& __cont) noexcept(noexcept(std::begin(__cont)))-> decltype(std::begin(__cont))
+@@ -198,7 +197,8 @@
+ cend(const _Container& __cont) noexcept(noexcept(std::end(__cont)))-> decltype(std::end(__cont))
+ { return std::end(__cont); }
+ }
+-#endif
++using namespace mame_cxx14_compat;
++}
+
+ namespace util {
+ namespace detail {
diff --git a/games-emulation/sdlmame/files/sdlmame-0.174-qt.patch b/games-emulation/sdlmame/files/sdlmame-0.174-qt.patch
new file mode 100644
index 000000000000..f9c384d91cf8
--- /dev/null
+++ b/games-emulation/sdlmame/files/sdlmame-0.174-qt.patch
@@ -0,0 +1,29 @@
+No point in adding qt-related things to the compile line unless the qt debugger is wanted
+
+--- scripts/src/osd/sdl_cfg.lua.orig
++++ scripts/src/osd/sdl_cfg.lua
+@@ -115,14 +115,16 @@
+ configuration { }
+
+ elseif _OPTIONS["targetos"]=="linux" then
+- if _OPTIONS["QT_HOME"]~=nil then
+- buildoptions {
+- "-I" .. backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_INSTALL_HEADERS"),
+- }
+- else
+- buildoptions {
+- backtick("pkg-config --cflags Qt5Widgets"),
+- }
++ if _OPTIONS["USE_QTDEBUG"]=="1" then
++ if _OPTIONS["QT_HOME"]~=nil then
++ buildoptions {
++ "-I" .. backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_INSTALL_HEADERS"),
++ }
++ else
++ buildoptions {
++ backtick("pkg-config --cflags Qt5Widgets"),
++ }
++ end
+ end
+ elseif _OPTIONS["targetos"]=="macosx" then
+ defines {
diff --git a/games-emulation/sdlmame/files/vector.ini b/games-emulation/sdlmame/files/vector.ini
new file mode 100644
index 000000000000..d4906e34ccd7
--- /dev/null
+++ b/games-emulation/sdlmame/files/vector.ini
@@ -0,0 +1,9 @@
+#
+# Specific options file for vector games
+#
+
+#
+# VIDEO OPTIONS
+#
+video soft
+yuvmode yv12
diff --git a/games-emulation/sdlmame/metadata.xml b/games-emulation/sdlmame/metadata.xml
new file mode 100644
index 000000000000..86abf7105c06
--- /dev/null
+++ b/games-emulation/sdlmame/metadata.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <longdescription>
+SDLMAME is a port of the popular MAME[tm]. There are a few principles that guide it's development:
+
+1) run on Linux/Unix, Mac OS X, and other SDL supported operating systems with as few changes as
+possible to the base Win32 code. This means we can track changes faster than larger more conventional
+ports such as MacMAME, and we also maintain what I call "Firefox compatibilty" where learning a major
+app only needs to be done once per application, and it then applies across many operating systems. If
+you can use the command-line Win32 MAME, you already know how to use SDLMAME on any platform you may
+encounter it on.
+
+2) MAME developers are important. By keeping quickly up to date, we make it easy for people on
+non-Windows platforms to make and submit changes to the core MAME code, and we offer native
+implementations of MAME's multi-window GUI debugger on both Linux/Unix and Mac OS X.
+ </longdescription>
+ <use>
+ <flag name="arcade">Enable the Multiple Arcade Machine Emulator for arcade games support</flag>
+ <flag name="tools">Build development tools shared between sdlmame and sdlmess</flag>
+ <flag name="mess">Enable the Multi Emulator Super System for game system support</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">mamedev/mame</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-emulation/sdlmame/sdlmame-0.168.ebuild b/games-emulation/sdlmame/sdlmame-0.168.ebuild
new file mode 100644
index 000000000000..8a068399e338
--- /dev/null
+++ b/games-emulation/sdlmame/sdlmame-0.168.ebuild
@@ -0,0 +1,232 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+inherit eutils python-any-r1 toolchain-funcs games
+
+MY_PV="${PV/.}"
+
+DESCRIPTION="Multiple Arcade Machine Emulator + Multi Emulator Super System (MESS)"
+HOMEPAGE="http://mamedev.org/"
+SRC_URI="https://github.com/mamedev/mame/releases/download/mame${MY_PV}/mame${MY_PV}s.zip -> mame-${PV}.zip"
+
+LICENSE="XMAME"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="X alsa +arcade debug +mess opengl tools"
+REQUIRED_USE="|| ( arcade mess )
+ debug? ( X )"
+
+# MESS (games-emulation/sdlmess) has been merged into MAME upstream since mame-0.162 (see below)
+# MAME/MESS build combined (default) +arcade +mess (mame)
+# MAME build only +arcade -mess (mamearcade)
+# MESS build only -arcade +mess (mess)
+# games-emulation/sdlmametools is dropped and enabled instead by the 'tools' useflag
+RDEPEND="!games-emulation/sdlmametools
+ !games-emulation/sdlmess
+ dev-db/sqlite:3
+ dev-libs/expat
+ media-libs/fontconfig
+ media-libs/flac
+ media-libs/libsdl2[joystick,opengl?,sound,video]
+ media-libs/portaudio
+ media-libs/sdl2-ttf
+ sys-libs/zlib
+ virtual/jpeg:0
+ alsa? ( media-libs/alsa-lib
+ media-libs/portmidi )
+ debug? ( dev-qt/qtcore:4
+ dev-qt/qtgui:4 )
+ X? ( x11-libs/libX11
+ x11-libs/libXinerama )
+ ${PYTHON_DEPS}"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ app-arch/unzip
+ virtual/pkgconfig
+ X? ( x11-proto/xineramaproto )"
+
+S=${WORKDIR}
+
+# Function to disable a makefile option
+disable_feature() {
+ sed -i -e "/$1.*=/s:^:# :" makefile || die
+}
+
+# Function to enable a makefile option
+enable_feature() {
+ sed -i -e "/^#.*$1.*=/s:^#::" makefile || die
+}
+
+pkg_setup() {
+ games_pkg_setup
+ python-any-r1_pkg_setup
+}
+
+src_unpack() {
+ default
+ unpack ./mame.zip
+ rm -f mame.zip || die
+}
+
+src_prepare() {
+ # Disable using bundled libraries
+ enable_feature USE_SYSTEM_LIB_EXPAT
+ enable_feature USE_SYSTEM_LIB_FLAC
+ enable_feature USE_SYSTEM_LIB_JPEG
+# Use bundled lua for now to ensure correct compilation (ref. b.g.o #407091)
+# enable_feature USE_SYSTEM_LIB_LUA
+ enable_feature USE_SYSTEM_LIB_PORTAUDIO
+ enable_feature USE_SYSTEM_LIB_SQLITE3
+ enable_feature USE_SYSTEM_LIB_ZLIB
+
+ # Disable warnings being treated as errors and enable verbose build output
+ enable_feature NOWERROR
+ enable_feature VERBOSE
+
+ use amd64 && enable_feature PTR64
+ use ppc && enable_feature BIGENDIAN
+ use debug && enable_feature DEBUG
+ use opengl || enable_feature NO_OPENGL
+ use tools && enable_feature TOOLS
+ use X || enable_feature NO_X11
+
+ if use alsa ; then
+ enable_feature USE_SYSTEM_LIB_PORTMIDI
+ else
+ enable_feature NO_USE_MIDI
+ fi
+
+ sed -i \
+ -e 's/-Os//' \
+ -e '/^\(CC\|CXX\|AR\) /s/=/?=/' \
+ 3rdparty/genie/build/gmake.linux/genie.make || die
+}
+
+src_compile() {
+ local targetargs
+ local qtdebug=$(usex debug 1 0)
+
+ use arcade && ! use mess && targetargs="SUBTARGET=arcade"
+ ! use arcade && use mess && targetargs="SUBTARGET=mess"
+
+ function my_emake() {
+ # Workaround conflicting $ARCH variable used by both Gentoo's
+ # portage and by Mame's build scripts
+ # turn off bgfx for now since it's an embedded library (bug #556642)
+ PYTHON_EXECUTABLE=${PYTHON} \
+ OVERRIDE_CC=$(tc-getCC) \
+ OVERRIDE_CXX=$(tc-getCXX) \
+ OVERRIDE_LD=$(tc-getCXX) \
+ USE_BGFX=0 \
+ ARCH= \
+ emake "$@" \
+ AR=$(tc-getAR)
+ }
+ my_emake -j1 generate
+
+ my_emake ${targetargs} \
+ SDL_INI_PATH="\$\$\$\$HOME/.sdlmame;${GAMES_SYSCONFDIR}/${PN}" \
+ USE_QTDEBUG=${qtdebug}
+
+ if use tools ; then
+ my_emake -j1 TARGET=ldplayer USE_QTDEBUG=${qtdebug}
+ fi
+}
+
+src_install() {
+ local MAMEBIN
+ local suffix="$(use amd64 && echo 64)$(use debug && echo d)"
+ local f
+
+ function mess_install() {
+ dosym ${MAMEBIN} "${GAMES_BINDIR}"/mess${suffix}
+ dosym ${MAMEBIN} "${GAMES_BINDIR}"/sdlmess
+ newman src/osd/sdl/man/mess.6 sdlmess.6
+ doman src/osd/sdl/man/mess.6
+ }
+ if use arcade ; then
+ if use mess ; then
+ MAMEBIN="mame${suffix}"
+ mess_install
+ else
+ MAMEBIN="mamearcade${suffix}"
+ fi
+ doman src/osd/sdl/man/mame.6
+ newman src/osd/sdl/man/mame.6 ${PN}.6
+ elif use mess ; then
+ MAMEBIN="mess${suffix}"
+ mess_install
+ fi
+ dogamesbin ${MAMEBIN}
+ dosym ${MAMEBIN} "${GAMES_BINDIR}/${PN}"
+
+ insinto "${GAMES_DATADIR}/${PN}"
+ doins -r src/osd/sdl/keymaps $(use mess && echo hash)
+
+ # Create default mame.ini and inject Gentoo settings into it
+ # Note that '~' does not work and '$HOME' must be used
+ ./${MAMEBIN} -noreadconfig -showconfig > "${T}/mame.ini" || die
+ # -- Paths --
+ for f in {rom,hash,sample,art,font,crosshair} ; do
+ sed -i \
+ -e "s:\(${f}path\)[ \t]*\(.*\):\1 \t\t\$HOME/.${PN}/\2;${GAMES_DATADIR}/${PN}/\2:" \
+ "${T}/mame.ini" || die
+ done
+ for f in {ctrlr,cheat} ; do
+ sed -i \
+ -e "s:\(${f}path\)[ \t]*\(.*\):\1 \t\t\$HOME/.${PN}/\2;${GAMES_SYSCONFDIR}/${PN}/\2;${GAMES_DATADIR}/${PN}/\2:" \
+ "${T}/mame.ini" || die
+ done
+ # -- Directories
+ for f in {cfg,nvram,memcard,input,state,snapshot,diff,comment} ; do
+ sed -i \
+ -e "s:\(${f}_directory\)[ \t]*\(.*\):\1 \t\t\$HOME/.${PN}/\2:" \
+ "${T}/mame.ini" || die
+ done
+ # -- Keymaps --
+ sed -i \
+ -e "s:\(keymap_file\)[ \t]*\(.*\):\1 \t\t\$HOME/.${PN}/\2:" \
+ "${T}/mame.ini" || die
+ for f in src/osd/sdl/keymaps/km*.txt ; do
+ sed -i \
+ -e "/^keymap_file/a \#keymap_file \t\t${GAMES_DATADIR}/${PN}/keymaps/${f##*/}" \
+ "${T}/mame.ini" || die
+ done
+ insinto "${GAMES_SYSCONFDIR}/${PN}"
+ doins "${T}/mame.ini"
+
+ insinto "${GAMES_SYSCONFDIR}/${PN}"
+ doins "${FILESDIR}/vector.ini"
+
+ dodoc docs/{config,mame,newvideo}.txt
+ keepdir \
+ "${GAMES_DATADIR}/${PN}"/{ctrlr,cheat,roms,samples,artwork,crosshair} \
+ "${GAMES_SYSCONFDIR}/${PN}"/{ctrlr,cheat}
+
+ if use tools ; then
+ for f in castool chdman floptool imgtool jedutil ldresample ldverify romcmp testkeys ; do
+ newgamesbin ${f} ${PN}-${f}
+ newman src/osd/sdl/man/${f}.1 ${PN}-${f}.1
+ done
+ newgamesbin ldplayer${suffix} ${PN}-ldplayer
+ newman src/osd/sdl/man/ldplayer.1 ${PN}-ldplayer.1
+ fi
+
+ prepgamesdirs
+}
+
+pkg_postinst() {
+ games_pkg_postinst
+
+ elog "It is strongly recommended to change either the system-wide"
+ elog " ${GAMES_SYSCONFDIR}/${PN}/mame.ini or use a per-user setup at ~/.${PN}/mame.ini"
+ elog
+ if use opengl ; then
+ elog "You built ${PN} with opengl support and should set"
+ elog "\"video\" to \"opengl\" in mame.ini to take advantage of that"
+ elog
+ elog "For more info see http://wiki.mamedev.org"
+ fi
+}
diff --git a/games-emulation/sdlmame/sdlmame-0.174.ebuild b/games-emulation/sdlmame/sdlmame-0.174.ebuild
new file mode 100644
index 000000000000..d1f61aaf4edb
--- /dev/null
+++ b/games-emulation/sdlmame/sdlmame-0.174.ebuild
@@ -0,0 +1,234 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+inherit eutils python-any-r1 toolchain-funcs qmake-utils games
+
+MY_PV="${PV/.}"
+
+DESCRIPTION="Multiple Arcade Machine Emulator + Multi Emulator Super System (MESS)"
+HOMEPAGE="http://mamedev.org/"
+SRC_URI="https://github.com/mamedev/mame/releases/download/mame${MY_PV}/mame${MY_PV}s.zip -> mame-${PV}.zip"
+
+LICENSE="GPL-2+ BSD-2 MIT CC0-1.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="alsa +arcade debug +mess opengl openmp tools"
+REQUIRED_USE="|| ( arcade mess )"
+
+# MESS (games-emulation/sdlmess) has been merged into MAME upstream since mame-0.162 (see below)
+# MAME/MESS build combined (default) +arcade +mess (mame)
+# MAME build only +arcade -mess (mamearcade)
+# MESS build only -arcade +mess (mess)
+# games-emulation/sdlmametools is dropped and enabled instead by the 'tools' useflag
+RDEPEND="!games-emulation/sdlmametools
+ !games-emulation/sdlmess
+ dev-db/sqlite:3
+ dev-libs/expat
+ media-libs/fontconfig
+ media-libs/flac
+ media-libs/libsdl2[joystick,opengl?,sound,video,X]
+ media-libs/portaudio
+ media-libs/sdl2-ttf
+ sys-libs/zlib
+ virtual/jpeg:0
+ virtual/opengl
+ alsa? ( media-libs/alsa-lib
+ media-libs/portmidi )
+ debug? ( dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtwidgets:5 )
+ x11-libs/libX11
+ x11-libs/libXinerama
+ ${PYTHON_DEPS}"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ app-arch/unzip
+ virtual/pkgconfig
+ x11-proto/xineramaproto"
+
+S=${WORKDIR}
+
+# Function to disable a makefile option
+disable_feature() {
+ sed -i -e "/^[ ]*$1.*=/s:^:# :" makefile || die
+}
+
+# Function to enable a makefile option
+enable_feature() {
+ sed -i -e "/^#.*$1.*=/s:^#[ ]*::" makefile || die
+}
+
+pkg_setup() {
+ games_pkg_setup
+ python-any-r1_pkg_setup
+}
+
+src_unpack() {
+ default
+ unpack ./mame.zip
+ rm -f mame.zip || die
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-qt.patch \
+ "${FILESDIR}"/${P}-cxx14.patch
+ # Disable using bundled libraries
+ enable_feature USE_SYSTEM_LIB_EXPAT
+ enable_feature USE_SYSTEM_LIB_FLAC
+ enable_feature USE_SYSTEM_LIB_JPEG
+# Use bundled lua for now to ensure correct compilation (ref. b.g.o #407091)
+# enable_feature USE_SYSTEM_LIB_LUA
+ enable_feature USE_SYSTEM_LIB_PORTAUDIO
+ enable_feature USE_SYSTEM_LIB_SQLITE3
+ enable_feature USE_SYSTEM_LIB_ZLIB
+
+ # Disable warnings being treated as errors and enable verbose build output
+ enable_feature NOWERROR
+ enable_feature VERBOSE
+
+ use amd64 && enable_feature PTR64
+ use debug && enable_feature DEBUG
+ use tools && enable_feature TOOLS
+ disable_feature NO_X11 # bgfx needs X
+ use openmp && enable_feature OPENMP
+
+ if use alsa ; then
+ enable_feature USE_SYSTEM_LIB_PORTMIDI
+ else
+ enable_feature NO_USE_MIDI
+ fi
+
+ sed -i \
+ -e 's/-Os//' \
+ -e '/^\(CC\|CXX\|AR\) /s/=/?=/' \
+ 3rdparty/genie/build/gmake.linux/genie.make || die
+}
+
+src_compile() {
+ local targetargs
+ local qtdebug=$(usex debug 1 0)
+
+ use arcade && ! use mess && targetargs="SUBTARGET=arcade"
+ ! use arcade && use mess && targetargs="SUBTARGET=mess"
+
+ function my_emake() {
+ # Workaround conflicting $ARCH variable used by both Gentoo's
+ # portage and by Mame's build scripts
+ PYTHON_EXECUTABLE=${PYTHON} \
+ OVERRIDE_CC=$(tc-getCC) \
+ OVERRIDE_CXX=$(tc-getCXX) \
+ OVERRIDE_LD=$(tc-getCXX) \
+ QT_HOME="$(qt5_get_libdir)/qt5" \
+ ARCH= \
+ emake "$@" \
+ AR=$(tc-getAR)
+ }
+ my_emake -j1 generate
+
+ my_emake ${targetargs} \
+ SDL_INI_PATH="\$\$\$\$HOME/.sdlmame;${GAMES_SYSCONFDIR}/${PN}" \
+ USE_QTDEBUG=${qtdebug}
+
+ if use tools ; then
+ my_emake -j1 TARGET=ldplayer USE_QTDEBUG=${qtdebug}
+ fi
+}
+
+src_install() {
+ local MAMEBIN
+ local suffix="$(use amd64 && echo 64)$(use debug && echo d)"
+ local f
+
+ function mess_install() {
+ dosym ${MAMEBIN} "${GAMES_BINDIR}"/mess${suffix}
+ dosym ${MAMEBIN} "${GAMES_BINDIR}"/sdlmess
+ newman docs/man/mess.6 sdlmess.6
+ doman docs/man/mess.6
+ }
+ if use arcade ; then
+ if use mess ; then
+ MAMEBIN="mame${suffix}"
+ mess_install
+ else
+ MAMEBIN="mamearcade${suffix}"
+ fi
+ doman docs/man/mame.6
+ newman docs/man/mame.6 ${PN}.6
+ elif use mess ; then
+ MAMEBIN="mess${suffix}"
+ mess_install
+ fi
+ dogamesbin ${MAMEBIN}
+ dosym ${MAMEBIN} "${GAMES_BINDIR}/${PN}"
+
+ insinto "${GAMES_DATADIR}/${PN}"
+ doins -r keymaps $(use mess && echo hash)
+
+ # Create default mame.ini and inject Gentoo settings into it
+ # Note that '~' does not work and '$HOME' must be used
+ ./${MAMEBIN} -noreadconfig -showconfig > "${T}/mame.ini" || die
+ # -- Paths --
+ for f in {rom,hash,sample,art,font,crosshair} ; do
+ sed -i \
+ -e "s:\(${f}path\)[ \t]*\(.*\):\1 \t\t\$HOME/.${PN}/\2;${GAMES_DATADIR}/${PN}/\2:" \
+ "${T}/mame.ini" || die
+ done
+ for f in {ctrlr,cheat} ; do
+ sed -i \
+ -e "s:\(${f}path\)[ \t]*\(.*\):\1 \t\t\$HOME/.${PN}/\2;${GAMES_SYSCONFDIR}/${PN}/\2;${GAMES_DATADIR}/${PN}/\2:" \
+ "${T}/mame.ini" || die
+ done
+ # -- Directories
+ for f in {cfg,nvram,memcard,input,state,snapshot,diff,comment} ; do
+ sed -i \
+ -e "s:\(${f}_directory\)[ \t]*\(.*\):\1 \t\t\$HOME/.${PN}/\2:" \
+ "${T}/mame.ini" || die
+ done
+ # -- Keymaps --
+ sed -i \
+ -e "s:\(keymap_file\)[ \t]*\(.*\):\1 \t\t\$HOME/.${PN}/\2:" \
+ "${T}/mame.ini" || die
+ for f in keymaps/km*.map ; do
+ sed -i \
+ -e "/^keymap_file/a \#keymap_file \t\t${GAMES_DATADIR}/${PN}/keymaps/${f##*/}" \
+ "${T}/mame.ini" || die
+ done
+ insinto "${GAMES_SYSCONFDIR}/${PN}"
+ doins "${T}/mame.ini"
+
+ insinto "${GAMES_SYSCONFDIR}/${PN}"
+ doins "${FILESDIR}/vector.ini"
+
+ dodoc docs/{config,mame,newvideo}.txt
+ keepdir \
+ "${GAMES_DATADIR}/${PN}"/{ctrlr,cheat,roms,samples,artwork,crosshair} \
+ "${GAMES_SYSCONFDIR}/${PN}"/{ctrlr,cheat}
+
+ if use tools ; then
+ for f in castool chdman floptool imgtool jedutil ldresample ldverify romcmp ; do
+ newgamesbin ${f} ${PN}-${f}
+ newman docs/man/${f}.1 ${PN}-${f}.1
+ done
+ newgamesbin ldplayer${suffix} ${PN}-ldplayer
+ newman docs/man/ldplayer.1 ${PN}-ldplayer.1
+ fi
+
+ prepgamesdirs
+}
+
+pkg_postinst() {
+ games_pkg_postinst
+
+ elog "It is strongly recommended to change either the system-wide"
+ elog " ${GAMES_SYSCONFDIR}/${PN}/mame.ini or use a per-user setup at ~/.${PN}/mame.ini"
+ elog
+ if use opengl ; then
+ elog "You built ${PN} with opengl support and should set"
+ elog "\"video\" to \"opengl\" in mame.ini to take advantage of that"
+ elog
+ elog "For more info see http://wiki.mamedev.org"
+ fi
+}