{android,win32}/build.py: move class BoostProject to build/boost.py
This commit is contained in:
parent
e70f7141be
commit
f97ad2b2ee
|
@ -1,8 +1,7 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import os, os.path
|
import os, os.path
|
||||||
import sys, shutil, subprocess
|
import sys, subprocess
|
||||||
import re
|
|
||||||
|
|
||||||
if len(sys.argv) < 3:
|
if len(sys.argv) < 3:
|
||||||
print("Usage: build.py SDK_PATH NDK_PATH [configure_args...]", file=sys.stderr)
|
print("Usage: build.py SDK_PATH NDK_PATH [configure_args...]", file=sys.stderr)
|
||||||
|
@ -112,6 +111,7 @@ class AndroidNdkToolchain:
|
||||||
|
|
||||||
from build.project import Project
|
from build.project import Project
|
||||||
from build.autotools import AutotoolsProject
|
from build.autotools import AutotoolsProject
|
||||||
|
from build.boost import BoostProject
|
||||||
|
|
||||||
class FfmpegProject(Project):
|
class FfmpegProject(Project):
|
||||||
def __init__(self, url, md5, installed, configure_args=[],
|
def __init__(self, url, md5, installed, configure_args=[],
|
||||||
|
@ -146,33 +146,6 @@ class FfmpegProject(Project):
|
||||||
subprocess.check_call(['/usr/bin/make', '--quiet', '-j12'], cwd=build, env=toolchain.env)
|
subprocess.check_call(['/usr/bin/make', '--quiet', '-j12'], cwd=build, env=toolchain.env)
|
||||||
subprocess.check_call(['/usr/bin/make', '--quiet', 'install'], cwd=build, env=toolchain.env)
|
subprocess.check_call(['/usr/bin/make', '--quiet', 'install'], cwd=build, env=toolchain.env)
|
||||||
|
|
||||||
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))
|
|
||||||
|
|
||||||
# a list of third-party libraries to be used by MPD on Android
|
# a list of third-party libraries to be used by MPD on Android
|
||||||
thirdparty_libs = [
|
thirdparty_libs = [
|
||||||
AutotoolsProject(
|
AutotoolsProject(
|
||||||
|
|
|
@ -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))
|
|
@ -1,8 +1,7 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import os, os.path
|
import os, os.path
|
||||||
import sys, shutil, subprocess
|
import sys, subprocess
|
||||||
import re
|
|
||||||
|
|
||||||
configure_args = sys.argv[1:]
|
configure_args = sys.argv[1:]
|
||||||
|
|
||||||
|
@ -60,6 +59,7 @@ class CrossGccToolchain:
|
||||||
|
|
||||||
from build.project import Project
|
from build.project import Project
|
||||||
from build.autotools import AutotoolsProject
|
from build.autotools import AutotoolsProject
|
||||||
|
from build.boost import BoostProject
|
||||||
|
|
||||||
class ZlibProject(Project):
|
class ZlibProject(Project):
|
||||||
def __init__(self, url, md5, installed,
|
def __init__(self, url, md5, installed,
|
||||||
|
@ -115,33 +115,6 @@ class FfmpegProject(Project):
|
||||||
subprocess.check_call(['/usr/bin/make', '--quiet', 'install'],
|
subprocess.check_call(['/usr/bin/make', '--quiet', 'install'],
|
||||||
cwd=build, env=toolchain.env)
|
cwd=build, env=toolchain.env)
|
||||||
|
|
||||||
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))
|
|
||||||
|
|
||||||
# a list of third-party libraries to be used by MPD on Android
|
# a list of third-party libraries to be used by MPD on Android
|
||||||
thirdparty_libs = [
|
thirdparty_libs = [
|
||||||
AutotoolsProject(
|
AutotoolsProject(
|
||||||
|
|
Loading…
Reference in New Issue