buildout.cfg 1.47 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
# 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
14
  ../util-linux/buildout.cfg
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
# 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
36 37 38
install =
  import glob, os, shutil
  extract_dir = self.extract(self.download(options['url'], options['md5sum']))
39 40 41 42 43 44 45 46 47
  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(
48
    ':'.join(options['library'].split()),
49 50 51
    location
  ))
    os.fchmod(f.fileno(), 0o755)