From e828ddfde97a67d9146a4926ab13918239d8061c Mon Sep 17 00:00:00 2001 From: Cameron Nemo Date: Sun, 23 Aug 2020 19:40:23 -0700 Subject: [PATCH 01/11] scons: update to 4.0.1. Switch to Python3. --- srcpkgs/scons/template | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/srcpkgs/scons/template b/srcpkgs/scons/template index 2a598c40994..883443e3465 100644 --- a/srcpkgs/scons/template +++ b/srcpkgs/scons/template @@ -1,20 +1,19 @@ # Template file for 'scons' pkgname=scons -reverts="4.0.1_1" -version=3.1.2 -revision=4 -build_style=python2-module -make_install_args="--standard-lib --install-data=/usr/share" -hostmakedepends="python python-setuptools" -depends="python" +version=4.0.1 +revision=2 +wrksrc="SCons-${version}" +build_style=python3-module +hostmakedepends="python3 python3-setuptools" +depends="python3" short_desc="Software construction tool" maintainer="Orphaned " license="MIT" homepage="https://www.scons.org/" distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-${version}.tar.gz" -checksum="7801f3f62f654528e272df780be10c0e9337e897650b62ddcee9f39fde13f8fb" +checksum=722ed104b5c624ecdc89bd4e02b094d2b14d99d47b5d0501961e47f579a2007c post_install() { - vlicense LICENSE.txt + vlicense LICENSE } From 14161d0e2ad2c811e445e2f27fdfcc2a52ba90db Mon Sep 17 00:00:00 2001 From: Evgeny Ermakov Date: Mon, 19 Oct 2020 16:58:11 +1100 Subject: [PATCH 02/11] vdrift: remove unused dependency; minor fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [Danh] Port build system to Python 3. Co-Authored-by: Đoàn Trần Công Danh Close: #25727 --- ...de-build-date-with-SOURCE_DATE_EPOCH.patch | 38 +++++++++++ .../patches/0002-Scons-python-3-fixes.patch | 65 +++++++++++++++++++ .../0003-SConstruct-Python-3-fix.patch | 32 +++++++++ srcpkgs/vdrift/template | 7 +- 4 files changed, 138 insertions(+), 4 deletions(-) create mode 100644 srcpkgs/vdrift/patches/0001-Allow-to-override-build-date-with-SOURCE_DATE_EPOCH.patch create mode 100644 srcpkgs/vdrift/patches/0002-Scons-python-3-fixes.patch create mode 100644 srcpkgs/vdrift/patches/0003-SConstruct-Python-3-fix.patch diff --git a/srcpkgs/vdrift/patches/0001-Allow-to-override-build-date-with-SOURCE_DATE_EPOCH.patch b/srcpkgs/vdrift/patches/0001-Allow-to-override-build-date-with-SOURCE_DATE_EPOCH.patch new file mode 100644 index 00000000000..c3ec422a02f --- /dev/null +++ b/srcpkgs/vdrift/patches/0001-Allow-to-override-build-date-with-SOURCE_DATE_EPOCH.patch @@ -0,0 +1,38 @@ +From 5345e8b57d300b14c36b8519e18f67096e4b8d78 Mon Sep 17 00:00:00 2001 +From: "Bernhard M. Wiedemann" +Date: Thu, 11 Jul 2019 10:33:52 +0200 +Subject: [PATCH 1/3] Allow to override build date with SOURCE_DATE_EPOCH + +in order to make builds reproducible. +See https://reproducible-builds.org/ for why this is good +and https://reproducible-builds.org/specs/source-date-epoch/ +for the definition of this variable. + +Also use UTC/gmtime to be independent of timezone. +--- + SConstruct | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git SConstruct SConstruct +index 950a5289..763f2e36 100644 +--- SConstruct ++++ SConstruct +@@ -1,5 +1,4 @@ +-import os, sys, errno, SCons +-from time import gmtime, strftime ++import os, sys, time, errno, SCons + + #---------------# + # Build Options # +@@ -395,7 +394,7 @@ else: + #------------------------# + # Version, debug/release # + #------------------------# +-version = strftime("%Y-%m-%d") ++version = time.strftime("%Y-%m-%d", time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))) + build_dir = 'build' + if env['release']: + # release build, debugging off, optimizations on +-- +2.29.0.rc1 + diff --git a/srcpkgs/vdrift/patches/0002-Scons-python-3-fixes.patch b/srcpkgs/vdrift/patches/0002-Scons-python-3-fixes.patch new file mode 100644 index 00000000000..bd32399836e --- /dev/null +++ b/srcpkgs/vdrift/patches/0002-Scons-python-3-fixes.patch @@ -0,0 +1,65 @@ +From b5af38086bcb972f6f454f65281121cca9d0ed93 Mon Sep 17 00:00:00 2001 +From: logzero +Date: Thu, 30 Jul 2020 19:01:13 +0200 +Subject: [PATCH 2/3] Scons python 3 fixes. + +--- + SConstruct | 10 +++++----- + src/SConscript | 2 +- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git SConstruct SConstruct +index 763f2e36..f20e1745 100644 +--- SConstruct ++++ SConstruct +@@ -91,9 +91,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] ) + +@@ -231,7 +231,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 () + +@@ -361,11 +361,11 @@ env.ParseConfig('pkg-config bullet --libs --cflags') + 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() +diff --git src/SConscript src/SConscript +index c980a2e6..67cecebd 100644 +--- src/SConscript ++++ src/SConscript +@@ -151,7 +151,7 @@ src = Split(""" + utils.cpp + window.cpp""") + +-src.sort(lambda x, y: cmp(x.lower(),y.lower())) ++src.sort(key = str.lower) + + #------------------------# + # Copy Build Environment # +-- +2.29.0.rc1 + diff --git a/srcpkgs/vdrift/patches/0003-SConstruct-Python-3-fix.patch b/srcpkgs/vdrift/patches/0003-SConstruct-Python-3-fix.patch new file mode 100644 index 00000000000..2e1ea37856c --- /dev/null +++ b/srcpkgs/vdrift/patches/0003-SConstruct-Python-3-fix.patch @@ -0,0 +1,32 @@ +From d0529275cf70aa60b7942f0306217913df6bf53e Mon Sep 17 00:00:00 2001 +From: Matthias Coppens +Date: Wed, 26 Aug 2020 14:24:36 +0200 +Subject: [PATCH 3/3] SConstruct Python 3 fix + +`dict.has_key` is removed in Python 3.X, use `in` instead. +--- + SConstruct | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git SConstruct SConstruct +index f20e1745..0e7f02e9 100644 +--- SConstruct ++++ SConstruct +@@ -140,11 +140,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 = [] +-- +2.29.0.rc1 + diff --git a/srcpkgs/vdrift/template b/srcpkgs/vdrift/template index 290288696f6..5674f951a88 100644 --- a/srcpkgs/vdrift/template +++ b/srcpkgs/vdrift/template @@ -1,15 +1,15 @@ # Template file for 'vdrift' pkgname=vdrift version=2014.10.20 -revision=9 +revision=10 wrksrc="$pkgname" build_style=scons make_build_args="release=1 force_feedback=1 extbullet=1 datadir=share/${pkgname}" make_install_args="$make_build_args" hostmakedepends="gettext pkg-config" -makedepends="asio libcurl-devel bullet-devel SDL2_image-devel glew-devel +makedepends="libcurl-devel bullet-devel SDL2_image-devel glew-devel libvorbis-devel libarchive-devel MesaLib-devel" -depends="vdrift-data-${version}_${revision}" +depends="desktop-file-utils vdrift-data-${version}_${revision}" short_desc="Open source driving simulation made with drift racing in mind" maintainer="Orphaned " license="GPL-3.0-or-later" @@ -35,7 +35,6 @@ post_install() { vdrift-data_package() { short_desc+=" - data files" - archs=noarch pkg_install() { vmove usr/share/vdrift } From 91e42c94745d77213805affcc1416e1f31f3f82b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Mon, 19 Oct 2020 23:11:37 +0700 Subject: [PATCH 03/11] fceux: patch for python3-scons --- srcpkgs/fceux/patches/scons-python-3.patch | 111 +++++++++++++++++++++ srcpkgs/fceux/template | 2 +- 2 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/fceux/patches/scons-python-3.patch diff --git a/srcpkgs/fceux/patches/scons-python-3.patch b/srcpkgs/fceux/patches/scons-python-3.patch new file mode 100644 index 00000000000..b4805e93309 --- /dev/null +++ b/srcpkgs/fceux/patches/scons-python-3.patch @@ -0,0 +1,111 @@ + backported from 878245fe Altered SCons build scripts to work with Python 3. +diff --git SConstruct SConstruct +--- SConstruct ++++ SConstruct +@@ -47,30 +47,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']: +@@ -104,18 +104,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' +@@ -154,7 +154,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"]) +@@ -168,7 +168,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") +@@ -182,8 +182,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 src/SConscript src/SConscript +index 4713e15..2001146 100644 +--- src/SConscript ++++ 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) diff --git a/srcpkgs/fceux/template b/srcpkgs/fceux/template index 8a8c87d4fc4..978b097a933 100644 --- a/srcpkgs/fceux/template +++ b/srcpkgs/fceux/template @@ -1,7 +1,7 @@ # Template file for 'fceux' pkgname=fceux version=2.2.3 -revision=2 +revision=3 build_style=scons make_build_args="SYSTEM_LUA=1" hostmakedepends="pkg-config" From 46a0805e7803185d52f70fb7dcfc608310147f7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Mon, 19 Oct 2020 23:30:07 +0700 Subject: [PATCH 04/11] mixxx: build with scons (python 3) soundtouch-devel is added in makedepends, otherwise, ftbfs. --- srcpkgs/mixxx/template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srcpkgs/mixxx/template b/srcpkgs/mixxx/template index bd5a68bac98..c1c0bbb31cc 100644 --- a/srcpkgs/mixxx/template +++ b/srcpkgs/mixxx/template @@ -1,7 +1,7 @@ # Template file for 'mixxx' pkgname=mixxx version=2.2.4 -revision=4 +revision=5 wrksrc="mixxx-release-${version}" build_style=scons hostmakedepends="pkg-config protobuf" @@ -10,7 +10,7 @@ makedepends="chromaprint-devel faad2-devel ffmpeg-devel fftw-devel glu-devel opusfile-devel portaudio-devel portmidi-devel protobuf-devel qt5-script-devel qt5-svg-devel qt5-xmlpatterns-devel rubberband-devel taglib-devel upower-devel vamp-plugin-sdk-devel lv2 lilv-devel qt5-x11extras-devel hidapi-devel - libtheora-devel speex-devel" + libtheora-devel speex-devel soundtouch-devel" depends="qt5-plugin-sqlite" short_desc="Open source digital DJing software that allows mixing music" maintainer="Enno Boland " From a7c7c77111ce905c26c36ec6290c5ad4f3aff570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Tue, 20 Oct 2020 00:18:09 +0700 Subject: [PATCH 05/11] serf: build with scons-python3 --- ...11083-fix-building-with-scons-3.0.0-.patch | 31 +++++++++++++ ...print-in-the-scons-file-to-unbreak-b.patch | 31 +++++++++++++ ...3-Make-the-tests-run-with-Python-3.x.patch | 43 +++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 srcpkgs/serf/patches/0001-Follow-up-to-r1811083-fix-building-with-scons-3.0.0-.patch create mode 100644 srcpkgs/serf/patches/0002-Fix-syntax-of-a-print-in-the-scons-file-to-unbreak-b.patch create mode 100644 srcpkgs/serf/patches/0003-Make-the-tests-run-with-Python-3.x.patch diff --git a/srcpkgs/serf/patches/0001-Follow-up-to-r1811083-fix-building-with-scons-3.0.0-.patch b/srcpkgs/serf/patches/0001-Follow-up-to-r1811083-fix-building-with-scons-3.0.0-.patch new file mode 100644 index 00000000000..acbe755f538 --- /dev/null +++ b/srcpkgs/serf/patches/0001-Follow-up-to-r1811083-fix-building-with-scons-3.0.0-.patch @@ -0,0 +1,31 @@ +From 5a73b7ce7350f19fd5f908803be104b1ded97366 Mon Sep 17 00:00:00 2001 +From: Andreas Stieger +Date: Wed, 8 Nov 2017 17:05:28 +0000 +Subject: [PATCH 1/3] Follow-up to r1811083, fix building with scons 3.0.0 and + Python3 + +* SConstruct: Append decode('utf-8) to FILE.get_contents() to avoid + TypeError: cannot use a string pattern on a bytes-like object + + +git-svn-id: https://svn.apache.org/repos/asf/serf/trunk@1814604 13f79535-47bb-0310-9956-ffa450edef68 +--- + SConstruct | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git SConstruct SConstruct +index 4358a23..1766870 100644 +--- SConstruct ++++ SConstruct +@@ -166,7 +166,7 @@ env.Append(BUILDERS = { + match = re.search('SERF_MAJOR_VERSION ([0-9]+).*' + 'SERF_MINOR_VERSION ([0-9]+).*' + 'SERF_PATCH_VERSION ([0-9]+)', +- env.File('serf.h').get_contents(), ++ env.File('serf.h').get_contents().decode('utf-8'), + re.DOTALL) + MAJOR, MINOR, PATCH = [int(x) for x in match.groups()] + env.Append(MAJOR=str(MAJOR)) +-- +2.29.0.rc1 + diff --git a/srcpkgs/serf/patches/0002-Fix-syntax-of-a-print-in-the-scons-file-to-unbreak-b.patch b/srcpkgs/serf/patches/0002-Fix-syntax-of-a-print-in-the-scons-file-to-unbreak-b.patch new file mode 100644 index 00000000000..cd9b5e3b01a --- /dev/null +++ b/srcpkgs/serf/patches/0002-Fix-syntax-of-a-print-in-the-scons-file-to-unbreak-b.patch @@ -0,0 +1,31 @@ +From 212b70149bc943de7180aa8c18e1f92e1cd76ec7 Mon Sep 17 00:00:00 2001 +From: Bert Huijben +Date: Wed, 4 Oct 2017 14:56:22 +0000 +Subject: [PATCH 2/3] Fix syntax of a print() in the scons file to unbreak + building with most recent scons version. + +* SConstruct + Use Python 3.0 valid syntax to make Scons 3.0.0 happy on both python 3.0 + and 2.7. + +git-svn-id: https://svn.apache.org/repos/asf/serf/trunk@1811083 13f79535-47bb-0310-9956-ffa450edef68 +--- + SConstruct | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git SConstruct SConstruct +index 1766870..a7e18da 100644 +--- SConstruct ++++ SConstruct +@@ -183,7 +183,7 @@ CALLOUT_OKAY = not (env.GetOption('clean') or env.GetOption('help')) + + unknown = opts.UnknownVariables() + if unknown: +- print 'Warning: Used unknown variables:', ', '.join(unknown.keys()) ++ print('Warning: Used unknown variables:', ', '.join(unknown.keys())) + + apr = str(env['APR']) + apu = str(env['APU']) +-- +2.29.0.rc1 + diff --git a/srcpkgs/serf/patches/0003-Make-the-tests-run-with-Python-3.x.patch b/srcpkgs/serf/patches/0003-Make-the-tests-run-with-Python-3.x.patch new file mode 100644 index 00000000000..3f5cc84e51c --- /dev/null +++ b/srcpkgs/serf/patches/0003-Make-the-tests-run-with-Python-3.x.patch @@ -0,0 +1,43 @@ +From a00f7abd15a92ae77806edca6227ed09aae2b711 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Branko=20=C4=8Cibej?= +Date: Sat, 9 Jun 2018 08:10:10 +0000 +Subject: [PATCH 3/3] Make the tests run with Python 3.x. + +* build/check.py: Add parentheses around 'print' statement arguments + so that they work when 'print' is a function. + +git-svn-id: https://svn.apache.org/repos/asf/serf/trunk@1833223 13f79535-47bb-0310-9956-ffa450edef68 +--- + build/check.py | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git build/check.py build/check.py +index 2dacb4c..341bb3b 100755 +--- build/check.py ++++ build/check.py +@@ -52,16 +52,16 @@ if __name__ == '__main__': + + # Find test responses and run them one by one + for case in glob.glob(testdir + "/testcases/*.response"): +- print "== Testing %s ==" % (case) ++ print("== Testing %s ==" % (case)) + try: + subprocess.check_call([SERF_RESPONSE_EXE, case]) +- except subprocess.CalledProcessError: +- print "ERROR: test case %s failed" % (case) ++ except subprocess.CalledProcessError as x: ++ print("ERROR: test failed in '%s', exit code=%d" % (x.cmd, x.returncode)) + sys.exit(1) + +- print "== Running the unit tests ==" ++ print("== Running the unit tests ==") + try: + subprocess.check_call(TEST_ALL_EXE) +- except subprocess.CalledProcessError: +- print "ERROR: test(s) failed in test_all" ++ except subprocess.CalledProcessError as x: ++ print("ERROR: test(s) failed in '%s', exit code=%d" % (x.cmd, x.returncode)) + sys.exit(1) +-- +2.29.0.rc1 + From 6b2e557428988e09fadfa6d0cb2c2b56a28ddf2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Wed, 21 Oct 2020 22:09:51 +0700 Subject: [PATCH 06/11] xboxdrv: convert to Python 3 Cherry-Picked from their stable branch. --- .../0001-Update-SConstruct-to-python3.patch | 79 ++++++ ...0003-Updating-python-code-to-python3.patch | 238 ++++++++++++++++++ srcpkgs/xboxdrv/template | 4 +- 3 files changed, 319 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/xboxdrv/patches/0001-Update-SConstruct-to-python3.patch create mode 100644 srcpkgs/xboxdrv/patches/0003-Updating-python-code-to-python3.patch diff --git a/srcpkgs/xboxdrv/patches/0001-Update-SConstruct-to-python3.patch b/srcpkgs/xboxdrv/patches/0001-Update-SConstruct-to-python3.patch new file mode 100644 index 00000000000..c33e9e1c909 --- /dev/null +++ b/srcpkgs/xboxdrv/patches/0001-Update-SConstruct-to-python3.patch @@ -0,0 +1,79 @@ +From 39a334fbc0482626455f417e97308e52aa8746a7 Mon Sep 17 00:00:00 2001 +From: Ingo Ruhnke +Date: Sun, 24 Nov 2019 18:16:16 +0100 +Subject: [PATCH 1/3] Update SConstruct to python3 + +--- + SConstruct | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git SConstruct SConstruct +index 4cd7970..54fa11f 100644 +--- SConstruct ++++ SConstruct +@@ -15,7 +15,7 @@ def build_dbus_glue(target, source, env): + "--mode=glib-server", + "--prefix=" + env['DBUS_PREFIX'], source[0].get_path()], + stdout=subprocess.PIPE).communicate()[0] +- ++ xml = xml.decode() + xml = re.sub(r"callback = \(([A-Za-z_]+)\) \(marshal_data \? marshal_data : cc->callback\);", + r"union { \1 fn; void* obj; } conv;\n " + "conv.obj = (marshal_data ? marshal_data : cc->callback);\n " +@@ -29,14 +29,14 @@ def build_bin2h(target, source, env): + Takes a list of files and converts them into a C source that can be included + """ + def c_escape(str): +- return str.translate(string.maketrans("/.-", "___")) ++ return str.translate(str.maketrans("/.-", "___")) + +- print target +- print source ++ print(target) ++ print(source) + with open(target[0].get_path(), "w") as fout: + fout.write("// autogenerated by scons Bin2H builder, do not edit by hand!\n\n") + +- if env.has_key("BIN2H_NAMESPACE"): ++ if "BIN2H_NAMESPACE" in env: + fout.write("namespace %s {\n\n" % env["BIN2H_NAMESPACE"]) + + # write down data +@@ -45,8 +45,8 @@ def build_bin2h(target, source, env): + data = fin.read() + fout.write("// \"%s\"\n" % src.get_path()) + fout.write("const char %s[] = {" % c_escape(src.get_path())) +- bytes_arr = ["0x%02x" % ord(c) for c in data] +- for i in xrange(len(bytes_arr)): ++ bytes_arr = ["0x%02x" % c for c in data] ++ for i in range(len(bytes_arr)): + if i % 13 == 0: + fout.write("\n ") + fout.write(bytes_arr[i]) +@@ -62,7 +62,7 @@ def build_bin2h(target, source, env): + for src in source], ",\n")) + fout.write("\n}\n\n") + +- if env.has_key("BIN2H_NAMESPACE"): ++ if "BIN2H_NAMESPACE" in env: + fout.write("} // namespace %s\n\n" % env["BIN2H_NAMESPACE"]) + + fout.write("/* EOF */\n") +@@ -131,12 +131,12 @@ env.Append(CPPDEFINES = { 'PACKAGE_VERSION': "'\"%s\"'" % package_version }) + conf = Configure(env) + + if not conf.env['CXX']: +- print "g++ must be installed!" ++ print("g++ must be installed!") + Exit(1) + + # X11 checks + if not conf.CheckLibWithHeader('X11', 'X11/Xlib.h', 'C++'): +- print 'libx11-dev must be installed!' ++ print('libx11-dev must be installed!') + Exit(1) + + env = conf.Finish() +-- +2.29.0.rc1 + diff --git a/srcpkgs/xboxdrv/patches/0003-Updating-python-code-to-python3.patch b/srcpkgs/xboxdrv/patches/0003-Updating-python-code-to-python3.patch new file mode 100644 index 00000000000..a19f79c7e2b --- /dev/null +++ b/srcpkgs/xboxdrv/patches/0003-Updating-python-code-to-python3.patch @@ -0,0 +1,238 @@ +From e37d3558a1a8a36fbc5d693c53893127a288fd02 Mon Sep 17 00:00:00 2001 +From: Ingo Ruhnke +Date: Sun, 24 Nov 2019 18:36:25 +0100 +Subject: [PATCH 3/3] Updating python code to python3 + +--- + examples/responsecurve-generator.py | 14 ++++----- + runxboxdrv/runxboxdrv | 46 ++++++++++++++--------------- + xboxdrvctl | 8 ++--- + 3 files changed, 34 insertions(+), 34 deletions(-) + +diff --git examples/responsecurve-generator.py examples/responsecurve-generator.py +index c74e34d..942463b 100755 +--- examples/responsecurve-generator.py ++++ examples/responsecurve-generator.py +@@ -1,14 +1,14 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + + import sys + import string + + if len(sys.argv) != 3: +- print "Usage:", sys.argv[0], "STEPS", "EQUATION" +- print "Simple generator for generating responsecurve data from equations." +- print "" +- print "Example:" +- print " ", sys.argv[0], "6 i**2" ++ print("Usage:", sys.argv[0], "STEPS", "EQUATION") ++ print("Simple generator for generating responsecurve data from equations.") ++ print("") ++ print("Example:") ++ print(" ", sys.argv[0], "6 i**2") + else: + steps = int(sys.argv[1]) + equation = sys.argv[2] +@@ -19,6 +19,6 @@ else: + left.reverse() + left = left[0:-1] + +- print string.join([str(x) for x in (left + right)], ":") ++ print(string.join([str(x) for x in (left + right)], ":")) + + # EOF # +diff --git runxboxdrv/runxboxdrv runxboxdrv/runxboxdrv +index 360c836..6983496 100755 +--- runxboxdrv/runxboxdrv ++++ runxboxdrv/runxboxdrv +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # This program is free software: you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation, either version 3 of the License, or +@@ -409,7 +409,7 @@ class ProcessManager(object): + """ + # Since reap() modifies __procs, we have to iterate over a copy + # of the keys in it. Thus, do not remove the .keys() call. +- for procid in self.__procs.keys(): ++ for procid in list(self.__procs.keys()): + self.reap(procid) + + +@@ -445,7 +445,7 @@ import os, sys + import os.path + import fcntl + import time +-import ConfigParser ++import configparser + from subprocess import check_call, Popen, PIPE + from signal import SIGINT, SIGKILL + from optparse import OptionParser +@@ -482,7 +482,7 @@ class RunXBoxDrv(object): + + @staticmethod + def runCommandAndGetOutput(command): +- print command ++ print(command) + callcommand = Popen(command, shell=True, stdout=PIPE) + outputcommand = callcommand.communicate() + return outputcommand[0].split("\n") +@@ -517,7 +517,7 @@ class RunXBoxDrv(object): + if RunXBoxDrv.which(RunXBoxDrv.sudo_command) is None: + raise Exception("Cannot find %s!" % RunXBoxDrv.sudo_command) + commandline = "%s %s" % (RunXBoxDrv.sudo_command, command) +- print commandline ++ print(commandline) + callcommand = Popen(commandline, shell=True, stdout=PIPE) + outputcommand = callcommand.communicate() + return outputcommand[0] +@@ -525,14 +525,14 @@ class RunXBoxDrv(object): + @staticmethod + def killExistingXBoxDrv(sig, signame): + for line in RunXBoxDrv.runCommandAndGetOutput("ps"): +- print line ++ print(line) + fields = line.split() + if len(fields) < 4: + continue + pid = fields[0] + process = fields[3] + if process.find(XBOXDRVNAME) != -1: +- print "Using %s on existing %s" % (signame, XBOXDRVNAME) ++ print("Using %s on existing %s" % (signame, XBOXDRVNAME)) + os.kill(int(pid), sig) + return True + return False +@@ -542,7 +542,7 @@ class RunXBoxDrv(object): + loadedmodules = [] + unloadedmodules = [] + for line in RunXBoxDrv.runCommandAndGetOutput("lsmod"): +- print line ++ print(line) + fields = line.split() + if len(fields) < 3: + continue +@@ -555,17 +555,17 @@ class RunXBoxDrv(object): + unloadedmodules.append(modulename) + for modulename in MODULELOAD: + if modulename in loadedmodules: +- print "%s already loaded!" % modulename ++ print("%s already loaded!" % modulename) + else: +- print "Loading %s!" % modulename +- print RunXBoxDrv.runCommandAsRoot("modprobe %s" % modulename) ++ print("Loading %s!" % modulename) ++ print(RunXBoxDrv.runCommandAsRoot("modprobe %s" % modulename)) + + for modulename in MODULEUNLOAD: + if modulename in unloadedmodules: +- print "Unloading %s!" % modulename +- print RunXBoxDrv.runCommandAsRoot("rmmod %s" % modulename) ++ print("Unloading %s!" % modulename) ++ print(RunXBoxDrv.runCommandAsRoot("rmmod %s" % modulename)) + else: +- print "%s already unloaded!" % modulename ++ print("%s already unloaded!" % modulename) + + + @staticmethod +@@ -579,11 +579,11 @@ class RunXBoxDrv(object): + raise Exception("Cannot find one of: %s!" % str(UINPUT_LOCATIONS)) + + if not os.access(location, os.W_OK): +- print "Trying to change permissions of: %s" % location +- print RunXBoxDrv.runCommandAsRoot("chmod 0660 %s" % location) ++ print("Trying to change permissions of: %s" % location) ++ print(RunXBoxDrv.runCommandAsRoot("chmod 0660 %s" % location)) + + if os.access(location, os.W_OK): +- print "%s is writable!" % location ++ print("%s is writable!" % location) + else: + raise Exception("Could not set write permissions on %s" % location) + +@@ -614,36 +614,36 @@ class RunXBoxDrv(object): + out = "" + while out.lower().find(LOADEDTEXT) == -1: + out = RunXBoxDrv.getNext(myProc) +- print out ++ print(out) + + def process(self): + commandlist = [self.xboxdrvpath] + + if self.configfile: + commandlist = commandlist + ["--config=%s" % self.configfile] +- print commandlist ++ print(commandlist) + myProc = Process(commandlist) + with_timeout(1, self.checkLoaded, myProc) + if len(self.appandparams) == 0: + print("WARNING: No path to application specified!") + else: +- print(self.appandparams) ++ print((self.appandparams)) + check_call(self.appandparams) +- print "Sending SIGINT" ++ print("Sending SIGINT") + myProc.kill(SIGINT) + try: + with_timeout(1, myProc.wait) + sys.exit(0) + except Timeout: + pass +- print "Sending SIGINT again" ++ print("Sending SIGINT again") + myProc.kill(SIGINT) + try: + with_timeout(1, myProc.wait) + sys.exit(0) + except Timeout: + pass +- print "Killing" ++ print("Killing") + myProc.terminate() + + def main(): +diff --git xboxdrvctl xboxdrvctl +index 4807a11..57177dc 100755 +--- xboxdrvctl ++++ xboxdrvctl +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python2 ++#!/usr/bin/env python3 + + ## Xbox360 USB Gamepad Userspace Driver + ## Copyright (C) 2011 Ingo Ruhnke +@@ -71,7 +71,7 @@ elif options.bus == "auto": + except dbus.exceptions.DBusException: + bus = dbus.SystemBus() + else: +- print "Error: invalid argument to --bus. Must be 'auto', 'session, or 'system'" ++ print("Error: invalid argument to --bus. Must be 'auto', 'session, or 'system'") + exit() + + if options.status: +@@ -82,7 +82,7 @@ elif options.shutdown: + daemon.Shutdown() + else: + if (options.led or options.rumble or options.config) and options.slot == None: +- print "Error: --slot argument required" ++ print("Error: --slot argument required") + exit() + else: + if options.slot != None: +@@ -94,7 +94,7 @@ else: + if options.rumble: + m = re.match('^(\d+):(\d+)$', options.rumble) + if not m: +- print "Error: invalid argument to --rumble" ++ print("Error: invalid argument to --rumble") + exit() + else: + left = int(m.group(1)) +-- +2.29.0.rc1 + diff --git a/srcpkgs/xboxdrv/template b/srcpkgs/xboxdrv/template index ab4ec0f9b5d..2b4905d8890 100644 --- a/srcpkgs/xboxdrv/template +++ b/srcpkgs/xboxdrv/template @@ -1,7 +1,7 @@ # Template file for 'xboxdrv' pkgname=xboxdrv version=0.8.8 -revision=2 +revision=3 wrksrc="xboxdrv-linux-${version}" build_style=scons hostmakedepends="pkg-config glib-devel dbus-glib-devel" @@ -12,7 +12,7 @@ license="GPL-3.0-or-later" homepage="https://xboxdrv.gitlab.io/" distfiles="https://xboxdrv.gitlab.io/xboxdrv-linux-${version}.tar.bz2" checksum=f4fb8c09c0ce3841798f129ae4c2caf3f6db9786d78ad941994e425e3ffc168a -python_version=2 #unverified +python_version=3 do_install() { make PREFIX=/usr DESTDIR=${DESTDIR} install From 642f535a982282988018b9a780853bfce742778e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Wed, 21 Oct 2020 22:17:23 +0700 Subject: [PATCH 07/11] gpsd: build with Python 3 --- srcpkgs/gpsd/template | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/srcpkgs/gpsd/template b/srcpkgs/gpsd/template index a5f3628ea42..b4a1d8d5f6e 100644 --- a/srcpkgs/gpsd/template +++ b/srcpkgs/gpsd/template @@ -1,13 +1,13 @@ # Template file for 'gpsd' pkgname=gpsd version=3.20 -revision=1 +revision=2 build_style=scons make_build_args="dbus_export=0 gpsd_user=gpsd gpsd_group=gpsd sbindir=/usr/bin udevdir=/usr/lib/udev CC=${CC} qt_versioned=5" make_install_args="$make_build_args" make_install_target=udev-install -hostmakedepends="pkg-config bc python-pyserial libxslt xmlto asciidoc ncurses" +hostmakedepends="pkg-config bc python3-pyserial libxslt xmlto asciidoc ncurses" makedepends="eudev-libudev-devel ntp libusb-devel ncurses-devel gtk+3-devel pps-tools-devel libcap-devel libbluetooth-devel qt5-devel" short_desc="GPS/AIS receiver monitoring daemon" @@ -16,13 +16,13 @@ license="BSD-3-Clause" homepage="http://www.catb.org/gpsd/" distfiles="http://download-mirror.savannah.gnu.org/releases/gpsd/gpsd-${version}.tar.xz" checksum=3998a5cbb728e97f896f46c3c83301b1e6c5d859393e58c2fad8c5426774d571 -python_version=2 # Must be same version as scons +python_version=3 # Must be same version as scons system_accounts="gpsd" subpackages="gpsd-devel gpsd-qt gpsd-qt-devel" if [ -z "$CROSS_BUILD" ]; then subpackages+=" gpsd-python gpsd-xgps" - makedepends+=" python-devel python-gobject-devel" + makedepends+=" python3-devel python3-gobject-devel" else # xxx scons uses its environment to build python stuff; so arch # and python version must match. This should be fixed. @@ -51,7 +51,7 @@ post_install() { gpsd-python_package() { short_desc+=" - Python tools/bindings" - depends="python python-pyserial gnuplot ${sourcepkg}>=${version}_${revision}" + depends="python3 python3-pyserial gnuplot ${sourcepkg}>=${version}_${revision}" pkg_install() { vmove "usr/lib/python*" vmove usr/bin/gegps @@ -71,7 +71,7 @@ gpsd-python_package() { gpsd-xgps_package() { short_desc+=" - PyGI based clients" - depends="${sourcepkg}-python>=${version}_${revision} gtk+3 python-gobject" + depends="${sourcepkg}-python>=${version}_${revision} gtk+3 python3-gobject" pkg_install() { vmove usr/bin/xgps vmove usr/bin/xgpsspeed From 166f1834a735007cd57658ed7f8bb36753b7fef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Wed, 21 Oct 2020 22:42:51 +0700 Subject: [PATCH 08/11] pingus: build with scons Python 3 --- .../patches/scons-use-python3-print.patch | 26 +++++++++++++++++++ srcpkgs/pingus/template | 4 +-- 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/pingus/patches/scons-use-python3-print.patch diff --git a/srcpkgs/pingus/patches/scons-use-python3-print.patch b/srcpkgs/pingus/patches/scons-use-python3-print.patch new file mode 100644 index 00000000000..ab3daa0e201 --- /dev/null +++ b/srcpkgs/pingus/patches/scons-use-python3-print.patch @@ -0,0 +1,26 @@ +Description: Use python3 print() +Author: Phil Wyett +Last-Update: 2019-12-29 +Bug-Debian: https://bugs.debian.org/947574 + +Index: pingus/SConscript +=================================================================== +--- SConscript ++++ SConscript +@@ -126,12 +126,12 @@ class Project: + def configure_end(self): + self.env = self.conf.Finish() + +- print "Reports:" +- print self.reports ++ print ("Reports:") ++ print (self.reports) + + if not self.fatal_error == "": +- print "Fatal Errors:" +- print self.fatal_error ++ print ("Fatal Errors:") ++ print (self.fatal_error) + Exit(1) + + def configure_gxx(self): diff --git a/srcpkgs/pingus/template b/srcpkgs/pingus/template index 5551b01171f..8e126cf7466 100644 --- a/srcpkgs/pingus/template +++ b/srcpkgs/pingus/template @@ -1,7 +1,7 @@ # Template file for 'pingus' pkgname=pingus version=0.7.6 -revision=13 +revision=14 wrksrc="pingus-v${version}" build_style=scons hostmakedepends="pkg-config" @@ -29,7 +29,7 @@ do_install() { pingus-data_package() { short_desc+=" - data files" - archs=noarch + nostrip=yes pkg_install() { vmove usr/share/pingus } From b4451e69932fb859c4439a059a568847b8930a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Wed, 21 Oct 2020 23:00:48 +0700 Subject: [PATCH 09/11] swiften: use vendored scons --- srcpkgs/swiften/template | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/srcpkgs/swiften/template b/srcpkgs/swiften/template index 0db980396ee..6a32afa6e0c 100644 --- a/srcpkgs/swiften/template +++ b/srcpkgs/swiften/template @@ -1,9 +1,9 @@ # Template file for 'swiften' pkgname=swiften version=3.0 -revision=14 +revision=15 wrksrc="swift-${version}" -build_style=scons +hostmakedepends="python" makedepends="boost-devel libressl-devel libxml2-devel libidn-devel" short_desc="XMPP library for C++" maintainer="John Regan " @@ -31,7 +31,7 @@ do_build() { -e "s;BOOST_ATOMIC_SIGNAL_FENCE > 0;0;" ;; esac - scons \ + ./scons \ cc="${CC}" \ cxx="${CXX}" \ linkflags="${LDFLAGS}" \ @@ -41,7 +41,7 @@ do_build() { } do_install() { - scons \ + ./scons \ cc="${CC}" \ cxx="${CXX}" \ linkflags="${LDFLAGS}" \ From 64a95cae6cda762d1d266519ad8260e82abecd35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Thu, 22 Oct 2020 22:31:27 +0700 Subject: [PATCH 10/11] The-Powder-Toy: update to 95.0. --- srcpkgs/The-Powder-Toy/template | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/srcpkgs/The-Powder-Toy/template b/srcpkgs/The-Powder-Toy/template index 778c0f8f211..889c42724fb 100644 --- a/srcpkgs/The-Powder-Toy/template +++ b/srcpkgs/The-Powder-Toy/template @@ -1,16 +1,17 @@ # Template file for 'The-Powder-Toy' pkgname=The-Powder-Toy -version=94.1 +version=95.0 revision=1 build_style=scons make_build_args="--output=powder" -makedepends="SDL2-devel lua51-devel fftw-devel bzip2-devel zlib-devel" +makedepends="SDL2-devel lua51-devel fftw-devel bzip2-devel zlib-devel + libcurl-devel" short_desc="Falling sand physics sandbox, simulates air pressure, velocity & heat" maintainer="Illia Shestakov " license="GPL-3.0-or-later" homepage="https://powdertoy.co.uk/" distfiles="https://github.com/The-Powder-Toy/${pkgname}/archive/v${version}.tar.gz" -checksum=9770c0732c97e4e89a1e53330c969e9675595f78e6673c519c3724d6df591e72 +checksum=f60c3dc93e4ceddeda92b768e75a2d218f8df3da4a569b7d7cb57fff5515e15b CPPDEFINES=IGNORE_UPDATES case "$XBPS_TARGET_MACHINE" From a9fb61301948d684bce6baacd2a60e150bbd6cf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Thu, 22 Oct 2020 22:50:34 +0700 Subject: [PATCH 11/11] gpick: build with new scons Also build with -O2 -g --Wl,--as-needed --- srcpkgs/gpick/patches/scons-python3.patch | 145 ++++++++++++++++++++++ srcpkgs/gpick/template | 4 +- 2 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/gpick/patches/scons-python3.patch diff --git a/srcpkgs/gpick/patches/scons-python3.patch b/srcpkgs/gpick/patches/scons-python3.patch new file mode 100644 index 00000000000..a257e73def8 --- /dev/null +++ b/srcpkgs/gpick/patches/scons-python3.patch @@ -0,0 +1,145 @@ +diff --git SConscript SConscript +index 43f9857..6065023 100644 +--- SConscript ++++ SConscript +@@ -48,7 +48,7 @@ env.AddCustomBuilders() + env.GetVersionInfo() + + try: +- umask = os.umask(022) ++ umask = os.umask(0o22) + except OSError: # ignore on systems that don't support umask + pass + +@@ -81,56 +81,20 @@ if not env.GetOption('clean'): + + env = conf.Finish() + +-if os.environ.has_key('CC'): ++if 'CC' in os.environ: + env['CC'] = os.environ['CC'] +-if os.environ.has_key('CFLAGS'): ++ ++if 'CFLAGS' in os.environ: + env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS']) +-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']) + + Decider('MD5-timestamp') + +-if not env['TOOLCHAIN'] == 'msvc': +- if not (os.environ.has_key('CFLAGS') or os.environ.has_key('CXXFLAGS') or os.environ.has_key('LDFLAGS')): +- if env['DEBUG']: +- env.Append( +- CPPFLAGS = ['-Wall', '-g3', '-O0'], +- CFLAGS = ['-Wall', '-g3', '-O0'], +- LINKFLAGS = ['-Wl,-as-needed'], +- ) +- else: +- env.Append( +- CPPDEFINES = ['NDEBUG'], +- CDEFINES = ['NDEBUG'], +- CPPFLAGS = ['-Wall', '-O3'], +- CFLAGS = ['-Wall', '-O3'], +- LINKFLAGS = ['-Wl,-as-needed', '-s'], +- ) +- +- if env['BUILD_TARGET'] == 'win32': +- env.Append( +- LINKFLAGS = ['-Wl,--enable-auto-import', '-static-libgcc', '-static-libstdc++'], +- CPPDEFINES = ['_WIN32_WINNT=0x0501'], +- ) +-else: +- env['LINKCOM'] = [env['LINKCOM'], 'mt.exe -nologo -manifest ${TARGET}.manifest -outputresource:$TARGET;1'] +- if env['DEBUG']: +- env.Append( +- CPPFLAGS = ['/Od', '/EHsc', '/MD', '/Gy', '/Zi', '/TP', '/wd4819'], +- CPPDEFINES = ['WIN32', '_DEBUG'], +- LINKFLAGS = ['/MANIFEST', '/DEBUG'], +- ) +- else: +- env.Append( +- CPPFLAGS = ['/O2', '/Oi', '/GL', '/EHsc', '/MD', '/Gy', '/Zi', '/TP', '/wd4819'], +- CPPDEFINES = ['WIN32', 'NDEBUG'], +- LINKFLAGS = ['/MANIFEST', '/LTCG'], +- ) +- + extern_libs = SConscript(['extern/SConscript'], exports='env') + executable, parser_files = SConscript(['source/SConscript'], exports='env') + +diff --git source/SConscript source/SConscript +index b78bfb5..ca42710 100644 +--- source/SConscript ++++ source/SConscript +@@ -50,6 +50,8 @@ if local_env['BUILD_TARGET'] == 'win32': + elif local_env['BUILD_TARGET'] == 'linux2': + local_env.Append(LIBS=['rt', 'expat']) + ++local_env.Append(LIBS=['expat']) ++ + executable = local_env.Program( + 'gpick', + source = [sources, objects]) +diff --git tools/gpick.py tools/gpick.py +index 29000a6..5aecfe8 100644 +--- tools/gpick.py ++++ tools/gpick.py +@@ -9,10 +9,10 @@ import sys + import glob + import subprocess + +-from lemon import * +-from flex import * +-from gettext import * +-from resource_template import * ++from .lemon import * ++from .flex import * ++from .gettext import * ++from .resource_template import * + + from SCons.Script import * + from SCons.Util import * +@@ -79,9 +79,9 @@ class GpickEnvironment(SConsEnvironment): + def ConfirmPrograms(self, conf, programs): + conf.AddTests({'CheckProgram': CheckProgram}) + +- for evar, args in programs.iteritems(): ++ for evar, args in programs.items(): + found = False +- for name, member_name in args['checks'].iteritems(): ++ for name, member_name in args['checks'].items(): + if conf.CheckProgram(self, name, member_name): + found = True; + break +@@ -95,9 +95,9 @@ class GpickEnvironment(SConsEnvironment): + def ConfirmLibs(self, conf, libs): + conf.AddTests({'CheckPKG': CheckPKG}) + +- for evar, args in libs.iteritems(): ++ for evar, args in libs.items(): + found = False +- for name, version in args['checks'].iteritems(): ++ for name, version in args['checks'].items(): + if conf.CheckPKG(name + ' ' + version): + self[evar]=name + found = True; +@@ -127,9 +127,9 @@ class GpickEnvironment(SConsEnvironment): + self.AddPostAction(i, Chmod(i, perm)) + return dir + +- InstallProgram = lambda self, dir, source: GpickEnvironment.InstallPerm(self, dir, source, 0755) +- InstallData = lambda self, dir, source: GpickEnvironment.InstallPerm(self, dir, source, 0644) +- InstallDataAutoDir = lambda self, dir, relative_dir, source: GpickEnvironment.InstallPermAutoDir(self, dir, relative_dir, source, 0644) ++ InstallProgram = lambda self, dir, source: GpickEnvironment.InstallPerm(self, dir, source, 0o755) ++ InstallData = lambda self, dir, source: GpickEnvironment.InstallPerm(self, dir, source, 0o644) ++ InstallDataAutoDir = lambda self, dir, relative_dir, source: GpickEnvironment.InstallPermAutoDir(self, dir, relative_dir, source, 0o644) + + def GetSourceFiles(self, dir_exclude_pattern, file_exclude_pattern): + dir_exclude_prog = re.compile(dir_exclude_pattern) diff --git a/srcpkgs/gpick/template b/srcpkgs/gpick/template index 402f95fd196..5a538a068f2 100644 --- a/srcpkgs/gpick/template +++ b/srcpkgs/gpick/template @@ -1,11 +1,11 @@ # Template file for 'gpick' pkgname=gpick version=0.2.5 -revision=4 +revision=5 wrksrc="${pkgname}-${pkgname}-${version}" build_style=scons hostmakedepends="gettext pkg-config" -makedepends="boost-devel gtk+-devel lua52-devel" +makedepends="boost-devel gtk+-devel lua52-devel expat-devel" short_desc="Advanced color picker written in C++ using GTK+ toolkit" maintainer="Alexander Mamay " license="BSD-3-Clause"