From 5ef24fc28751b234c473c09bfde2964b5faf96fd Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Fri, 16 Jan 2009 17:18:49 +0000 Subject: [PATCH] Remove the last remnants of local pybindgen handling (allinone takes care of pybindgen now) --- bindings/python/wscript | 66 ----------------------------------------- wscript | 3 -- 2 files changed, 69 deletions(-) diff --git a/bindings/python/wscript b/bindings/python/wscript index 7b3181b98..bd74e470b 100644 --- a/bindings/python/wscript +++ b/bindings/python/wscript @@ -14,11 +14,6 @@ import Logs import Build import Utils -## Adjust python path to look for our local copy of pybindgen -LOCAL_PYBINDGEN_PATH = os.path.join(os.getcwd(), "bindings", "python", "pybindgen") -#PYBINDGEN_BRANCH = 'lp:pybindgen' -PYBINDGEN_BRANCH = 'https://launchpad.net/pybindgen' - ## https://launchpad.net/pybindgen/ REQUIRED_PYBINDGEN_VERSION = (0, 9, 0, 605) REQUIRED_PYGCCXML_VERSION = (0, 9, 5) @@ -33,8 +28,6 @@ def add_to_python_path(path): def set_pybindgen_pythonpath(env): if env['WITH_PYBINDGEN']: add_to_python_path(env['WITH_PYBINDGEN']) - else: - add_to_python_path(LOCAL_PYBINDGEN_PATH) def set_options(opt): @@ -47,67 +40,11 @@ def set_options(opt): help=("Rescan Python bindings. Needs working GCCXML / pygccxml environment."), action="store_true", default=False, dest='python_scan') - opt.add_option('--pybindgen-checkout', - help=("During configure, force checkout of pybingen inside ns-3, " - "instead of using the system installed version."), - action="store_true", default=False, - dest='pybindgen_checkout') opt.add_option('--with-pybindgen', help=('Path to an existing pybindgen source tree to use.'), default=None, dest='with_pybindgen', type="string") -def fetch_pybindgen(conf): - """ - Fetches pybindgen from launchpad as bindings/python/pybindgen. - Returns True if successful, False it not. - """ - bzr = conf.find_program("bzr") - if not bzr: - Logs.warn("the program 'bzr' is needed in order to fetch pybindgen") - return False - if len(REQUIRED_PYBINDGEN_VERSION) == 4: - rev = "-rrevno:%i" % REQUIRED_PYBINDGEN_VERSION[3] - else: - rev = "-rtag:%s" % '.'.join([str(x) for x in REQUIRED_PYBINDGEN_VERSION]) - - if os.path.exists(LOCAL_PYBINDGEN_PATH): - print "Trying to update pybindgen; this will fail if no network connection is available. Hit Ctrl-C to skip." - - cmd = [bzr, "pull", rev, PYBINDGEN_BRANCH] - print " => ", ' '.join(cmd) - try: - if subprocess.Popen(cmd, cwd=LOCAL_PYBINDGEN_PATH).wait(): - return False - except KeyboardInterrupt: - print "Interrupted; Python bindings will be disabled." - return False - print "Update was successful." - else: - print "Trying to fetch pybindgen; this will fail if no network connection is available. Hit Ctrl-C to skip." - cmd = [bzr, "checkout", rev, PYBINDGEN_BRANCH, LOCAL_PYBINDGEN_PATH] - print " => ", ' '.join(cmd) - try: - if subprocess.Popen(cmd).wait(): - return False - except KeyboardInterrupt: - print "Interrupted; Python bindings will be disabled." - shutil.rmtree(LOCAL_PYBINDGEN_PATH, True) - return False - print "Fetch was successful." - - ## generate a fake version.py file in pybindgen it's safer this - ## way, since the normal version generation process requires - ## bazaar python bindings, which may not be available. - vfile = open(os.path.join(LOCAL_PYBINDGEN_PATH, "pybindgen", "version.py"), "wt") - vfile.write(""" -# (fake version generated by ns-3) -__version__ = %r -""" % list(REQUIRED_PYBINDGEN_VERSION)) - vfile.close() - - return True - def configure(conf): conf.env['ENABLE_PYTHON_BINDINGS'] = False @@ -140,9 +77,6 @@ def configure(conf): conf.env['WITH_PYBINDGEN'] = os.path.abspath(Options.options.with_pybindgen) no_net = True - if Options.options.pybindgen_checkout: - fetch_pybindgen(conf) - set_pybindgen_pythonpath(conf.env) try: diff --git a/wscript b/wscript index 9dd11b79a..cbf06337c 100644 --- a/wscript +++ b/wscript @@ -53,9 +53,6 @@ def dist_hook(): shutil.rmtree("doc/latex", True) shutil.rmtree("nsc", True) - if not os.path.exists("bindings/python/pybindgen"): - raise Utils.WafError("Missing pybindgen checkout; run './waf configure --pybindgen-checkout' first.") - ## build the name of the traces subdirectory. Will be something like ## ns-3-dev-ref-traces traces_name = APPNAME + '-' + VERSION + regression.REGRESSION_SUFFIX