Merge pull request #5040 from electron/python2

Allow bootstrap to be invoked via python2
This commit is contained in:
Cheng Zhao 2016-04-07 16:10:51 +09:00
commit bcb4ba6f99
7 changed files with 19 additions and 13 deletions

View file

@ -15,7 +15,7 @@
'openssl_fips': '',
'openssl_no_asm': 1,
'node_release_urlbase': 'https://atom.io/download/atom-shell',
'node_byteorder': '<!(python -c "import sys; print sys.byteorder")',
'node_byteorder': '<!(node <(DEPTH)/tools/get-endianness.js)',
'node_target_type': 'shared_library',
'node_install_npm': 'false',
'node_prefix': '',

View file

@ -168,7 +168,8 @@ def download_sysroot(target_arch):
target_arch = 'i386'
if target_arch == 'x64':
target_arch = 'amd64'
execute_stdout([os.path.join(SOURCE_ROOT, 'script', 'install-sysroot.py'),
execute_stdout([sys.executable,
os.path.join(SOURCE_ROOT, 'script', 'install-sysroot.py'),
'--arch', target_arch])
def create_chrome_version_h():

View file

@ -16,7 +16,7 @@
'arm_neon%': 1,
# Abosulte path to source root.
'source_root%': '<!(python <(DEPTH)/tools/atom_source_root.py)',
'source_root%': '<!(node <(DEPTH)/tools/atom_source_root.js)',
},
# Copy conditionally-set variables out one scope.

View file

@ -0,0 +1,3 @@
var path = require('path')
console.log(path.resolve(path.dirname(__dirname)))

View file

@ -1,9 +0,0 @@
#!/usr/bin/env python
import os
"""Prints the absolute path of the root of atom-shell's source tree.
"""
print os.path.abspath(os.path.dirname(os.path.dirname(__file__)))

6
tools/get-endianness.js Normal file
View file

@ -0,0 +1,6 @@
var os = require('os')
if (os.endianness) {
console.log(require('os').endianness() === 'BE' ? 'big' : 'little')
} else { // Your Node is rather old, but I don't care.
console.log('little')
}

View file

@ -31,6 +31,11 @@ then
exit 1
fi
python2=$(which python2)
if [ ! -x "$python2" ] ; then
python2=python
fi
rewrite=`dirname $0`/rewrite_dirs.py
package=${!#}
@ -46,4 +51,4 @@ set -e
# pkg-config's |prefix| variable.
prefix=`PKG_CONFIG_LIBDIR=$libdir pkg-config --variable=prefix "$package" | sed -e 's|/usr$||'`
result=`PKG_CONFIG_LIBDIR=$libdir pkg-config "$@"`
echo "$result"| $rewrite --sysroot "$root" --strip-prefix "$prefix"
echo "$result"| $python2 $rewrite --sysroot "$root" --strip-prefix "$prefix"