qt5jsbackend-dont-import-bz2-python-module.patch 951 B

1234567891011121314151617181920212223242526272829
  1. Only import bz2 python module when needed
  2. The js2c.py script imports the bz2 module unconditionnally, which
  3. would require us to build the bzip2 support in host-python. Since in
  4. fact bzip2 support is not technically used when building this package,
  5. we ensure that the bz2 module is only imported when needed.
  6. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  7. Index: b/src/3rdparty/v8/tools/js2c.py
  8. ===================================================================
  9. --- a/src/3rdparty/v8/tools/js2c.py
  10. +++ b/src/3rdparty/v8/tools/js2c.py
  11. @@ -33,7 +33,6 @@
  12. import os, re, sys, string
  13. import jsmin
  14. -import bz2
  15. def ToCAsciiArray(lines):
  16. @@ -344,6 +343,7 @@
  17. else:
  18. raw_sources_declaration = RAW_SOURCES_COMPRESSION_DECLARATION
  19. if env['COMPRESSION'] == 'bz2':
  20. + import bz2
  21. all_sources = bz2.compress("".join(all_sources))
  22. total_length = len(all_sources)
  23. sources_data = ToCArray(all_sources)