Gentoo Archives: gentoo-commits

From: Michael Sterrett <mr_bones_@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-emulation/sdlmame/
Date: Tue, 03 May 2016 06:10:23
Message-Id: 1462255805.5c55743001f31c2d5de5da918bacbf2e9f20a55d.mr_bones_@gentoo
1 commit: 5c55743001f31c2d5de5da918bacbf2e9f20a55d
2 Author: Michael Sterrett <mr_bones_ <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 3 06:09:46 2016 +0000
4 Commit: Michael Sterrett <mr_bones_ <AT> gentoo <DOT> org>
5 CommitDate: Tue May 3 06:10:05 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5c557430
7
8 games-emulation/sdlmame: version bump (bug #573154)
9
10 Package-Manager: portage-2.2.26
11
12 games-emulation/sdlmame/Manifest | 1 +
13 games-emulation/sdlmame/sdlmame-0.173.ebuild | 232 +++++++++++++++++++++++++++
14 2 files changed, 233 insertions(+)
15
16 diff --git a/games-emulation/sdlmame/Manifest b/games-emulation/sdlmame/Manifest
17 index 27c42ad..95551bb 100644
18 --- a/games-emulation/sdlmame/Manifest
19 +++ b/games-emulation/sdlmame/Manifest
20 @@ -1 +1,2 @@
21 DIST mame-0.168.zip 82770536 SHA256 f91e014c3d3bf3da790284a25437f231a84228a6adbf42db35ca34a57f8a3092 SHA512 14b0519682f8aeb2379cd29b9e0ad8f3c54866296ac158876435425b79c3bf19a2dc520df7a44fe301a8e8cbbc335185602f4998edf6e95324f527c50c72411e WHIRLPOOL 41ddbe191423e3653a52f7734cc85088f1c663fd9aefdbd00ceefbe86f27bde190d14505be7fa69f76c7a39c6bbb5ab196685c2e001c8517cb90f4f7f27e8a51
22 +DIST mame-0.173.zip 92387665 SHA256 45a31815838abfab10d4b0c13be013c24385f1ff07aaeafa8e86014b996376a5 SHA512 e4ca67cf313b23c49a30914299878270caddd24b5f26aefb6a5dc3ae0720847aff63e999237997edb01492afd60e3afd4be54ff885595e2f043ac4c0b647488b WHIRLPOOL d7065575ea842e63efd0494b1ba477524b4185b7ebd651bb7a60240b38b692245c53bf3a6044c251805bb80b7cd053f0f903259da36e9d109039579372255956
23
24 diff --git a/games-emulation/sdlmame/sdlmame-0.173.ebuild b/games-emulation/sdlmame/sdlmame-0.173.ebuild
25 new file mode 100644
26 index 0000000..adc1cb7
27 --- /dev/null
28 +++ b/games-emulation/sdlmame/sdlmame-0.173.ebuild
29 @@ -0,0 +1,232 @@
30 +# Copyright 1999-2016 Gentoo Foundation
31 +# Distributed under the terms of the GNU General Public License v2
32 +# $Id$
33 +
34 +EAPI=5
35 +PYTHON_COMPAT=( python2_7 )
36 +inherit eutils python-any-r1 toolchain-funcs qmake-utils games
37 +
38 +MY_PV="${PV/.}"
39 +
40 +DESCRIPTION="Multiple Arcade Machine Emulator + Multi Emulator Super System (MESS)"
41 +HOMEPAGE="http://mamedev.org/"
42 +SRC_URI="https://github.com/mamedev/mame/releases/download/mame${MY_PV}/mame${MY_PV}s.zip -> mame-${PV}.zip"
43 +
44 +LICENSE="GPL-2+ BSD-2 MIT CC0-1.0"
45 +SLOT="0"
46 +KEYWORDS="~amd64 ~x86"
47 +IUSE="alsa +arcade debug +mess opengl openmp tools"
48 +REQUIRED_USE="|| ( arcade mess )"
49 +
50 +# MESS (games-emulation/sdlmess) has been merged into MAME upstream since mame-0.162 (see below)
51 +# MAME/MESS build combined (default) +arcade +mess (mame)
52 +# MAME build only +arcade -mess (mamearcade)
53 +# MESS build only -arcade +mess (mess)
54 +# games-emulation/sdlmametools is dropped and enabled instead by the 'tools' useflag
55 +RDEPEND="!games-emulation/sdlmametools
56 + !games-emulation/sdlmess
57 + dev-db/sqlite:3
58 + dev-libs/expat
59 + media-libs/fontconfig
60 + media-libs/flac
61 + media-libs/libsdl2[joystick,opengl?,sound,video]
62 + media-libs/portaudio
63 + media-libs/sdl2-ttf
64 + sys-libs/zlib
65 + virtual/jpeg:0
66 + virtual/opengl
67 + alsa? ( media-libs/alsa-lib
68 + media-libs/portmidi )
69 + debug? ( dev-qt/qtcore:5
70 + dev-qt/qtgui:5
71 + dev-qt/qtwidgets:5 )
72 + x11-libs/libX11
73 + x11-libs/libXinerama
74 + ${PYTHON_DEPS}"
75 +DEPEND="${RDEPEND}
76 + ${PYTHON_DEPS}
77 + app-arch/unzip
78 + virtual/pkgconfig
79 + x11-proto/xineramaproto"
80 +
81 +S=${WORKDIR}
82 +
83 +# Function to disable a makefile option
84 +disable_feature() {
85 + sed -i -e "/$1.*=/s:^:# :" makefile || die
86 +}
87 +
88 +# Function to enable a makefile option
89 +enable_feature() {
90 + sed -i -e "/^#.*$1.*=/s:^#::" makefile || die
91 +}
92 +
93 +pkg_setup() {
94 + games_pkg_setup
95 + python-any-r1_pkg_setup
96 +}
97 +
98 +src_unpack() {
99 + default
100 + unpack ./mame.zip
101 + rm -f mame.zip || die
102 +}
103 +
104 +src_prepare() {
105 + # Disable using bundled libraries
106 + enable_feature USE_SYSTEM_LIB_EXPAT
107 + enable_feature USE_SYSTEM_LIB_FLAC
108 + enable_feature USE_SYSTEM_LIB_JPEG
109 +# Use bundled lua for now to ensure correct compilation (ref. b.g.o #407091)
110 +# enable_feature USE_SYSTEM_LIB_LUA
111 + enable_feature USE_SYSTEM_LIB_PORTAUDIO
112 + enable_feature USE_SYSTEM_LIB_SQLITE3
113 + enable_feature USE_SYSTEM_LIB_ZLIB
114 +
115 + # Disable warnings being treated as errors and enable verbose build output
116 + enable_feature NOWERROR
117 + enable_feature VERBOSE
118 +
119 + use amd64 && enable_feature PTR64
120 + use debug && enable_feature DEBUG
121 + use tools && enable_feature TOOLS
122 + disable_feature NO_X11 # bgfx needs X
123 + use openmp && enable_feature OPENMP
124 +
125 + if use alsa ; then
126 + enable_feature USE_SYSTEM_LIB_PORTMIDI
127 + else
128 + enable_feature NO_USE_MIDI
129 + fi
130 +
131 + sed -i \
132 + -e 's/-Os//' \
133 + -e '/^\(CC\|CXX\|AR\) /s/=/?=/' \
134 + 3rdparty/genie/build/gmake.linux/genie.make || die
135 +}
136 +
137 +src_compile() {
138 + local targetargs
139 + local qtdebug=$(usex debug 1 0)
140 +
141 + use arcade && ! use mess && targetargs="SUBTARGET=arcade"
142 + ! use arcade && use mess && targetargs="SUBTARGET=mess"
143 +
144 + function my_emake() {
145 + # Workaround conflicting $ARCH variable used by both Gentoo's
146 + # portage and by Mame's build scripts
147 + PYTHON_EXECUTABLE=${PYTHON} \
148 + OVERRIDE_CC=$(tc-getCC) \
149 + OVERRIDE_CXX=$(tc-getCXX) \
150 + OVERRIDE_LD=$(tc-getCXX) \
151 + QT_HOME="$(qt5_get_libdir)/qt5" \
152 + ARCH= \
153 + emake "$@" \
154 + AR=$(tc-getAR)
155 + }
156 + my_emake -j1 generate
157 +
158 + my_emake ${targetargs} \
159 + SDL_INI_PATH="\$\$\$\$HOME/.sdlmame;${GAMES_SYSCONFDIR}/${PN}" \
160 + USE_QTDEBUG=${qtdebug}
161 +
162 + if use tools ; then
163 + my_emake -j1 TARGET=ldplayer USE_QTDEBUG=${qtdebug}
164 + fi
165 +}
166 +
167 +src_install() {
168 + local MAMEBIN
169 + local suffix="$(use amd64 && echo 64)$(use debug && echo d)"
170 + local f
171 +
172 + function mess_install() {
173 + dosym ${MAMEBIN} "${GAMES_BINDIR}"/mess${suffix}
174 + dosym ${MAMEBIN} "${GAMES_BINDIR}"/sdlmess
175 + newman docs/man/mess.6 sdlmess.6
176 + doman docs/man/mess.6
177 + }
178 + if use arcade ; then
179 + if use mess ; then
180 + MAMEBIN="mame${suffix}"
181 + mess_install
182 + else
183 + MAMEBIN="mamearcade${suffix}"
184 + fi
185 + doman docs/man/mame.6
186 + newman docs/man/mame.6 ${PN}.6
187 + elif use mess ; then
188 + MAMEBIN="mess${suffix}"
189 + mess_install
190 + fi
191 + dogamesbin ${MAMEBIN}
192 + dosym ${MAMEBIN} "${GAMES_BINDIR}/${PN}"
193 +
194 + insinto "${GAMES_DATADIR}/${PN}"
195 + doins -r keymaps $(use mess && echo hash)
196 +
197 + # Create default mame.ini and inject Gentoo settings into it
198 + # Note that '~' does not work and '$HOME' must be used
199 + ./${MAMEBIN} -noreadconfig -showconfig > "${T}/mame.ini" || die
200 + # -- Paths --
201 + for f in {rom,hash,sample,art,font,crosshair} ; do
202 + sed -i \
203 + -e "s:\(${f}path\)[ \t]*\(.*\):\1 \t\t\$HOME/.${PN}/\2;${GAMES_DATADIR}/${PN}/\2:" \
204 + "${T}/mame.ini" || die
205 + done
206 + for f in {ctrlr,cheat} ; do
207 + sed -i \
208 + -e "s:\(${f}path\)[ \t]*\(.*\):\1 \t\t\$HOME/.${PN}/\2;${GAMES_SYSCONFDIR}/${PN}/\2;${GAMES_DATADIR}/${PN}/\2:" \
209 + "${T}/mame.ini" || die
210 + done
211 + # -- Directories
212 + for f in {cfg,nvram,memcard,input,state,snapshot,diff,comment} ; do
213 + sed -i \
214 + -e "s:\(${f}_directory\)[ \t]*\(.*\):\1 \t\t\$HOME/.${PN}/\2:" \
215 + "${T}/mame.ini" || die
216 + done
217 + # -- Keymaps --
218 + sed -i \
219 + -e "s:\(keymap_file\)[ \t]*\(.*\):\1 \t\t\$HOME/.${PN}/\2:" \
220 + "${T}/mame.ini" || die
221 + for f in keymaps/km*.map ; do
222 + sed -i \
223 + -e "/^keymap_file/a \#keymap_file \t\t${GAMES_DATADIR}/${PN}/keymaps/${f##*/}" \
224 + "${T}/mame.ini" || die
225 + done
226 + insinto "${GAMES_SYSCONFDIR}/${PN}"
227 + doins "${T}/mame.ini"
228 +
229 + insinto "${GAMES_SYSCONFDIR}/${PN}"
230 + doins "${FILESDIR}/vector.ini"
231 +
232 + dodoc docs/{config,mame,newvideo}.txt
233 + keepdir \
234 + "${GAMES_DATADIR}/${PN}"/{ctrlr,cheat,roms,samples,artwork,crosshair} \
235 + "${GAMES_SYSCONFDIR}/${PN}"/{ctrlr,cheat}
236 +
237 + if use tools ; then
238 + for f in castool chdman floptool imgtool jedutil ldresample ldverify romcmp testkeys ; do
239 + newgamesbin ${f} ${PN}-${f}
240 + newman docs/man/${f}.1 ${PN}-${f}.1
241 + done
242 + newgamesbin ldplayer${suffix} ${PN}-ldplayer
243 + newman docs/man/ldplayer.1 ${PN}-ldplayer.1
244 + fi
245 +
246 + prepgamesdirs
247 +}
248 +
249 +pkg_postinst() {
250 + games_pkg_postinst
251 +
252 + elog "It is strongly recommended to change either the system-wide"
253 + elog " ${GAMES_SYSCONFDIR}/${PN}/mame.ini or use a per-user setup at ~/.${PN}/mame.ini"
254 + elog
255 + if use opengl ; then
256 + elog "You built ${PN} with opengl support and should set"
257 + elog "\"video\" to \"opengl\" in mame.ini to take advantage of that"
258 + elog
259 + elog "For more info see http://wiki.mamedev.org"
260 + fi
261 +}