build/python/project: add build(), calls _build()

Prepare to add some code around the _build() call.
This commit is contained in:
Max Kellermann 2021-08-28 22:41:31 +02:00 committed by Max Kellermann
parent 4f2f705dca
commit 6f278977e9
9 changed files with 11 additions and 8 deletions

View File

@ -55,7 +55,7 @@ class AutotoolsProject(MakeProject):
subprocess.check_call(configure, cwd=build, env=toolchain.env) subprocess.check_call(configure, cwd=build, env=toolchain.env)
return build return build
def build(self, toolchain): def _build(self, toolchain):
build = self.configure(toolchain) build = self.configure(toolchain)
if self.subdirs is not None: if self.subdirs is not None:
for subdir in self.subdirs: for subdir in self.subdirs:

View File

@ -12,7 +12,7 @@ class BoostProject(Project):
name='boost', version=version, name='boost', version=version,
**kwargs) **kwargs)
def build(self, toolchain): def _build(self, toolchain):
src = self.unpack(toolchain) src = self.unpack(toolchain)
# install the headers manually; don't build any library # install the headers manually; don't build any library

View File

@ -53,7 +53,7 @@ class CmakeProject(Project):
configure(toolchain, src, build, configure_args) configure(toolchain, src, build, configure_args)
return build return build
def build(self, toolchain): def _build(self, toolchain):
build = self.configure(toolchain) build = self.configure(toolchain)
subprocess.check_call(['ninja', 'install'], subprocess.check_call(['ninja', 'install'],
cwd=build, env=toolchain.env) cwd=build, env=toolchain.env)

View File

@ -10,7 +10,7 @@ class FfmpegProject(Project):
self.configure_args = configure_args self.configure_args = configure_args
self.cppflags = cppflags self.cppflags = cppflags
def build(self, toolchain): def _build(self, toolchain):
src = self.unpack(toolchain) src = self.unpack(toolchain)
build = self.make_build_path(toolchain) build = self.make_build_path(toolchain)

View File

@ -26,7 +26,7 @@ class JackProject(Project):
base='jack2-' + self.version, base='jack2-' + self.version,
**kwargs) **kwargs)
def build(self, toolchain): def _build(self, toolchain):
src = self.unpack(toolchain) src = self.unpack(toolchain)
includes = ['jack.h', 'ringbuffer.h', 'systemdeps.h', 'transport.h', 'types.h', 'weakmacros.h'] includes = ['jack.h', 'ringbuffer.h', 'systemdeps.h', 'transport.h', 'types.h', 'weakmacros.h']

View File

@ -115,7 +115,7 @@ class MesonProject(Project):
configure(toolchain, src, build, self.configure_args) configure(toolchain, src, build, self.configure_args)
return build return build
def build(self, toolchain): def _build(self, toolchain):
build = self.configure(toolchain) build = self.configure(toolchain)
subprocess.check_call(['ninja', 'install'], subprocess.check_call(['ninja', 'install'],
cwd=build, env=toolchain.env) cwd=build, env=toolchain.env)

View File

@ -23,7 +23,7 @@ class OpenSSLProject(MakeProject):
'RANLIB=' + toolchain.ranlib, 'RANLIB=' + toolchain.ranlib,
] ]
def build(self, toolchain): def _build(self, toolchain):
src = self.unpack(toolchain, out_of_tree=False) src = self.unpack(toolchain, out_of_tree=False)
# OpenSSL has a weird target architecture scheme with lots of # OpenSSL has a weird target architecture scheme with lots of

View File

@ -79,3 +79,6 @@ class Project:
pass pass
os.makedirs(path, exist_ok=True) os.makedirs(path, exist_ok=True)
return path return path
def build(self, toolchain):
self._build(toolchain)

View File

@ -7,7 +7,7 @@ class ZlibProject(Project):
**kwargs): **kwargs):
Project.__init__(self, url, md5, installed, **kwargs) Project.__init__(self, url, md5, installed, **kwargs)
def build(self, toolchain): def _build(self, toolchain):
src = self.unpack(toolchain, out_of_tree=False) src = self.unpack(toolchain, out_of_tree=False)
subprocess.check_call(['/usr/bin/make', '--quiet', subprocess.check_call(['/usr/bin/make', '--quiet',