Patchwork [1/2,V3] Add bzip2 to host-python when it is selected (aids in compiling nodejs)

login
register
mail settings
Submitter Thomas Petazzoni
Date March 4, 2013, 8:52 p.m.
Message ID <20130304215240.5316cea9@skate>
Download mbox | patch
Permalink /patch/224829/
State Superseded
Headers show

Comments

Thomas Petazzoni - March 4, 2013, 8:52 p.m.
Dear Daniel Price,

On Thu, 28 Feb 2013 17:05:40 -0800, Daniel Price wrote:
> Based off of patches posted by (and Signed-off-by): Jonathan Liu <net147@gmail.com>
> 
> Signed-off-by: Daniel Price <daniel.price@gmail.com>

If you add the attached patch to the nodejs package, then we no longer
need the bz2 module in Python, at least not in the default nodejs build.

Thomas
Daniel Price - March 5, 2013, 1:07 a.m.
Ok.  I'm agnostic about how we solve this.  I can incorporate your
patch.  So do I append your "Signed-off-by" to mine?   I don't want to
do it the wrong way.

        -dp

On Mon, Mar 4, 2013 at 12:52 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Daniel Price,
>
> On Thu, 28 Feb 2013 17:05:40 -0800, Daniel Price wrote:
>> Based off of patches posted by (and Signed-off-by): Jonathan Liu <net147@gmail.com>
>>
>> Signed-off-by: Daniel Price <daniel.price@gmail.com>
>
> If you add the attached patch to the nodejs package, then we no longer
> need the bz2 module in Python, at least not in the default nodejs build.
>
> Thomas
> --
> Thomas Petazzoni, Free Electrons
> Kernel, drivers, real-time and embedded Linux
> development, consulting, training and support.
> http://free-electrons.com



--
Daniel.Price@gmail.com; Twitter: @danielbprice
Thomas Petazzoni - March 5, 2013, 4:35 a.m.
Dear Daniel Price,

On Mon, 4 Mar 2013 17:07:33 -0800, Daniel Price wrote:

> Ok.  I'm agnostic about how we solve this.  I can incorporate your
> patch.  So do I append your "Signed-off-by" to mine?   I don't want to
> do it the wrong way.

Yes, you can keep my Signed-off-by inside the
nodejs-remove-python-bz2-dependency.patch file, and add your own after
mine. No need to append my Signed-off-by on the global nodejs patch,
though.

Best regards,

Thomas

Patch

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)