Merge pull request #5040 from electron/python2
Allow bootstrap to be invoked via python2
This commit is contained in:
commit
bcb4ba6f99
7 changed files with 19 additions and 13 deletions
|
@ -15,7 +15,7 @@
|
||||||
'openssl_fips': '',
|
'openssl_fips': '',
|
||||||
'openssl_no_asm': 1,
|
'openssl_no_asm': 1,
|
||||||
'node_release_urlbase': 'https://atom.io/download/atom-shell',
|
'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_target_type': 'shared_library',
|
||||||
'node_install_npm': 'false',
|
'node_install_npm': 'false',
|
||||||
'node_prefix': '',
|
'node_prefix': '',
|
||||||
|
|
|
@ -168,7 +168,8 @@ def download_sysroot(target_arch):
|
||||||
target_arch = 'i386'
|
target_arch = 'i386'
|
||||||
if target_arch == 'x64':
|
if target_arch == 'x64':
|
||||||
target_arch = 'amd64'
|
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])
|
'--arch', target_arch])
|
||||||
|
|
||||||
def create_chrome_version_h():
|
def create_chrome_version_h():
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
'arm_neon%': 1,
|
'arm_neon%': 1,
|
||||||
|
|
||||||
# Abosulte path to source root.
|
# 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.
|
# Copy conditionally-set variables out one scope.
|
||||||
|
|
3
tools/atom_source_root.js
Normal file
3
tools/atom_source_root.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
var path = require('path')
|
||||||
|
|
||||||
|
console.log(path.resolve(path.dirname(__dirname)))
|
|
@ -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
6
tools/get-endianness.js
Normal 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')
|
||||||
|
}
|
|
@ -31,6 +31,11 @@ then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
python2=$(which python2)
|
||||||
|
if [ ! -x "$python2" ] ; then
|
||||||
|
python2=python
|
||||||
|
fi
|
||||||
|
|
||||||
rewrite=`dirname $0`/rewrite_dirs.py
|
rewrite=`dirname $0`/rewrite_dirs.py
|
||||||
package=${!#}
|
package=${!#}
|
||||||
|
|
||||||
|
@ -46,4 +51,4 @@ set -e
|
||||||
# pkg-config's |prefix| variable.
|
# pkg-config's |prefix| variable.
|
||||||
prefix=`PKG_CONFIG_LIBDIR=$libdir pkg-config --variable=prefix "$package" | sed -e 's|/usr$||'`
|
prefix=`PKG_CONFIG_LIBDIR=$libdir pkg-config --variable=prefix "$package" | sed -e 's|/usr$||'`
|
||||||
result=`PKG_CONFIG_LIBDIR=$libdir pkg-config "$@"`
|
result=`PKG_CONFIG_LIBDIR=$libdir pkg-config "$@"`
|
||||||
echo "$result"| $rewrite --sysroot "$root" --strip-prefix "$prefix"
|
echo "$result"| $python2 $rewrite --sysroot "$root" --strip-prefix "$prefix"
|
||||||
|
|
Loading…
Add table
Reference in a new issue