aboutsummaryrefslogtreecommitdiffstats
path: root/package/nodejs/nodejs-remove-python-bz2-dependency.patch
blob: 75fe437502223dcd7998ad02d81d8f454e136d0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Remove dependency on Python bz2 module

The Python bz2 module is only needed in certain cases, so only import
it when needed. In the normal nodejs build, this allows to remove the
dependency on this module.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Index: b/deps/v8/tools/js2c.py
===================================================================
--- a/deps/v8/tools/js2c.py
+++ b/deps/v8/tools/js2c.py
@@ -33,7 +33,6 @@
 
 import os, re, sys, string
 import jsmin
-import bz2
 
 
 def ToCAsciiArray(lines):
@@ -344,6 +343,7 @@
   else:
     raw_sources_declaration = RAW_SOURCES_COMPRESSION_DECLARATION
     if env['COMPRESSION'] == 'bz2':
+      import bz2
       all_sources = bz2.compress("".join(all_sources))
     total_length = len(all_sources)
     sources_data = ToCArray(all_sources)