Commit ed48d912 authored by Jérome Perrin's avatar Jérome Perrin

chromedriver

parent 26ecd101
......@@ -161,25 +161,64 @@ script =
os.system('"${findutils:location}/bin/find" "%(location)s" -type f -exec "${coreutils:location}/bin/chmod" a+r {} \;')
os.chmod(wrapper_location, 0755)
[chromedriver-wrapper-2.41]
<= chromedriver-wrapper
wrapper-name = chromedriver-2.41
part = ${chromedriver-2.41:location}
[chromedriver-wrapper]
# generate a wrapper named ${:wrapper-name} setting $LD_LIBRARY_PATH,
# using chromedriver installed from ${:part}
wrapper-name = chromedriver
part = ${chromium:location}
recipe = slapos.recipe.build
location = ${buildout:bin-directory}/${:wrapper-name}
script =
chromium = self.options['part']
part = self.buildout[os.path.basename(chromium)]
with open(%(location)r, 'w') as f:
f.write("""#!/bin/sh -e
cd {}
export LD_LIBRARY_PATH=$PWD:{}
export PATH={}:$PATH
exec ./chromedriver "$@"
""".format(
chromium,
':'.join(part['library'].split()),
':'.join(part['path'].split()),
))
os.fchmod(f.fileno(), 0o755)
[chromedriver]
<= chromedriver-2.41
[chromedriver-2.41]
<= chromedriver-base
<= chromedriver-download
version = 2.41
# Supports Chrome v67-69
x86_64-md5sum = fbd8b9561575054e0e7e9cc53b680a70
md5sum-x86_64 = fbd8b9561575054e0e7e9cc53b680a70
[chromedriver-base]
# Installs chromedriver ${version}
recipe = slapos.recipe.build
location = ${buildout:bin-directory}/${:_buildout_section_name_}
[chromedriver-download]
# Installs chromedriver ${version}.
# This chromedriver is not usable directly, it needs a wrapper.
version =
md5sum-x86_64 =
x86-64 = https://chromedriver.storage.googleapis.com/${:version}/chromedriver_linux64.zip
recipe = slapos.recipe.build
x86-64 = https://chromedriver.storage.googleapis.com/${:version}/chromedriver_linux64.zip ${:md5sum-x86_64}
library =
${nss:location}/lib
${nspr:location}/lib
path =
script =
url, md5sum = self.options[guessPlatform()].split()
extract_dir = self.extract(self.download(url, md5sum))
shutil.copy(extract_dir + '/chromedriver', %(location)r)
\ No newline at end of file
os.mkdir(%(location)r)
shutil.copy(extract_dir + '/chromedriver', %(location)r)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment