commit: c208a8d8705596647398dac2c98b645c97c9c68f
parent fed3e1dd2c76ebf348b06cfbe885bb21082ae286
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Wed, 3 Feb 2021 00:54:14 +0100
games-sports/vdrift: Python3 compatibility
Diffstat:
5 files changed, 75 insertions(+), 76 deletions(-)
diff --git a/games-sports/vdrift/files/vdrift-2014.10.20-scons-python3.patch b/games-sports/vdrift/files/vdrift-2014.10.20-scons-python3.patch
@@ -0,0 +1,70 @@
+--- ./src/SConscript.orig 2014-09-04 16:06:21.000000000 -0400
++++ ./src/SConscript 2017-10-15 11:22:06.536446627 -0400
+@@ -151,7 +151,7 @@ src = Split("""
+ utils.cpp
+ window.cpp""")
+
+-src.sort(lambda x, y: cmp(x.lower(),y.lower()))
++src.sort(key=lambda x: x.lower())
+
+ #------------------------#
+ # Copy Build Environment #
+--- ./SConstruct.orig 2014-08-04 08:43:04.000000000 -0400
++++ ./SConstruct 2017-10-15 11:18:01.792656230 -0400
+@@ -92,9 +92,9 @@ elif sys.platform == 'darwin':
+
+ for a in env['universal']:
+ if not sdk_path:
+- print 'Building a universal binary require access to an ' + \
++ print ('Building a universal binary require access to an ' + \
+ 'SDK that has universal \nbinary support.If you know ' + \
+- 'the location of such an SDK, specify it using the \n"SDK" option'
++ 'the location of such an SDK, specify it using the \n"SDK" option')
+ Exit(1)
+ env.Append( CCFLAGS = ['-arch', a], LINKFLAGS = ['-arch', a] )
+
+@@ -141,11 +141,11 @@ else:
+ CC = 'gcc', CXX = 'g++',
+ options = opts)
+ # Take environment variables into account
+- if os.environ.has_key('CXX'):
++ if 'CXX' in os.environ:
+ env['CXX'] = os.environ['CXX']
+- if os.environ.has_key('CXXFLAGS'):
++ if 'CXXFLAGS' in os.environ:
+ env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
+- if os.environ.has_key('LDFLAGS'):
++ if 'LDFLAGS' in os.environ:
+ env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
+ check_headers = ['GL/gl.h', 'SDL2/SDL.h', 'SDL2/SDL_image.h', 'vorbis/vorbisfile.h', 'curl/curl.h', 'bullet/btBulletCollisionCommon.h', 'bullet/btBulletDynamicsCommon.h']
+ check_libs = []
+@@ -232,7 +232,7 @@ def distcopy (target, source, env):
+ def tarballer (target, source, env):
+ cmd = 'tar -jcf "%s" -C "%s" .' % ( str(target[0]), str(source[0]) )
+ #cmd = 'tar -jcf ' + str (target[0]) + ' ' + str(source[0]) + " --exclude '*~' "
+- print 'running ', cmd, ' ... '
++ print ('running ', cmd, ' ... ')
+ p = os.popen (cmd)
+ return p.close ()
+
+@@ -362,11 +362,11 @@ env.ParseConfig('pkg-config bullet --lib
+ conf = Configure(env)
+ for header in check_headers:
+ if not conf.CheckCXXHeader(header):
+- print 'You do not have the %s headers installed. Exiting.' % header
++ print ('You do not have the %s headers installed. Exiting.' % header)
+ Exit(1)
+ for lib in check_libs:
+ if not conf.CheckLibWithHeader(lib[0], lib[1], 'C', lib[2]):
+- print lib[3]
++ print (lib[3])
+ Exit(1)
+
+ env = conf.Finish()
+@@ -535,4 +535,5 @@ if 'data-package' in COMMAND_LINE_TARGET
+ if 'autopackage' in COMMAND_LINE_TARGETS:
+ os.system("CXX1=g++-3.4 CXX2=g++-4.1 APBUILD_CXX1=g++-3.4 APBUILD_NO_STATIC_X=1 VDRIFT_VERSION=%s VDRIFT_MINIMAL=%d VDRIFT_RELEASE=%d makepackage tools/autopackage/vdrift.apspec" % (version, env['minimal'], env['release']))
+
+-SConscript('src/SConscript', variant_dir = build_dir, duplicate = 0)
++VariantDir(build_dir, '.', duplicate = 0)
++SConscript('src/SConscript')
diff --git a/games-sports/vdrift/files/vdrift-2014.10.20-sconscript.patch b/games-sports/vdrift/files/vdrift-2014.10.20-sconscript.patch
@@ -1,11 +0,0 @@
---- ./src/SConscript.orig 2014-09-04 16:06:21.000000000 -0400
-+++ ./src/SConscript 2017-10-15 11:22:06.536446627 -0400
-@@ -151,7 +151,7 @@ src = Split("""
- utils.cpp
- window.cpp""")
-
--src.sort(lambda x, y: cmp(x.lower(),y.lower()))
-+src.sort(key=lambda x: x.lower())
-
- #------------------------#
- # Copy Build Environment #
diff --git a/games-sports/vdrift/files/vdrift-2014.10.20-sconstruct.patch b/games-sports/vdrift/files/vdrift-2014.10.20-sconstruct.patch
@@ -1,59 +0,0 @@
---- ./SConstruct.orig 2014-08-04 08:43:04.000000000 -0400
-+++ ./SConstruct 2017-10-15 11:18:01.792656230 -0400
-@@ -92,9 +92,9 @@ elif sys.platform == 'darwin':
-
- for a in env['universal']:
- if not sdk_path:
-- print 'Building a universal binary require access to an ' + \
-+ print ('Building a universal binary require access to an ' + \
- 'SDK that has universal \nbinary support.If you know ' + \
-- 'the location of such an SDK, specify it using the \n"SDK" option'
-+ 'the location of such an SDK, specify it using the \n"SDK" option')
- Exit(1)
- env.Append( CCFLAGS = ['-arch', a], LINKFLAGS = ['-arch', a] )
-
-@@ -141,11 +141,11 @@ else:
- CC = 'gcc', CXX = 'g++',
- options = opts)
- # Take environment variables into account
-- if os.environ.has_key('CXX'):
-+ if 'CXX' in os.environ:
- env['CXX'] = os.environ['CXX']
-- if os.environ.has_key('CXXFLAGS'):
-+ if 'CXXFLAGS' in os.environ:
- env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
-- if os.environ.has_key('LDFLAGS'):
-+ if 'LDFLAGS' in os.environ:
- env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
- check_headers = ['GL/gl.h', 'SDL2/SDL.h', 'SDL2/SDL_image.h', 'vorbis/vorbisfile.h', 'curl/curl.h', 'bullet/btBulletCollisionCommon.h', 'bullet/btBulletDynamicsCommon.h']
- check_libs = []
-@@ -232,7 +232,7 @@ def distcopy (target, source, env):
- def tarballer (target, source, env):
- cmd = 'tar -jcf "%s" -C "%s" .' % ( str(target[0]), str(source[0]) )
- #cmd = 'tar -jcf ' + str (target[0]) + ' ' + str(source[0]) + " --exclude '*~' "
-- print 'running ', cmd, ' ... '
-+ print ('running ', cmd, ' ... ')
- p = os.popen (cmd)
- return p.close ()
-
-@@ -362,11 +362,11 @@ env.ParseConfig('pkg-config bullet --lib
- conf = Configure(env)
- for header in check_headers:
- if not conf.CheckCXXHeader(header):
-- print 'You do not have the %s headers installed. Exiting.' % header
-+ print ('You do not have the %s headers installed. Exiting.' % header)
- Exit(1)
- for lib in check_libs:
- if not conf.CheckLibWithHeader(lib[0], lib[1], 'C', lib[2]):
-- print lib[3]
-+ print (lib[3])
- Exit(1)
-
- env = conf.Finish()
-@@ -535,4 +535,5 @@ if 'data-package' in COMMAND_LINE_TARGET
- if 'autopackage' in COMMAND_LINE_TARGETS:
- os.system("CXX1=g++-3.4 CXX2=g++-4.1 APBUILD_CXX1=g++-3.4 APBUILD_NO_STATIC_X=1 VDRIFT_VERSION=%s VDRIFT_MINIMAL=%d VDRIFT_RELEASE=%d makepackage tools/autopackage/vdrift.apspec" % (version, env['minimal'], env['release']))
-
--SConscript('src/SConscript', variant_dir = build_dir, duplicate = 0)
-+VariantDir(build_dir, '.', duplicate = 0)
-+SConscript('src/SConscript')
diff --git a/games-sports/vdrift/vdrift-2014.10.20.ebuild b/games-sports/vdrift/vdrift-2014.10.20.ebuild
@@ -1,10 +1,10 @@
# Copyright 1999-2015 Gentoo Foundation
-# Copyright 2019 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
+# Copyright 2019-2021 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
# Distributed under the terms of the GNU General Public License v2
EAPI=7
-PYTHON_COMPAT=( python2_7 )
+PYTHON_COMPAT=( python3_{7,8,9} )
inherit python-any-r1 scons-utils
@@ -32,8 +32,7 @@ DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}/${P}-gcc6.patch"
- "${FILESDIR}/${P}-sconscript.patch"
- "${FILESDIR}/${P}-sconstruct.patch"
+ "${FILESDIR}/${P}-scons-python3.patch"
)
src_configure() {
diff --git a/games-sports/vdrift/vdrift-9999.ebuild b/games-sports/vdrift/vdrift-9999.ebuild
@@ -1,10 +1,10 @@
# Copyright 1999-2015 Gentoo Foundation
-# Copyright 2019 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
+# Copyright 2019-2021 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
# Distributed under the terms of the GNU General Public License v2
EAPI=7
-PYTHON_COMPAT=( python2_7 )
+PYTHON_COMPAT=( python3_{7,8,9} )
inherit python-any-r1 scons-utils