summaryrefslogtreecommitdiff
path: root/morphlib/builder.py
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-03-30 16:16:29 +0100
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-03-30 16:16:29 +0100
commit9573dacaa43d3d05f0e60641dcb2139623ae3007 (patch)
tree0f807b98925bde0b2f5503a035894e0a3f82ada4 /morphlib/builder.py
parent609a64acedf6ec4697bf129b29f3c1187ae5d7e9 (diff)
downloadmorph-9573dacaa43d3d05f0e60641dcb2139623ae3007.tar.gz
Make use of the new build system class in ChunkBuilder
Diffstat (limited to 'morphlib/builder.py')
-rw-r--r--morphlib/builder.py38
1 files changed, 2 insertions, 36 deletions
diff --git a/morphlib/builder.py b/morphlib/builder.py
index fa0943a4..643ce04a 100644
--- a/morphlib/builder.py
+++ b/morphlib/builder.py
@@ -229,38 +229,6 @@ class BlobBuilder(object): # pragma: no cover
class ChunkBuilder(BlobBuilder): # pragma: no cover
- build_system = {
- 'dummy': {
- 'configure-commands': [
- 'echo dummy configure',
- ],
- 'build-commands': [
- 'echo dummy build',
- ],
- 'test-commands': [
- 'echo dummy test',
- ],
- 'install-commands': [
- 'echo dummy install',
- ],
- },
- 'autotools': {
- 'configure-commands': [
- 'if [ -e autogen.sh ]; then ./autogen.sh; ' +
- 'elif [ ! -e ./configure ]; then autoreconf -ivf; fi',
- './configure --prefix="$PREFIX"',
- ],
- 'build-commands': [
- 'make',
- ],
- 'test-commands': [
- ],
- 'install-commands': [
- 'make DESTDIR="$DESTDIR" install',
- ],
- },
- }
-
def builds(self):
ret = {}
for chunk_name in self.blob.chunks:
@@ -312,15 +280,13 @@ class ChunkBuilder(BlobBuilder): # pragma: no cover
bs_name = self.blob.morph.build_system
if bs_name:
- bs = self.build_system[bs_name]
+ bs = morphlib.buildsystem.lookup_build_system(bs_name)
else:
bs = {}
def run_them(runner, what):
- key = '%s-commands' % what
attr = '%s_commands' % what
- cmds = bs.get(key, [])
- cmds = getattr(self.blob.morph, attr, []) or cmds
+ cmds = getattr(self.blob.morph, attr, []) or bs[attr]
runner(what, cmds)
run_them(self.run_sequentially, 'configure')