Add --libcapnp-url to allow installing arbitrary libcapnp versions

This commit is contained in:
Jason Paryani
2016-02-17 17:23:04 -08:00
parent f78ca108f6
commit 5d69eda752
3 changed files with 30 additions and 5 deletions

View File

@@ -79,6 +79,14 @@ force_cython = "--force-cython" in sys.argv
if force_cython:
sys.argv.remove("--force-cython")
use_cython = True
libcapnp_url = None
try:
libcapnp_url_index = sys.argv.index("--libcapnp-url")
libcapnp_url = sys.argv[libcapnp_url_index + 1]
sys.argv.remove("--libcapnp-url")
sys.argv.remove(libcapnp_url)
except:
pass
if use_cython:
from Cython.Distutils import build_ext as build_ext_c
@@ -107,7 +115,7 @@ class build_libcapnp_ext(build_ext_c):
build_dir = os.path.join(_this_dir, "build")
if not os.path.exists(build_dir):
os.mkdir(build_dir)
fetch_libcapnp(bundle_dir)
fetch_libcapnp(bundle_dir, libcapnp_url)
build_libcapnp(bundle_dir, build_dir)