summaryrefslogtreecommitdiff
blob: 85f34b6178fe3abe3ce318501a3ffc66cb478952 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
From 56b57ea7f0c111bfd9c719060cf17346e638fdd1 Mon Sep 17 00:00:00 2001
From: Elvis Pranskevichus <elvis@magic.io>
Date: Wed, 10 Feb 2016 14:45:13 -0500
Subject: [PATCH] Build fixes

---
 node.gyp         | 5 +++--
 src/node.cc      | 8 --------
 src/node.js      | 2 ++
 src/node_main.cc | 2 ++
 4 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/node.gyp b/node.gyp
index d431210..fea5e07 100644
--- a/node.gyp
+++ b/node.gyp
@@ -1,6 +1,7 @@
 {
   'variables': {
     'v8_use_snapshot%': 'false',
+    'v8_gyp_path%': 'deps/v8/tools/gyp/v8.gyp',
     'node_use_dtrace%': 'false',
     'node_use_lttng%': 'false',
     'node_use_etw%': 'false',
@@ -89,8 +90,8 @@
       'dependencies': [
         'node_js2c#host',
         'deps/cares/cares.gyp:cares',
-        # 'deps/v8/tools/gyp/v8.gyp:v8',
-        # 'deps/v8/tools/gyp/v8.gyp:v8_libplatform'
+        '<(v8_gyp_path):v8',
+        '<(v8_gyp_path):v8_libplatform'
       ],
 
       'include_dirs': [
diff --git a/src/node.cc b/src/node.cc
index 7df6053..cbe1538 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -4085,15 +4085,11 @@ static void StartNodeInstance(void* arg) {
       SealHandleScope seal(isolate);
       bool more;
       do {
-#if 0
         v8::platform::PumpMessageLoop(default_platform, isolate);
-#endif
         more = uv_run(env->event_loop(), UV_RUN_ONCE);
 
         if (more == false) {
-#if 0
           v8::platform::PumpMessageLoop(default_platform, isolate);
-#endif
           EmitBeforeExit(env);
 
           // Emit `beforeExit` if the loop became alive either after emitting
@@ -4153,10 +4149,8 @@ int Start(int argc, char** argv) {
 #endif
 
   const int thread_pool_size = 4;
-#if 0
   default_platform = v8::platform::CreateDefaultPlatform(thread_pool_size);
   V8::InitializePlatform(default_platform);
-#endif
   V8::Initialize();
 
   int exit_code = 1;
@@ -4173,10 +4167,8 @@ int Start(int argc, char** argv) {
   }
   V8::Dispose();
 
-#if 0
   delete default_platform;
   default_platform = nullptr;
-#endif
 
   delete[] exec_argv;
   exec_argv = nullptr;
diff --git a/src/node.js b/src/node.js
index 37aa371..a835d0a 100644
--- a/src/node.js
+++ b/src/node.js
@@ -40,7 +40,9 @@
     startup.globalConsole();
     }  // not isRenderer
 
+    if (!process.env.ELECTRON_NODE_DISABLE_ASAR_SUPPORT) {
     startup.initAsarSupport();
+    }
 
     startup.processAssert();
     startup.processConfig();
diff --git a/src/node_main.cc b/src/node_main.cc
index 58e747e..24949f3 100644
--- a/src/node_main.cc
+++ b/src/node_main.cc
@@ -40,8 +40,10 @@ int wmain(int argc, wchar_t *wargv[]) {
 }
 #else
 // UNIX
+#include <stdlib.h>
 int main(int argc, char *argv[]) {
   setvbuf(stderr, NULL, _IOLBF, 1024);
+  putenv("ELECTRON_NODE_DISABLE_ASAR_SUPPORT=1");
   return node::Start(argc, argv);
 }
 #endif
-- 
2.7.3