diff options
author | John Helmert III <jchelmert3@posteo.net> | 2020-07-29 14:37:04 -0500 |
---|---|---|
committer | Stefan Strogin <steils@gentoo.org> | 2020-08-17 06:37:46 +0300 |
commit | c473af5a0d65bf42cca5198d239020b5a39c6d64 (patch) | |
tree | a5c069feff100fda5fce3b2a62c3ff4de1382329 /games-emulation | |
parent | mail-filter/libmilter: bump to 1.2 with sendmail 8.16.1 source (diff) | |
download | gentoo-c473af5a0d65bf42cca5198d239020b5a39c6d64.tar.gz gentoo-c473af5a0d65bf42cca5198d239020b5a39c6d64.tar.bz2 gentoo-c473af5a0d65bf42cca5198d239020b5a39c6d64.zip |
games-emulation/fceux: Add patch for py3 compat
Closes: https://bugs.gentoo.org/734586
Package-Manager: Portage-3.0.1, Repoman-2.3.23
Signed-off-by: John Helmert III <jchelmert3@posteo.net>
Closes: https://github.com/gentoo/gentoo/pull/16905
Signed-off-by: Stefan Strogin <steils@gentoo.org>
Diffstat (limited to 'games-emulation')
-rw-r--r-- | games-emulation/fceux/fceux-2.2.3-r2.ebuild | 61 | ||||
-rw-r--r-- | games-emulation/fceux/files/fceux-2.2.3-python3.patch | 115 |
2 files changed, 176 insertions, 0 deletions
diff --git a/games-emulation/fceux/fceux-2.2.3-r2.ebuild b/games-emulation/fceux/fceux-2.2.3-r2.ebuild new file mode 100644 index 000000000000..d276a08bf540 --- /dev/null +++ b/games-emulation/fceux/fceux-2.2.3-r2.ebuild @@ -0,0 +1,61 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{6..9} ) + +inherit python-any-r1 desktop scons-utils toolchain-funcs + +DESCRIPTION="A portable Famicom/NES emulator, an evolution of the original FCE Ultra" +HOMEPAGE="http://fceux.com/" +SRC_URI="mirror://sourceforge/fceultra/${P}.src.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="gtk logo +lua +opengl" + +RDEPEND=" + lua? ( dev-lang/lua:0 ) + media-libs/libsdl[opengl?,video] + logo? ( media-libs/gd[png] ) + opengl? ( virtual/opengl ) + gtk? ( x11-libs/gtk+:3 ) + sys-libs/zlib[minizip] +" +DEPEND="${RDEPEND}" + +PATCHES=( + "${FILESDIR}"/${PN}-2.2.2-warnings.patch + "${FILESDIR}/${P}-python3.patch" +) + +src_prepare() { + default + + tc-export CC CXX +} + +src_compile() { + escons \ + GTK=0 \ + CREATE_AVI=1 \ + SYSTEM_LUA=1 \ + SYSTEM_MINIZIP=1 \ + GTK3=$(usex gtk 1 0) \ + LOGO=$(usex logo 1 0) \ + OPENGL=$(usex opengl 1 0) \ + LUA=$(usex lua 1 0) +} + +src_install() { + dobin bin/fceux + + doman documentation/fceux.6 + docompress -x /usr/share/doc/${PF}/documentation /usr/share/doc/${PF}/fceux.chm + dodoc -r Authors changelog.txt TODO-SDL bin/fceux.chm documentation + rm -f "${D}/usr/share/doc/${PF}/documentation/fceux.6" + make_desktop_entry fceux FCEUX + doicon fceux.png +} diff --git a/games-emulation/fceux/files/fceux-2.2.3-python3.patch b/games-emulation/fceux/files/fceux-2.2.3-python3.patch new file mode 100644 index 000000000000..c08c67058d22 --- /dev/null +++ b/games-emulation/fceux/files/fceux-2.2.3-python3.patch @@ -0,0 +1,115 @@ +This is upstream's patch to fix Python 3 building, modified to apply against 2.2.3. + +https://github.com/TASVideos/fceux/commit/878245fedf028f8c9373be128dbea01f65d4a8b7 + +diff --git a/SConstruct b/SConstruct +index be84421..4b60484 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -46,30 +46,30 @@ if platform.system == "ppc": + # Default compiler flags: + env.Append(CCFLAGS = ['-Wall', '-Wno-write-strings', '-Wno-sign-compare']) + +-if os.environ.has_key('PLATFORM'): ++if 'PLATFORM' in os.environ: + env.Replace(PLATFORM = os.environ['PLATFORM']) +-if os.environ.has_key('CC'): ++if 'CC' in os.environ: + env.Replace(CC = os.environ['CC']) +-if os.environ.has_key('CXX'): ++if 'CXX' in os.environ: + env.Replace(CXX = os.environ['CXX']) +-if os.environ.has_key('WINDRES'): ++if 'WINDRES' in os.environ: + env.Replace(WINDRES = os.environ['WINDRES']) +-if os.environ.has_key('CFLAGS'): ++if 'CFLAGS' in os.environ: + env.Append(CCFLAGS = os.environ['CFLAGS'].split()) +-if os.environ.has_key('CXXFLAGS'): ++if 'CXXFLAGS' in os.environ: + env.Append(CXXFLAGS = os.environ['CXXFLAGS'].split()) +-if os.environ.has_key('CPPFLAGS'): ++if 'CPPFLAGS' in os.environ: + env.Append(CPPFLAGS = os.environ['CPPFLAGS'].split()) +-if os.environ.has_key('LDFLAGS'): ++if 'LDFLAGS' in os.environ: + env.Append(LINKFLAGS = os.environ['LDFLAGS'].split()) +-if os.environ.has_key('PKG_CONFIG_PATH'): ++if 'PKG_CONFIG_PATH' in os.environ: + env['ENV']['PKG_CONFIG_PATH'] = os.environ['PKG_CONFIG_PATH'] +-if not os.environ.has_key('PKG_CONFIG_PATH') and env['PLATFORM'] == 'darwin': ++if 'PKG_CONFIG_PATH' not in os.environ and env['PLATFORM'] == 'darwin': + env['ENV']['PKG_CONFIG_PATH'] = "/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig" +-if os.environ.has_key('PKG_CONFIG_LIBDIR'): ++if 'PKG_CONFIG_LIBDIR' in os.environ: + env['ENV']['PKG_CONFIG_LIBDIR'] = os.environ['PKG_CONFIG_LIBDIR'] + +-print "platform: ", env['PLATFORM'] ++print("platform: ", env['PLATFORM']) + + # compile with clang + if env['CLANG']: +@@ -103,18 +103,18 @@ else: + assert conf.CheckLibWithHeader('z', 'zlib.h', 'c', 'inflate;', 1), "please install: zlib" + if env['SDL2']: + if not conf.CheckLib('SDL2'): +- print 'Did not find libSDL2 or SDL2.lib, exiting!' ++ print('Did not find libSDL2 or SDL2.lib, exiting!') + Exit(1) + env.Append(CPPDEFINES=["_SDL2"]) + env.ParseConfig('pkg-config sdl2 --cflags --libs') + else: + if not conf.CheckLib('SDL'): +- print 'Did not find libSDL or SDL.lib, exiting!' ++ print('Did not find libSDL or SDL.lib, exiting!') + Exit(1) + env.ParseConfig('sdl-config --cflags --libs') + if env['GTK']: + if not conf.CheckLib('gtk-x11-2.0'): +- print 'Could not find libgtk-2.0, exiting!' ++ print('Could not find libgtk-2.0, exiting!') + Exit(1) + # Add compiler and linker flags from pkg-config + config_string = 'pkg-config --cflags --libs gtk+-2.0' +@@ -153,7 +153,7 @@ else: + env.Append(CCFLAGS = ["-I/usr/include/lua"]) + lua_available = True + if lua_available == False: +- print 'Could not find liblua, exiting!' ++ print('Could not find liblua, exiting!') + Exit(1) + else: + env.Append(CCFLAGS = ["-Isrc/lua/src"]) +@@ -167,7 +167,7 @@ else: + gd = conf.CheckLib('gd', autoadd=1) + if gd == 0: + env['LOGO'] = 0 +- print 'Did not find libgd, you won\'t be able to create a logo screen for your avis.' ++ print('Did not find libgd, you won\'t be able to create a logo screen for your avis.') + + if env['OPENGL'] and conf.CheckLibWithHeader('GL', 'GL/gl.h', 'c', autoadd=1): + conf.env.Append(CCFLAGS = "-DOPENGL") +@@ -181,8 +181,8 @@ if sys.byteorder == 'little' or env['PLATFORM'] == 'win32': + if env['FRAMESKIP']: + env.Append(CPPDEFINES = ['FRAMESKIP']) + +-print "base CPPDEFINES:",env['CPPDEFINES'] +-print "base CCFLAGS:",env['CCFLAGS'] ++print("base CPPDEFINES:",env['CPPDEFINES']) ++print("base CCFLAGS:",env['CCFLAGS']) + + if env['DEBUG']: + env.Append(CPPDEFINES=["_DEBUG"], CCFLAGS = ['-g', '-O0']) +diff --git a/src/SConscript b/src/SConscript +index 4713e15..2001146 100644 +--- a/src/SConscript ++++ b/src/SConscript +@@ -33,7 +33,7 @@ else: + platform_files = SConscript('drivers/sdl/SConscript') + file_list.append(platform_files) + +-print env['LINKFLAGS'] ++print(env['LINKFLAGS']) + + if env['PLATFORM'] == 'win32': + fceux = env.Program('fceux.exe', file_list) |