buildout.cfg 1.56 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
# Command line tool to test QUIC protocol
# This is compiled version provided by Lucas Clemente (thanks!), which
# drastically simplifies https://www.chromium.org/quic/playing-with-quic
# approach, which requires big chunks of Chromium compilation environment
[buildout]
extends =
# running
  ../nss/buildout.cfg
  ../nspr/buildout.cfg
  ../glib/buildout.cfg
  ../pcre/buildout.cfg
  ../libffi/buildout.cfg
  ../zlib/buildout.cfg
  ../libuuid/buildout.cfg
# compilation
  ../git/buildout.cfg

parts =
  quic_client-bin

[quic_client-bin]
recipe = slapos.recipe.build
url = https://github.com/lucas-clemente/quic-clients/archive/557cb1f99f591614d474e182b50cfee9334e0ffd.zip
md5sum = e2c78f4f7fb6ed03f6eec25b5e54fed3
slapos_promise =
    file:quic_client
    file:client-linux-debug
library =
  ${nss:location}/lib
  ${nspr:location}/lib
  ${glib:location}/lib
  ${pcre:location}/lib
  ${libffi:location}/lib
  ${zlib:location}/lib
  ${libuuid:location}/lib
script =
  import glob
  location = %(location)r
  self.failIfPathExists(location)
  url = self.options['url']
  md5sum = self.options['md5sum']
  extract_dir = self.extract(self.download(url, md5sum))
  os.mkdir(location)
  source_file = glob.glob(os.path.join(extract_dir, '*', 'client-linux-debug'))[0]
  shutil.copy(source_file, location)
  wrapper_path = os.path.join(location, 'quic_client')
  with open(wrapper_path, 'w') as f:
    f.write("""#!/bin/sh -e
  export LD_LIBRARY_PATH={}
  exec {}/client-linux-debug "$@"
  """.format(
    ':'.join(self.options['library'].split()),
    location
  ))
    os.fchmod(f.fileno(), 0o755)