Gentoo Archives: gentoo-commits

From: Stefan Strogin <steils@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-emulation/fceux/files/, games-emulation/fceux/
Date: Mon, 17 Aug 2020 03:39:52
Message-Id: 1597635466.c473af5a0d65bf42cca5198d239020b5a39c6d64.steils@gentoo
1 commit: c473af5a0d65bf42cca5198d239020b5a39c6d64
2 Author: John Helmert III <jchelmert3 <AT> posteo <DOT> net>
3 AuthorDate: Wed Jul 29 19:37:04 2020 +0000
4 Commit: Stefan Strogin <steils <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 17 03:37:46 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c473af5a
7
8 games-emulation/fceux: Add patch for py3 compat
9
10 Closes: https://bugs.gentoo.org/734586
11 Package-Manager: Portage-3.0.1, Repoman-2.3.23
12 Signed-off-by: John Helmert III <jchelmert3 <AT> posteo.net>
13 Closes: https://github.com/gentoo/gentoo/pull/16905
14 Signed-off-by: Stefan Strogin <steils <AT> gentoo.org>
15
16 games-emulation/fceux/fceux-2.2.3-r2.ebuild | 61 +++++++++++
17 .../fceux/files/fceux-2.2.3-python3.patch | 115 +++++++++++++++++++++
18 2 files changed, 176 insertions(+)
19
20 diff --git a/games-emulation/fceux/fceux-2.2.3-r2.ebuild b/games-emulation/fceux/fceux-2.2.3-r2.ebuild
21 new file mode 100644
22 index 00000000000..d276a08bf54
23 --- /dev/null
24 +++ b/games-emulation/fceux/fceux-2.2.3-r2.ebuild
25 @@ -0,0 +1,61 @@
26 +# Copyright 1999-2020 Gentoo Authors
27 +# Distributed under the terms of the GNU General Public License v2
28 +
29 +EAPI=7
30 +
31 +PYTHON_COMPAT=( python3_{6..9} )
32 +
33 +inherit python-any-r1 desktop scons-utils toolchain-funcs
34 +
35 +DESCRIPTION="A portable Famicom/NES emulator, an evolution of the original FCE Ultra"
36 +HOMEPAGE="http://fceux.com/"
37 +SRC_URI="mirror://sourceforge/fceultra/${P}.src.tar.gz"
38 +
39 +LICENSE="GPL-2"
40 +SLOT="0"
41 +KEYWORDS="~amd64 ~x86"
42 +IUSE="gtk logo +lua +opengl"
43 +
44 +RDEPEND="
45 + lua? ( dev-lang/lua:0 )
46 + media-libs/libsdl[opengl?,video]
47 + logo? ( media-libs/gd[png] )
48 + opengl? ( virtual/opengl )
49 + gtk? ( x11-libs/gtk+:3 )
50 + sys-libs/zlib[minizip]
51 +"
52 +DEPEND="${RDEPEND}"
53 +
54 +PATCHES=(
55 + "${FILESDIR}"/${PN}-2.2.2-warnings.patch
56 + "${FILESDIR}/${P}-python3.patch"
57 +)
58 +
59 +src_prepare() {
60 + default
61 +
62 + tc-export CC CXX
63 +}
64 +
65 +src_compile() {
66 + escons \
67 + GTK=0 \
68 + CREATE_AVI=1 \
69 + SYSTEM_LUA=1 \
70 + SYSTEM_MINIZIP=1 \
71 + GTK3=$(usex gtk 1 0) \
72 + LOGO=$(usex logo 1 0) \
73 + OPENGL=$(usex opengl 1 0) \
74 + LUA=$(usex lua 1 0)
75 +}
76 +
77 +src_install() {
78 + dobin bin/fceux
79 +
80 + doman documentation/fceux.6
81 + docompress -x /usr/share/doc/${PF}/documentation /usr/share/doc/${PF}/fceux.chm
82 + dodoc -r Authors changelog.txt TODO-SDL bin/fceux.chm documentation
83 + rm -f "${D}/usr/share/doc/${PF}/documentation/fceux.6"
84 + make_desktop_entry fceux FCEUX
85 + doicon fceux.png
86 +}
87
88 diff --git a/games-emulation/fceux/files/fceux-2.2.3-python3.patch b/games-emulation/fceux/files/fceux-2.2.3-python3.patch
89 new file mode 100644
90 index 00000000000..c08c67058d2
91 --- /dev/null
92 +++ b/games-emulation/fceux/files/fceux-2.2.3-python3.patch
93 @@ -0,0 +1,115 @@
94 +This is upstream's patch to fix Python 3 building, modified to apply against 2.2.3.
95 +
96 +https://github.com/TASVideos/fceux/commit/878245fedf028f8c9373be128dbea01f65d4a8b7
97 +
98 +diff --git a/SConstruct b/SConstruct
99 +index be84421..4b60484 100644
100 +--- a/SConstruct
101 ++++ b/SConstruct
102 +@@ -46,30 +46,30 @@ if platform.system == "ppc":
103 + # Default compiler flags:
104 + env.Append(CCFLAGS = ['-Wall', '-Wno-write-strings', '-Wno-sign-compare'])
105 +
106 +-if os.environ.has_key('PLATFORM'):
107 ++if 'PLATFORM' in os.environ:
108 + env.Replace(PLATFORM = os.environ['PLATFORM'])
109 +-if os.environ.has_key('CC'):
110 ++if 'CC' in os.environ:
111 + env.Replace(CC = os.environ['CC'])
112 +-if os.environ.has_key('CXX'):
113 ++if 'CXX' in os.environ:
114 + env.Replace(CXX = os.environ['CXX'])
115 +-if os.environ.has_key('WINDRES'):
116 ++if 'WINDRES' in os.environ:
117 + env.Replace(WINDRES = os.environ['WINDRES'])
118 +-if os.environ.has_key('CFLAGS'):
119 ++if 'CFLAGS' in os.environ:
120 + env.Append(CCFLAGS = os.environ['CFLAGS'].split())
121 +-if os.environ.has_key('CXXFLAGS'):
122 ++if 'CXXFLAGS' in os.environ:
123 + env.Append(CXXFLAGS = os.environ['CXXFLAGS'].split())
124 +-if os.environ.has_key('CPPFLAGS'):
125 ++if 'CPPFLAGS' in os.environ:
126 + env.Append(CPPFLAGS = os.environ['CPPFLAGS'].split())
127 +-if os.environ.has_key('LDFLAGS'):
128 ++if 'LDFLAGS' in os.environ:
129 + env.Append(LINKFLAGS = os.environ['LDFLAGS'].split())
130 +-if os.environ.has_key('PKG_CONFIG_PATH'):
131 ++if 'PKG_CONFIG_PATH' in os.environ:
132 + env['ENV']['PKG_CONFIG_PATH'] = os.environ['PKG_CONFIG_PATH']
133 +-if not os.environ.has_key('PKG_CONFIG_PATH') and env['PLATFORM'] == 'darwin':
134 ++if 'PKG_CONFIG_PATH' not in os.environ and env['PLATFORM'] == 'darwin':
135 + env['ENV']['PKG_CONFIG_PATH'] = "/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig"
136 +-if os.environ.has_key('PKG_CONFIG_LIBDIR'):
137 ++if 'PKG_CONFIG_LIBDIR' in os.environ:
138 + env['ENV']['PKG_CONFIG_LIBDIR'] = os.environ['PKG_CONFIG_LIBDIR']
139 +
140 +-print "platform: ", env['PLATFORM']
141 ++print("platform: ", env['PLATFORM'])
142 +
143 + # compile with clang
144 + if env['CLANG']:
145 +@@ -103,18 +103,18 @@ else:
146 + assert conf.CheckLibWithHeader('z', 'zlib.h', 'c', 'inflate;', 1), "please install: zlib"
147 + if env['SDL2']:
148 + if not conf.CheckLib('SDL2'):
149 +- print 'Did not find libSDL2 or SDL2.lib, exiting!'
150 ++ print('Did not find libSDL2 or SDL2.lib, exiting!')
151 + Exit(1)
152 + env.Append(CPPDEFINES=["_SDL2"])
153 + env.ParseConfig('pkg-config sdl2 --cflags --libs')
154 + else:
155 + if not conf.CheckLib('SDL'):
156 +- print 'Did not find libSDL or SDL.lib, exiting!'
157 ++ print('Did not find libSDL or SDL.lib, exiting!')
158 + Exit(1)
159 + env.ParseConfig('sdl-config --cflags --libs')
160 + if env['GTK']:
161 + if not conf.CheckLib('gtk-x11-2.0'):
162 +- print 'Could not find libgtk-2.0, exiting!'
163 ++ print('Could not find libgtk-2.0, exiting!')
164 + Exit(1)
165 + # Add compiler and linker flags from pkg-config
166 + config_string = 'pkg-config --cflags --libs gtk+-2.0'
167 +@@ -153,7 +153,7 @@ else:
168 + env.Append(CCFLAGS = ["-I/usr/include/lua"])
169 + lua_available = True
170 + if lua_available == False:
171 +- print 'Could not find liblua, exiting!'
172 ++ print('Could not find liblua, exiting!')
173 + Exit(1)
174 + else:
175 + env.Append(CCFLAGS = ["-Isrc/lua/src"])
176 +@@ -167,7 +167,7 @@ else:
177 + gd = conf.CheckLib('gd', autoadd=1)
178 + if gd == 0:
179 + env['LOGO'] = 0
180 +- print 'Did not find libgd, you won\'t be able to create a logo screen for your avis.'
181 ++ print('Did not find libgd, you won\'t be able to create a logo screen for your avis.')
182 +
183 + if env['OPENGL'] and conf.CheckLibWithHeader('GL', 'GL/gl.h', 'c', autoadd=1):
184 + conf.env.Append(CCFLAGS = "-DOPENGL")
185 +@@ -181,8 +181,8 @@ if sys.byteorder == 'little' or env['PLATFORM'] == 'win32':
186 + if env['FRAMESKIP']:
187 + env.Append(CPPDEFINES = ['FRAMESKIP'])
188 +
189 +-print "base CPPDEFINES:",env['CPPDEFINES']
190 +-print "base CCFLAGS:",env['CCFLAGS']
191 ++print("base CPPDEFINES:",env['CPPDEFINES'])
192 ++print("base CCFLAGS:",env['CCFLAGS'])
193 +
194 + if env['DEBUG']:
195 + env.Append(CPPDEFINES=["_DEBUG"], CCFLAGS = ['-g', '-O0'])
196 +diff --git a/src/SConscript b/src/SConscript
197 +index 4713e15..2001146 100644
198 +--- a/src/SConscript
199 ++++ b/src/SConscript
200 +@@ -33,7 +33,7 @@ else:
201 + platform_files = SConscript('drivers/sdl/SConscript')
202 + file_list.append(platform_files)
203 +
204 +-print env['LINKFLAGS']
205 ++print(env['LINKFLAGS'])
206 +
207 + if env['PLATFORM'] == 'win32':
208 + fceux = env.Program('fceux.exe', file_list)