From df444b7ea0aefebe5c7c0adb4279371de288753f 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] 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 +