Skip to content

Commit

Permalink
package/norm: fix build issue with waf >= 2.1.0
Browse files Browse the repository at this point in the history
To fix build issues with modern Python versions, commit
8012a86 ("package/norm: use external
waf") switched the norm package from using its internal waf copy to
using our external waf package.

Then, in fd56231 ("package/waf: bump
to v2.1.1"), we updated out external waf to a newer version, which
breaks the API around ArgParse, see upstream commit:

  https://gitlab.com/ita1024/waf/-/commit/bd5c22d484734f7c1b77e16c91a10c7a44fa6c8a:

This causes breakage when building the norm package. Fabrice had
already submitted patches upstream, to both the "protolib"
project (which is used as a submodule in norm) and to the "norm"
project. These pull requests are still pending, but let's backport the
patches that seem reasonable and that fix the build issue.

Fixes:

  http://autobuild.buildroot.net/results/f005d513434d42d26e601096b94b4070586118b2/

Signed-off-by: Thomas Petazzoni <[email protected]>
Signed-off-by: Peter Korsgaard <[email protected]>
  • Loading branch information
tpetazzoni authored and jacmet committed Aug 26, 2024
1 parent 2383768 commit cf647b6
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
53 changes: 53 additions & 0 deletions package/norm/0004-protolib-wscript-fix-build-with-waf-2.1.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
From c35a9dc031cda1406eff7de1f199ad55949b17c6 Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <[email protected]>
Date: Sat, 24 Aug 2024 21:28:16 +0200
Subject: [PATCH] protolib/wscript: fix build with waf >= 2.1.0

Replace add_option_group by add_argument_group and add_option by
add_argument to avoid the following build failure with waf 2.1.0 and
https://gitlab.com/ita1024/waf/-/commit/bd5c22d484734f7c1b77e16c91a10c7a44fa6c8a:

File "/home/autobuild/autobuild/instance-21/output-1/build/norm-1.5.8/protolib/wscript", line 37, in options
bind_opts = ctx.parser.add_option_group('Language Bindings', 'Use during configure step.')
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Signed-off-by: Fabrice Fontaine <[email protected]>
Upstream: https://github.com/USNavalResearchLaboratory/protolib/pull/47
Signed-off-by: Thomas Petazzoni <[email protected]>
---
protolib/wscript | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/protolib/wscript b/protolib/wscript
index 97dda93..97f65f6 100644
--- a/protolib/wscript
+++ b/protolib/wscript
@@ -34,18 +34,18 @@ def options(ctx):
ctx.load('python')
ctx.load('java')

- bind_opts = ctx.parser.add_option_group('Language Bindings', 'Use during configure step.')
- bind_opts.add_option('--build-python', action='store_true',
+ bind_opts = ctx.parser.add_argument_group('Language Bindings', 'Use during configure step.')
+ bind_opts.add_argument('--build-python', action='store_true',
help='Build Python bindings [default:false]')
- bind_opts.add_option('--build-java', action='store_true',
+ bind_opts.add_argument('--build-java', action='store_true',
help='Build Java bindings [default:false]')

- build_opts = ctx.parser.add_option_group('Compile Options', 'Use during build step.')
- build_opts.add_option('--debug', action='store_true',
+ build_opts = ctx.parser.add_argument_group('Compile Options', 'Use during build step.')
+ build_opts.add_argument('--debug', action='store_true',
help='Build in debug mode [default:release]')
- build_opts.add_option('--enable-wx', action='store_true',
+ build_opts.add_argument('--enable-wx', action='store_true',
help='Enable checking for wxWidgets.')
- build_opts.add_option('--enable-static-library', action='store_true',
+ build_opts.add_argument('--enable-static-library', action='store_true',
help='Enable installing static library. [default:false]')

def configure(ctx):
--
2.46.0

35 changes: 35 additions & 0 deletions package/norm/0005-wscript-fix-build-with-waf-2.1.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
From 9f7a9b72ff5a7313793bba86962f9677970c9b4c Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <[email protected]>
Date: Sat, 27 Jul 2024 20:41:45 +0200
Subject: [PATCH] wscript: fix build with waf >= 2.1.0

Replace add_option_group by add_argument_group to a build failure with
waf 2.1.0 and
https://gitlab.com/ita1024/waf/-/commit/bd5c22d484734f7c1b77e16c91a10c7a44fa6c8a:

Signed-off-by: Fabrice Fontaine <[email protected]>
Upstream: https://github.com/USNavalResearchLaboratory/norm/pull/86
[Thomas: small change needed to backport on version 1.5.8]
Signed-off-by: Thomas Petazzoni <[email protected]>
---
wscript | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/wscript b/wscript
index 0fdae96..6a8c22a 100644
--- a/wscript
+++ b/wscript
@@ -47,8 +47,8 @@ system = platform.system().lower()

def options(ctx):
ctx.recurse('protolib')
- build_opts = ctx.parser.add_option_group('Compile/install Options', 'Use during build/install step.')
- build_opts.add_option('--enable-static-library', action='store_true',
+ build_opts = ctx.parser.add_argument_group('Compile/install Options', 'Use during build/install step.')
+ build_opts.add_argument('--enable-static-library', action='store_true',
help='Enable building and installing static library. [default:false]')


--
2.46.0

0 comments on commit cf647b6

Please sign in to comment.