Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(645)

Unified Diff: lib/naclports/util.py

Issue 1393343002: Improve emscripten download, install and auto-detection (Closed) Base URL: https://chromium.googlesource.com/external/naclports.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/naclports/source_package.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/naclports/util.py
diff --git a/lib/naclports/util.py b/lib/naclports/util.py
index dc57cea287ddfa695e723e8ed2c71b10981fa6f1..881ef07a4a34b8cb87e20dbd6f51cd6663a2edb5 100644
--- a/lib/naclports/util.py
+++ b/lib/naclports/util.py
@@ -250,6 +250,26 @@ def GetEmscriptenRoot():
return emscripten
+def SetupEmscripten():
+ if 'EMSCRIPTEN' in os.environ:
+ return
+
+ local_root = GetEmscriptenRoot()
+ os.environ['EMSCRIPTEN'] = local_root
+ os.environ['EM_CONFIG'] = os.path.join(os.path.dirname(local_root),
+ '.emscripten')
+ try:
+ FindInPath('node')
+ except error.Error:
+ node_bin = os.path.join(paths.OUT_DIR, 'node', 'bin')
+ if not os.path.isdir(node_bin):
+ raise error.Error('node not found in path and default path not found: %s'
+ % node_bin)
+
+ os.environ['PATH'] += ':' + node_bin
+ FindInPath('node')
+
+
@Memoize
def GetSDKVersion():
"""Returns the version (as a string) of the current SDK."""
@@ -278,7 +298,6 @@ def GetPlatform():
platform = subprocess.check_output([getos]).strip()
return platform
-
@Memoize
def GetToolchainRoot(config):
"""Returns the toolchain folder for a given NaCl toolchain."""
« no previous file with comments | « lib/naclports/source_package.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698