linux: Fix create distribution for chromedriver
This commit is contained in:
parent
c3f8ef06b6
commit
f5e6c62418
2 changed files with 22 additions and 9 deletions
|
@ -5,6 +5,7 @@ import re
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
import stat
|
||||||
|
|
||||||
from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, TARGET_PLATFORM, \
|
from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, TARGET_PLATFORM, \
|
||||||
DIST_ARCH
|
DIST_ARCH
|
||||||
|
@ -17,6 +18,8 @@ ATOM_SHELL_VERSION = get_atom_shell_version()
|
||||||
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||||
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
|
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
|
||||||
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')
|
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')
|
||||||
|
CHROMIUM_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor',
|
||||||
|
'download', 'libchromiumcontent', 'static_library')
|
||||||
|
|
||||||
SYMBOL_NAME = {
|
SYMBOL_NAME = {
|
||||||
'darwin': 'libchromiumcontent.dylib.dSYM',
|
'darwin': 'libchromiumcontent.dylib.dSYM',
|
||||||
|
@ -107,12 +110,20 @@ def copy_binaries():
|
||||||
|
|
||||||
|
|
||||||
def copy_chromedriver():
|
def copy_chromedriver():
|
||||||
build = os.path.join(SOURCE_ROOT, 'script', 'build.py')
|
|
||||||
execute([sys.executable, build, '-c', 'Release', '-t', 'copy_chromedriver'])
|
|
||||||
binary = 'chromedriver'
|
|
||||||
if TARGET_PLATFORM == 'win32':
|
if TARGET_PLATFORM == 'win32':
|
||||||
binary += '.exe'
|
chromedriver = 'chromedriver.exe'
|
||||||
shutil.copy2(os.path.join(OUT_DIR, binary), DIST_DIR)
|
else:
|
||||||
|
chromedriver = 'chromedriver'
|
||||||
|
src = os.path.join(CHROMIUM_DIR, chromedriver)
|
||||||
|
dest = os.path.join(DIST_DIR, chromedriver)
|
||||||
|
|
||||||
|
# Copy file and keep the executable bit.
|
||||||
|
shutil.copyfile(src, dest)
|
||||||
|
os.chmod(dest, os.stat(dest).st_mode | stat.S_IEXEC)
|
||||||
|
|
||||||
|
# Fix the linking with boringssl.
|
||||||
|
if TARGET_PLATFORM == 'linux':
|
||||||
|
execute(['chrpath', '-r', '$ORIGIN', dest])
|
||||||
|
|
||||||
|
|
||||||
def copy_license():
|
def copy_license():
|
||||||
|
@ -173,9 +184,11 @@ def create_chromedriver_zip():
|
||||||
with scoped_cwd(DIST_DIR):
|
with scoped_cwd(DIST_DIR):
|
||||||
files = ['LICENSE']
|
files = ['LICENSE']
|
||||||
if TARGET_PLATFORM == 'win32':
|
if TARGET_PLATFORM == 'win32':
|
||||||
files += ['chromedriver.exe']
|
files += ['chromedriver.exe', 'boringssl.dll']
|
||||||
else:
|
elif TARGET_PLATFORM == 'darwin':
|
||||||
files += ['chromedriver']
|
files += ['chromedriver', 'libboringssl.dylib']
|
||||||
|
elif TARGET_PLATFORM == 'linux':
|
||||||
|
files += ['chromedriver', 'libboringssl.so']
|
||||||
make_zip(zip_file, files, [])
|
make_zip(zip_file, files, [])
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -162,7 +162,7 @@ def get_chromedriver_version():
|
||||||
SOURCE_ROOT = os.path.abspath(os.path.join(__file__, '..', '..', '..'))
|
SOURCE_ROOT = os.path.abspath(os.path.join(__file__, '..', '..', '..'))
|
||||||
chromedriver = os.path.join(SOURCE_ROOT, 'out', 'R', 'chromedriver')
|
chromedriver = os.path.join(SOURCE_ROOT, 'out', 'R', 'chromedriver')
|
||||||
output = subprocess.check_output([chromedriver, '-v']).strip()
|
output = subprocess.check_output([chromedriver, '-v']).strip()
|
||||||
return 'v' + output[13:]
|
return 'v' + output[13:output.rfind(' ')]
|
||||||
|
|
||||||
|
|
||||||
def parse_version(version):
|
def parse_version(version):
|
||||||
|
|
Loading…
Reference in a new issue