From 79f2f50f164248e382e0c192fd41ab04d255096b Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 3 Sep 2018 11:16:19 -0700 Subject: serf: Fix Sconstruct build with python 3.7 These patches will be needed to build serf on hosts with python 3.7+ Signed-off-by: Khem Raj --- ...of-a-print-in-the-scons-file-to-unbreak-b.patch | 29 ++++++++++++++++++++++ ...truct-Fix-path-quoting-for-.def-generator.patch | 27 ++++++++++++++++++++ meta/recipes-support/serf/serf/0003-gen_def.patch | 22 ++++++++++++++++ ...o-r1811083-fix-building-with-scons-3.0.0-.patch | 29 ++++++++++++++++++++++ meta/recipes-support/serf/serf_1.3.9.bb | 7 +++++- 5 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-support/serf/serf/0001-Fix-syntax-of-a-print-in-the-scons-file-to-unbreak-b.patch create mode 100644 meta/recipes-support/serf/serf/0002-SConstruct-Fix-path-quoting-for-.def-generator.patch create mode 100644 meta/recipes-support/serf/serf/0003-gen_def.patch create mode 100644 meta/recipes-support/serf/serf/0004-Follow-up-to-r1811083-fix-building-with-scons-3.0.0-.patch diff --git a/meta/recipes-support/serf/serf/0001-Fix-syntax-of-a-print-in-the-scons-file-to-unbreak-b.patch b/meta/recipes-support/serf/serf/0001-Fix-syntax-of-a-print-in-the-scons-file-to-unbreak-b.patch new file mode 100644 index 0000000000..4a5832ac1a --- /dev/null +++ b/meta/recipes-support/serf/serf/0001-Fix-syntax-of-a-print-in-the-scons-file-to-unbreak-b.patch @@ -0,0 +1,29 @@ +From 99f6e1b0d68281b63218d6adfe68cd9e331ac5be Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 3 Sep 2018 10:50:08 -0700 +Subject: [PATCH] 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. + +Upstream-Status: Backport +[https://svn.apache.org/viewvc/serf/trunk/SConstruct?r1=1809132&r2=1811083&diff_format=h] +Signed-off-by: Khem Raj +--- + SConstruct | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/SConstruct b/SConstruct +index 1670459..18a45fa 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -184,7 +184,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']) diff --git a/meta/recipes-support/serf/serf/0002-SConstruct-Fix-path-quoting-for-.def-generator.patch b/meta/recipes-support/serf/serf/0002-SConstruct-Fix-path-quoting-for-.def-generator.patch new file mode 100644 index 0000000000..cec881ee1c --- /dev/null +++ b/meta/recipes-support/serf/serf/0002-SConstruct-Fix-path-quoting-for-.def-generator.patch @@ -0,0 +1,27 @@ +From e51b4b37916dd20b13133cb7af16601b6bf3ace9 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 3 Sep 2018 10:54:54 -0700 +Subject: [PATCH] SConstruct: Fix path quoting for .def generator + +Patch by: Martin Keller +Upstream-Status: Backport +[https://svn.apache.org/viewvc/serf/trunk/SConstruct?r1=1807594&r2=1809132] + +Signed-off-by: Khem Raj +--- + SConstruct | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/SConstruct b/SConstruct +index 18a45fa..571bdce 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -160,7 +160,7 @@ env = Environment(variables=opts, + + env.Append(BUILDERS = { + 'GenDef' : +- Builder(action = sys.executable + ' build/gen_def.py $SOURCES > $TARGET', ++ Builder(action = '"%s" "%s" $SOURCES > $TARGET' % (sys.executable, gen_def_script,), + suffix='.def', src_suffix='.h') + }) + diff --git a/meta/recipes-support/serf/serf/0003-gen_def.patch b/meta/recipes-support/serf/serf/0003-gen_def.patch new file mode 100644 index 0000000000..e37e9034b0 --- /dev/null +++ b/meta/recipes-support/serf/serf/0003-gen_def.patch @@ -0,0 +1,22 @@ +From 98e793d9f2250e7c1f9f1eb5dfd616a6a8829e9a Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 3 Sep 2018 11:12:27 -0700 +Subject: [PATCH] gen_def + +--- + SConstruct | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/SConstruct b/SConstruct +index 571bdce..877731e 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -158,6 +158,8 @@ env = Environment(variables=opts, + ENV = os.environ, + ) + ++gen_def_script = env.File('build/gen_def.py').rstr() ++ + env.Append(BUILDERS = { + 'GenDef' : + Builder(action = '"%s" "%s" $SOURCES > $TARGET' % (sys.executable, gen_def_script,), diff --git a/meta/recipes-support/serf/serf/0004-Follow-up-to-r1811083-fix-building-with-scons-3.0.0-.patch b/meta/recipes-support/serf/serf/0004-Follow-up-to-r1811083-fix-building-with-scons-3.0.0-.patch new file mode 100644 index 0000000000..02fa9e3a06 --- /dev/null +++ b/meta/recipes-support/serf/serf/0004-Follow-up-to-r1811083-fix-building-with-scons-3.0.0-.patch @@ -0,0 +1,29 @@ +From 565211fd082ef653ca9c44a345350fc1451f5a0f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 3 Sep 2018 11:12:38 -0700 +Subject: [PATCH] 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 + +Upstream-Status: Backport +[https://svn.apache.org/viewvc/serf/trunk/SConstruct?r1=1811088&r2=1814604] +Signed-off-by: Khem Raj +--- + SConstruct | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/SConstruct b/SConstruct +index 877731e..7678bb1 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -169,7 +169,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)) diff --git a/meta/recipes-support/serf/serf_1.3.9.bb b/meta/recipes-support/serf/serf_1.3.9.bb index 2be5a069c4..65a8114bb4 100644 --- a/meta/recipes-support/serf/serf_1.3.9.bb +++ b/meta/recipes-support/serf/serf_1.3.9.bb @@ -1,7 +1,12 @@ SUMMARY = "High-Performance Asynchronous HTTP Client Library" SRC_URI = "${APACHE_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \ file://norpath.patch \ - file://env.patch" + file://env.patch \ + file://0001-Fix-syntax-of-a-print-in-the-scons-file-to-unbreak-b.patch \ + file://0002-SConstruct-Fix-path-quoting-for-.def-generator.patch \ + file://0003-gen_def.patch \ + file://0004-Follow-up-to-r1811083-fix-building-with-scons-3.0.0-.patch \ + " SRC_URI[md5sum] = "370a6340ff20366ab088012cd13f2b57" SRC_URI[sha256sum] = "549c2d21c577a8a9c0450facb5cca809f26591f048e466552240947bdf7a87cc" -- cgit 1.2.3-korg