From f97ad2b2ee566eb2212a1dc19128ad2213cc4f95 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 21 Nov 2015 00:17:00 +0100 Subject: {android,win32}/build.py: move class BoostProject to build/boost.py --- python/build/boost.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 python/build/boost.py (limited to 'python') diff --git a/python/build/boost.py b/python/build/boost.py new file mode 100644 index 000000000..0a68d7c2a --- /dev/null +++ b/python/build/boost.py @@ -0,0 +1,31 @@ +import os, shutil +import re + +from build.project import Project + +class BoostProject(Project): + def __init__(self, url, md5, installed, + **kwargs): + m = re.match(r'.*/boost_(\d+)_(\d+)_(\d+)\.tar\.bz2$', url) + version = "%s.%s.%s" % (m.group(1), m.group(2), m.group(3)) + Project.__init__(self, url, md5, installed, + name='boost', version=version, + **kwargs) + + def build(self, toolchain): + src = self.unpack(toolchain) + + # install the headers manually; don't build any library + # (because right now, we only use header-only libraries) + includedir = os.path.join(toolchain.install_prefix, 'include') + for dirpath, dirnames, filenames in os.walk(os.path.join(src, 'boost')): + relpath = dirpath[len(src)+1:] + destdir = os.path.join(includedir, relpath) + try: + os.mkdir(destdir) + except: + pass + for name in filenames: + if name[-4:] == '.hpp': + shutil.copyfile(os.path.join(dirpath, name), + os.path.join(destdir, name)) -- cgit v1.2.3