summaryrefslogtreecommitdiffstats
path: root/http
diff options
context:
space:
mode:
authorThomas Orgis2021-08-20 00:58:23 +0200
committerThomas Orgis2021-08-20 00:58:23 +0200
commit5a2a160a232f76a96eaaceab9475e478a9f14891 (patch)
tree2aa9fca00e3b57fbe92bc652e05937a1bc0e8f93 /http
parent0a42d69010c64e3d943e237ab5d84e23c26a3bf3 (diff)
serf: fix build with python3
Diffstat (limited to 'http')
-rw-r--r--http/serf/HISTORY3
-rw-r--r--http/serf/patches/0003-py3.patch83
2 files changed, 86 insertions, 0 deletions
diff --git a/http/serf/HISTORY b/http/serf/HISTORY
index 8b30e6dea4..acd6c655f5 100644
--- a/http/serf/HISTORY
+++ b/http/serf/HISTORY
@@ -1,3 +1,6 @@
+2021-08-20 Thomas Orgis
+ * patches/0003-py3.patch: import pyton3 build fix from Debian
+
2021-03-14 Ismael Luceno <ismael@sourcemage.org>
* PRE_BUILD: switched to apply_patch_dir
* badprint.patch: removed, replaced
diff --git a/http/serf/patches/0003-py3.patch b/http/serf/patches/0003-py3.patch
new file mode 100644
index 0000000000..88fa200270
--- /dev/null
+++ b/http/serf/patches/0003-py3.patch
@@ -0,0 +1,83 @@
+diff --git i/SConstruct w/SConstruct
+index 4358a23..7f3cc94 100644
+--- i/SConstruct
++++ w/SConstruct
+@@ -20,6 +20,8 @@
+ # ====================================================================
+ #
+
++from __future__ import print_function
++
+ import sys
+ import os
+ import re
+@@ -163,9 +165,9 @@ env.Append(BUILDERS = {
+ suffix='.def', src_suffix='.h')
+ })
+
+-match = re.search('SERF_MAJOR_VERSION ([0-9]+).*'
+- 'SERF_MINOR_VERSION ([0-9]+).*'
+- 'SERF_PATCH_VERSION ([0-9]+)',
++match = re.search(b'SERF_MAJOR_VERSION ([0-9]+).*'
++ b'SERF_MINOR_VERSION ([0-9]+).*'
++ b'SERF_PATCH_VERSION ([0-9]+)',
+ env.File('serf.h').get_contents(),
+ re.DOTALL)
+ MAJOR, MINOR, PATCH = [int(x) for x in match.groups()]
+diff --git i/build/check.py w/build/check.py
+index 2dacb4c..76945af 100755
+--- i/build/check.py
++++ w/build/check.py
+@@ -22,6 +22,8 @@
+ # ===================================================================
+ #
+
++from __future__ import print_function
++
+ import sys
+ import glob
+ import subprocess
+@@ -52,16 +54,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)
++ print("ERROR: test case %s failed" % (case))
+ 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"
++ print("ERROR: test(s) failed in test_all")
+ sys.exit(1)
+diff --git i/build/gen_def.py w/build/gen_def.py
+index a2222d0..1e006ee 100755
+--- i/build/gen_def.py
++++ w/build/gen_def.py
+@@ -52,12 +52,13 @@ _types = re.compile(r'^extern const serf_bucket_type_t (serf_[a-z_]*);',
+
+
+ def extract_exports(fname):
+- content = open(fname).read()
+ exports = [ ]
+- for name in _funcs.findall(content):
+- exports.append(name)
+- for name in _types.findall(content):
+- exports.append(name)
++ with open(fname) as fd:
++ content = fd.read()
++ for name in _funcs.findall(content):
++ exports.append(name)
++ for name in _types.findall(content):
++ exports.append(name)
+ return exports
+
+ # Blacklist the serf v2 API for now