summaryrefslogtreecommitdiffstats
path: root/waflib/extras/package.py
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-04-21 23:04:24 +0200
committerDavid Robillard <d@drobilla.net>2019-04-21 23:04:24 +0200
commit9091b844259d78b42f94656dd3412075ce6a76a1 (patch)
tree1258158fbc5ebcf64196e82049ba85e9451738d2 /waflib/extras/package.py
parentc1637b46f9ff960f58dcf2bb3b69bff231f8acfd (diff)
downloadlilv-9091b844259d78b42f94656dd3412075ce6a76a1.tar.gz
lilv-9091b844259d78b42f94656dd3412075ce6a76a1.tar.bz2
lilv-9091b844259d78b42f94656dd3412075ce6a76a1.zip
Switch to using a submodule for autowaf
Diffstat (limited to 'waflib/extras/package.py')
m---------waflib0
-rw-r--r--waflib/extras/package.py76
2 files changed, 0 insertions, 76 deletions
diff --git a/waflib b/waflib
new file mode 160000
+Subproject 2314e236ca6e7d94a26c3c17091da0f25f5867f
diff --git a/waflib/extras/package.py b/waflib/extras/package.py
deleted file mode 100644
index c06498e..0000000
--- a/waflib/extras/package.py
+++ /dev/null
@@ -1,76 +0,0 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# Thomas Nagy, 2011
-
-"""
-Obtain packages, unpack them in a location, and add associated uselib variables
-(CFLAGS_pkgname, LIBPATH_pkgname, etc).
-
-The default is use a Dependencies.txt file in the source directory.
-
-This is a work in progress.
-
-Usage:
-
-def options(opt):
- opt.load('package')
-
-def configure(conf):
- conf.load_packages()
-"""
-
-from waflib import Logs
-from waflib.Configure import conf
-
-try:
- from urllib import request
-except ImportError:
- from urllib import urlopen
-else:
- urlopen = request.urlopen
-
-
-CACHEVAR = 'WAFCACHE_PACKAGE'
-
-@conf
-def get_package_cache_dir(self):
- cache = None
- if CACHEVAR in conf.environ:
- cache = conf.environ[CACHEVAR]
- cache = self.root.make_node(cache)
- elif self.env[CACHEVAR]:
- cache = self.env[CACHEVAR]
- cache = self.root.make_node(cache)
- else:
- cache = self.srcnode.make_node('.wafcache_package')
- cache.mkdir()
- return cache
-
-@conf
-def download_archive(self, src, dst):
- for x in self.env.PACKAGE_REPO:
- url = '/'.join((x, src))
- try:
- web = urlopen(url)
- try:
- if web.getcode() != 200:
- continue
- except AttributeError:
- pass
- except Exception:
- # on python3 urlopen throws an exception
- # python 2.3 does not have getcode and throws an exception to fail
- continue
- else:
- tmp = self.root.make_node(dst)
- tmp.write(web.read())
- Logs.warn('Downloaded %s from %s', tmp.abspath(), url)
- break
- else:
- self.fatal('Could not get the package %s' % src)
-
-@conf
-def load_packages(self):
- self.get_package_cache_dir()
- # read the dependencies, get the archives, ..
-